diff options
author | Mathias Agopian <mathias@google.com> | 2012-04-12 16:32:37 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2012-04-13 16:04:44 -0700 |
commit | ac6035a12aec38eeb14d0c13636ec980066d9a8f (patch) | |
tree | bf61a3af5d1ba7e4f14de1c23a32aed5aed30a81 /include/gui | |
parent | fca660cf730161f823e770ad1693fab441477edd (diff) | |
download | frameworks_native-ac6035a12aec38eeb14d0c13636ec980066d9a8f.zip frameworks_native-ac6035a12aec38eeb14d0c13636ec980066d9a8f.tar.gz frameworks_native-ac6035a12aec38eeb14d0c13636ec980066d9a8f.tar.bz2 |
s/w rendered apps can now use n-buffering (n>2)
Bug: 6311881
Change-Id: I6e52e281e8d432430aad011f6d9dcf35d7b4ac7d
Diffstat (limited to 'include/gui')
-rw-r--r-- | include/gui/SurfaceTextureClient.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/gui/SurfaceTextureClient.h b/include/gui/SurfaceTextureClient.h index c0e90b3..6644751 100644 --- a/include/gui/SurfaceTextureClient.h +++ b/include/gui/SurfaceTextureClient.h @@ -26,6 +26,7 @@ #include <utils/RefBase.h> #include <utils/threads.h> +#include <utils/KeyedVector.h> struct ANativeWindow_Buffer; @@ -113,6 +114,11 @@ private: void freeAllBuffers(); int getSlotFromBufferLocked(android_native_buffer_t* buffer) const; + struct BufferSlot { + sp<GraphicBuffer> buffer; + Region dirtyRegion; + }; + // mSurfaceTexture is the interface to the surface texture server. All // operations on the surface texture client ultimately translate into // interactions with the server using this interface. @@ -124,7 +130,7 @@ private: // slot that has not yet been used. The buffer allocated to a slot will also // be replaced if the requested buffer usage or geometry differs from that // of the buffer allocated to a slot. - sp<GraphicBuffer> mSlots[NUM_BUFFER_SLOTS]; + BufferSlot mSlots[NUM_BUFFER_SLOTS]; // mReqWidth is the buffer width that will be requested at the next dequeue // operation. It is initialized to 1. @@ -189,8 +195,10 @@ private: // must be used from the lock/unlock thread sp<GraphicBuffer> mLockedBuffer; sp<GraphicBuffer> mPostedBuffer; - mutable Region mOldDirtyRegion; bool mConnectedToCpu; + + // must be accessed from lock/unlock thread only + Region mDirtyRegion; }; }; // namespace android |