summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger/LayerBuffer.h
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-09-07 16:32:45 -0700
committerMathias Agopian <mathias@google.com>2009-09-07 16:32:45 -0700
commitcbb288bfe89f585bf48371bd31b2d4aafa32f32e (patch)
tree73d20f36910dcab8c17c686cdd7014cee285bc39 /libs/surfaceflinger/LayerBuffer.h
parentf0780974fc31ae88135d1dcb67cb5fd86bb6deb6 (diff)
downloadframeworks_native-cbb288bfe89f585bf48371bd31b2d4aafa32f32e.zip
frameworks_native-cbb288bfe89f585bf48371bd31b2d4aafa32f32e.tar.gz
frameworks_native-cbb288bfe89f585bf48371bd31b2d4aafa32f32e.tar.bz2
fix [2068105] implement queueBuffer/lockBuffer/dequeueBuffer properly
Rewrote SurfaceFlinger's buffer management from the ground-up. The design now support an arbitrary number of buffers per surface, however the current implementation is limited to four. Currently only 2 buffers are used in practice. The main new feature is to be able to dequeue all buffers at once (very important when there are only two). A client can dequeue all buffers until there are none available, it can lock all buffers except the last one that is used for composition. The client will block then, until a new buffer is enqueued. The current implementation requires that buffers are locked in the same order they are dequeued and enqueued in the same order they are locked. Only one buffer can be locked at a time. eg. Allowed sequence: DQ, DQ, LOCK, Q, LOCK, Q eg. Forbidden sequence: DQ, DQ, LOCK, LOCK, Q, Q
Diffstat (limited to 'libs/surfaceflinger/LayerBuffer.h')
-rw-r--r--libs/surfaceflinger/LayerBuffer.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/libs/surfaceflinger/LayerBuffer.h b/libs/surfaceflinger/LayerBuffer.h
index 8057219..e539f68 100644
--- a/libs/surfaceflinger/LayerBuffer.h
+++ b/libs/surfaceflinger/LayerBuffer.h
@@ -24,7 +24,6 @@
#include <private/ui/LayerState.h>
#include "LayerBase.h"
-#include "LayerBitmap.h"
struct copybit_device_t;
@@ -32,9 +31,12 @@ namespace android {
// ---------------------------------------------------------------------------
+class Buffer;
class Region;
class OverlayRef;
+// ---------------------------------------------------------------------------
+
class LayerBuffer : public LayerBaseClient
{
class Source : public LightRefBase<Source> {
@@ -179,12 +181,12 @@ private:
};
- class SurfaceBuffer : public LayerBaseClient::Surface
+ class SurfaceLayerBuffer : public LayerBaseClient::Surface
{
public:
- SurfaceBuffer(const sp<SurfaceFlinger>& flinger,
+ SurfaceLayerBuffer(const sp<SurfaceFlinger>& flinger,
SurfaceID id, const sp<LayerBuffer>& owner);
- virtual ~SurfaceBuffer();
+ virtual ~SurfaceLayerBuffer();
virtual status_t registerBuffers(const ISurface::BufferHeap& buffers);
virtual void postBuffer(ssize_t offset);