summaryrefslogtreecommitdiffstats
path: root/libs/gui/BufferItem.cpp
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 /libs/gui/BufferItem.cpp
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 'libs/gui/BufferItem.cpp')
-rw-r--r--libs/gui/BufferItem.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/gui/BufferItem.cpp b/libs/gui/BufferItem.cpp
index 312fb3b..239da20 100644
--- a/libs/gui/BufferItem.cpp
+++ b/libs/gui/BufferItem.cpp
@@ -64,6 +64,8 @@ size_t BufferItem::getFlattenedSize() const {
c += mFence->getFlattenedSize();
FlattenableUtils::align<4>(c);
}
+ c += mSurfaceDamage.getFlattenedSize();
+ FlattenableUtils::align<4>(c);
return sizeof(int32_t) + c + getPodSize();
}
@@ -105,6 +107,9 @@ status_t BufferItem::flatten(
size -= FlattenableUtils::align<4>(buffer);
flags |= 2;
}
+ status_t err = mSurfaceDamage.flatten(buffer, size);
+ if (err) return err;
+ size -= FlattenableUtils::align<4>(buffer);
// check we have enough space (in case flattening the fence/graphicbuffer lied to us)
if (size < getPodSize()) {
@@ -148,6 +153,9 @@ status_t BufferItem::unflatten(
if (err) return err;
size -= FlattenableUtils::align<4>(buffer);
}
+ status_t err = mSurfaceDamage.unflatten(buffer, size);
+ if (err) return err;
+ size -= FlattenableUtils::align<4>(buffer);
// check we have enough space
if (size < getPodSize()) {