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

Responsible for taking the buffer data sent from the server and wrapping it in a ClientBuffer. More...

#include <client_buffer_depository.h>

Public Member Functions

 ClientBufferDepository (std::shared_ptr< ClientBufferFactory > const &factory, int max_buffers)
 Constructor. More...
 
void deposit_package (std::shared_ptr< MirBufferPackage > const &, int id, geometry::Size, MirPixelFormat)
 Construct a ClientBuffer from the IPC data, and use it as the current buffer. More...
 
std::shared_ptr< ClientBuffercurrent_buffer ()
 
uint32_t current_buffer_id () const
 

Detailed Description

Responsible for taking the buffer data sent from the server and wrapping it in a ClientBuffer.

The ClientBufferDepository is responsible for taking the IPC buffer data and converting it into the more digestible form of a ClientBuffer. It maintains the client-side state necessary to construct a ClientBuffer.

See Also
mir::frontend::ClientBufferTracker for the server-side analogue.
Note
Changes to the tracking algorithm will need associated server-side changes to mir::frontend::ClientBufferTracker

Constructor & Destructor Documentation

mir::client::ClientBufferDepository::ClientBufferDepository ( std::shared_ptr< ClientBufferFactory > const &  factory,
int  max_buffers 
)

Constructor.

Parameters
factoryis the ClientBufferFactory that will be used to convert IPC data to ClientBuffers
max_buffersis the number of buffers the depository will cache. After the client has received its initial buffers the ClientBufferDepository will always have the last max_buffers buffers cached.
Note
The server relies on the depository caching max_buffers buffers to optimise away buffer passing. As such, this number needs to be shared between the server and client libraries.

Member Function Documentation

std::shared_ptr< mcl::ClientBuffer > mir::client::ClientBufferDepository::current_buffer ( )
uint32_t mir::client::ClientBufferDepository::current_buffer_id ( ) const
void mir::client::ClientBufferDepository::deposit_package ( std::shared_ptr< MirBufferPackage > const &  package,
int  id,
geometry::Size  size,
MirPixelFormat  pf 
)

Construct a ClientBuffer from the IPC data, and use it as the current buffer.

This also marks the previous current buffer (if any) as being submitted to the server.

Postcondition
current_buffer() will return a ClientBuffer constructed from this IPC data.

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