summaryrefslogtreecommitdiffstats
path: root/include/gui
diff options
context:
space:
mode:
authorDan Stoza <stoza@google.com>2015-03-17 16:23:42 -0700
committerDan Stoza <stoza@google.com>2015-04-15 13:19:38 -0700
commit5065a55291b67f584d7b0be3fa3cfc4e29a3cd1c (patch)
treec0d4972cfc939f852cc67ea5802fe81863332954 /include/gui
parent4d769d8bdc2fd57d34ab0fa4b9208ac0eb67cd61 (diff)
downloadframeworks_native-5065a55291b67f584d7b0be3fa3cfc4e29a3cd1c.zip
frameworks_native-5065a55291b67f584d7b0be3fa3cfc4e29a3cd1c.tar.gz
frameworks_native-5065a55291b67f584d7b0be3fa3cfc4e29a3cd1c.tar.bz2
libgui: Pass surface damage through BufferQueue
This change adds support for passing surface damage all of the way down from the EGL interface through the consumer side of the BufferQueue. Depends on system/core change Ie645e6a52b37b5c1b3be19481e8348570d1aa62c Bug: 11239309 Change-Id: I4457ea826e9ade4ec187f973851d855b7b93a31b
Diffstat (limited to 'include/gui')
-rw-r--r--include/gui/BufferItem.h5
-rw-r--r--include/gui/IGraphicBufferProducer.h7
-rw-r--r--include/gui/Surface.h9
3 files changed, 19 insertions, 2 deletions
diff --git a/include/gui/BufferItem.h b/include/gui/BufferItem.h
index cc41bae..000ef0e 100644
--- a/include/gui/BufferItem.h
+++ b/include/gui/BufferItem.h
@@ -21,6 +21,7 @@
#include <EGL/eglext.h>
#include <ui/Rect.h>
+#include <ui/Region.h>
#include <system/graphics.h>
@@ -106,6 +107,10 @@ class BufferItem : public Flattenable<BufferItem> {
// Indicates this buffer must be transformed by the inverse transform of the screen
// it is displayed onto. This is applied after mTransform.
bool mTransformToDisplayInverse;
+
+ // Describes the portion of the surface that has been modified since the
+ // previous frame
+ Region mSurfaceDamage;
};
} // namespace android
diff --git a/include/gui/IGraphicBufferProducer.h b/include/gui/IGraphicBufferProducer.h
index 374245a..2d99f24 100644
--- a/include/gui/IGraphicBufferProducer.h
+++ b/include/gui/IGraphicBufferProducer.h
@@ -28,6 +28,7 @@
#include <ui/Fence.h>
#include <ui/GraphicBuffer.h>
#include <ui/Rect.h>
+#include <ui/Region.h>
namespace android {
// ----------------------------------------------------------------------------
@@ -281,7 +282,7 @@ public:
: timestamp(timestamp), isAutoTimestamp(isAutoTimestamp),
dataSpace(dataSpace), crop(crop), scalingMode(scalingMode),
transform(transform), stickyTransform(sticky),
- async(async), fence(fence) { }
+ async(async), fence(fence), surfaceDamage() { }
inline void deflate(int64_t* outTimestamp, bool* outIsAutoTimestamp,
android_dataspace* outDataSpace,
Rect* outCrop, int* outScalingMode,
@@ -306,6 +307,9 @@ public:
status_t flatten(void*& buffer, size_t& size, int*& fds, size_t& count) const;
status_t unflatten(void const*& buffer, size_t& size, int const*& fds, size_t& count);
+ const Region& getSurfaceDamage() const { return surfaceDamage; }
+ void setSurfaceDamage(const Region& damage) { surfaceDamage = damage; }
+
private:
int64_t timestamp;
int isAutoTimestamp;
@@ -316,6 +320,7 @@ public:
uint32_t stickyTransform;
int async;
sp<Fence> fence;
+ Region surfaceDamage;
};
// QueueBufferOutput must be a POD structure
diff --git a/include/gui/Surface.h b/include/gui/Surface.h
index e973483..8217652 100644
--- a/include/gui/Surface.h
+++ b/include/gui/Surface.h
@@ -147,6 +147,7 @@ private:
int dispatchUnlockAndPost(va_list args);
int dispatchSetSidebandStream(va_list args);
int dispatchSetBuffersDataSpace(va_list args);
+ int dispatchSetSurfaceDamage(va_list args);
protected:
virtual int dequeueBuffer(ANativeWindowBuffer** buffer, int* fenceFd);
@@ -171,6 +172,7 @@ protected:
virtual int setBuffersDataSpace(android_dataspace dataSpace);
virtual int setCrop(Rect const* rect);
virtual int setUsage(uint32_t reqUsage);
+ virtual void setSurfaceDamage(android_native_rect_t* rects, size_t numRects);
public:
virtual int lock(ANativeWindow_Buffer* outBuffer, ARect* inOutDirtyBounds);
@@ -296,7 +298,12 @@ private:
sp<GraphicBuffer> mPostedBuffer;
bool mConnectedToCpu;
- // must be accessed from lock/unlock thread only
+ // In the lock/unlock context, this reflects the region that the producer
+ // wished to update and whether the Surface was able to copy the previous
+ // buffer back to allow a partial update.
+ //
+ // In the dequeue/queue context, this reflects the surface damage (the
+ // damage since the last frame) passed in by the producer.
Region mDirtyRegion;
};