summaryrefslogtreecommitdiffstats
path: root/libs/gui
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-08-23 21:09:41 -0700
committerMathias Agopian <mathias@google.com>2011-08-23 21:18:36 -0700
commitbecc91d6b0b5fc59f3231ba7f1584eb9e2f3a313 (patch)
treeaf63681e944c85774b49a86b9c5bbd8514a9bd5b /libs/gui
parent2143fe05e3a1aeae641ca126e76db82d17e8b8e6 (diff)
downloadframeworks_base-becc91d6b0b5fc59f3231ba7f1584eb9e2f3a313.zip
frameworks_base-becc91d6b0b5fc59f3231ba7f1584eb9e2f3a313.tar.gz
frameworks_base-becc91d6b0b5fc59f3231ba7f1584eb9e2f3a313.tar.bz2
Fix an issue where Surface::lock() would never update the output region
this bug was introduced recently. in some situations Surface::lock() is not able to preserve the content of the back buffer and needs to tell the caller to redraw everything. Bug: 5186460 Change-Id: I14e03939ddfc1b7ad2a8b99ad79435314c60e78e
Diffstat (limited to 'libs/gui')
-rw-r--r--libs/gui/Surface.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp
index 54d04aa..ff45fa3 100644
--- a/libs/gui/Surface.cpp
+++ b/libs/gui/Surface.cpp
@@ -351,13 +351,13 @@ int Surface::query(int what, int* value) const {
// ----------------------------------------------------------------------------
-status_t Surface::lock(SurfaceInfo* other, Region* dirtyIn) {
+status_t Surface::lock(SurfaceInfo* other, Region* inOutDirtyRegion) {
ANativeWindow_Buffer outBuffer;
ARect temp;
ARect* inOutDirtyBounds = NULL;
- if (dirtyIn) {
- temp = dirtyIn->getBounds();
+ if (inOutDirtyRegion) {
+ temp = inOutDirtyRegion->getBounds();
inOutDirtyBounds = &temp;
}
@@ -371,6 +371,11 @@ status_t Surface::lock(SurfaceInfo* other, Region* dirtyIn) {
other->format = uint32_t(outBuffer.format);
other->bits = outBuffer.bits;
}
+
+ if (inOutDirtyRegion) {
+ inOutDirtyRegion->set( static_cast<Rect const&>(temp) );
+ }
+
return err;
}