Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Friends | List of all members
mir::compositor::SwitchingBundle Class Reference

#include <switching_bundle.h>

Inheritance diagram for mir::compositor::SwitchingBundle:
Inheritance graph
[legend]

Public Types

enum  { min_buffers = 1, max_buffers = 5 }
 

Public Member Functions

 SwitchingBundle (int nbuffers, const std::shared_ptr< graphics::GraphicBufferAllocator > &, const graphics::BufferProperties &)
 
 ~SwitchingBundle () noexcept
 
graphics::BufferProperties properties () const
 
void client_acquire (std::function< void(graphics::Buffer *buffer)> complete) override
 
void client_release (graphics::Buffer *buffer)
 
std::shared_ptr< graphics::Buffercompositor_acquire (void const *user_id) override
 Acquire the next buffer that's ready to display/composite. More...
 
void compositor_release (std::shared_ptr< graphics::Buffer > const &released_buffer)
 
std::shared_ptr< graphics::Buffersnapshot_acquire ()
 
void snapshot_release (std::shared_ptr< graphics::Buffer > const &released_buffer)
 
void force_requests_to_complete ()
 
void allow_framedropping (bool dropping_allowed)
 
bool framedropping_allowed () const
 
void resize (const geometry::Size &newsize) override
 Change the dimensions of the buffers contained in the bundle. More...
 
int buffers_ready_for_compositor () const override
 
- Public Member Functions inherited from mir::compositor::BufferBundle
virtual ~BufferBundle () noexcept
 

Friends

std::ostream & operator<< (std::ostream &os, const SwitchingBundle &bundle)
 

Additional Inherited Members

- Protected Member Functions inherited from mir::compositor::BufferBundle
 BufferBundle ()=default
 
 BufferBundle (BufferBundle const &)=delete
 
BufferBundleoperator= (BufferBundle const &)=delete
 

Member Enumeration Documentation

anonymous enum
Enumerator
min_buffers 
max_buffers 

Constructor & Destructor Documentation

mir::compositor::SwitchingBundle::SwitchingBundle ( int  nbuffers,
const std::shared_ptr< graphics::GraphicBufferAllocator > &  gralloc,
const graphics::BufferProperties property_request 
)
mir::compositor::SwitchingBundle::~SwitchingBundle ( )
noexcept

Member Function Documentation

void mir::compositor::SwitchingBundle::allow_framedropping ( bool  dropping_allowed)
virtual
int mir::compositor::SwitchingBundle::buffers_ready_for_compositor ( ) const
overridevirtual
void mir::compositor::SwitchingBundle::client_acquire ( std::function< void(graphics::Buffer *buffer)>  complete)
overridevirtual
void mir::compositor::SwitchingBundle::client_release ( graphics::Buffer buffer)
virtual
std::shared_ptr< mg::Buffer > mir::compositor::SwitchingBundle::compositor_acquire ( void const *  user_id)
overridevirtual

Acquire the next buffer that's ready to display/composite.

Parameters
[in]user_idA unique identifier of who is going to use the buffer, to ensure that separate users representing separate monitors who need the same frame will get the same buffer. However consecutive calls for the same user will get different buffers. To avoid collisions, all callers should determine user_id in the same way (e.g. always use "this" pointer).

Implements mir::compositor::BufferBundle.

void mir::compositor::SwitchingBundle::compositor_release ( std::shared_ptr< graphics::Buffer > const &  released_buffer)
virtual
void mir::compositor::SwitchingBundle::force_requests_to_complete ( )
virtual
bool mir::compositor::SwitchingBundle::framedropping_allowed ( ) const
mg::BufferProperties mir::compositor::SwitchingBundle::properties ( ) const
virtual
void mir::compositor::SwitchingBundle::resize ( const geometry::Size newsize)
overridevirtual

Change the dimensions of the buffers contained in the bundle.

For client_acquire, the change is guaranteed to be immediate. For compositors and snapshotters however, the change may be delayed by nbuffers frames while old frames of the old size are consumed.

Implements mir::compositor::BufferBundle.

std::shared_ptr< mg::Buffer > mir::compositor::SwitchingBundle::snapshot_acquire ( )
virtual
void mir::compositor::SwitchingBundle::snapshot_release ( std::shared_ptr< graphics::Buffer > const &  released_buffer)
virtual

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const SwitchingBundle bundle 
)
friend

The documentation for this class was generated from the following files:

Copyright © 2012,2013 Canonical Ltd.
Generated on Fri Apr 11 21:14:53 UTC 2014