summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger_client
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2011-01-30 15:00:44 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-01-30 15:00:44 -0800
commit628845056282a0c5b1a212ce5aeeaac092b91ec8 (patch)
treeeac60b66d962192fbbc81b1c8ea401675483668f /libs/surfaceflinger_client
parent71a22b3bc7cb4a721378ef38d43bce94f5b0e5bd (diff)
parent2ece4cdc3fd0f8a45a889c711dba7165729e8ca5 (diff)
downloadframeworks_base-628845056282a0c5b1a212ce5aeeaac092b91ec8.zip
frameworks_base-628845056282a0c5b1a212ce5aeeaac092b91ec8.tar.gz
frameworks_base-628845056282a0c5b1a212ce5aeeaac092b91ec8.tar.bz2
Merge "Reset ANativeWindow crop on buffer geometry changes." into honeycomb
Diffstat (limited to 'libs/surfaceflinger_client')
-rw-r--r--libs/surfaceflinger_client/Surface.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/libs/surfaceflinger_client/Surface.cpp b/libs/surfaceflinger_client/Surface.cpp
index e21bab7..1e9bd74 100644
--- a/libs/surfaceflinger_client/Surface.cpp
+++ b/libs/surfaceflinger_client/Surface.cpp
@@ -827,13 +827,15 @@ int Surface::disconnect(int api)
int Surface::crop(Rect const* rect)
{
- // empty/invalid rects are not allowed
- if (rect->isEmpty())
- return BAD_VALUE;
-
Mutex::Autolock _l(mSurfaceLock);
// TODO: validate rect size
- mNextBufferCrop = *rect;
+
+ if (rect == NULL || rect->isEmpty()) {
+ mNextBufferCrop = Rect(0,0);
+ } else {
+ mNextBufferCrop = *rect;
+ }
+
return NO_ERROR;
}
@@ -884,6 +886,9 @@ int Surface::setBuffersGeometry(int w, int h, int format)
// EGLConfig validation.
mFormat = format;
}
+
+ mNextBufferCrop = Rect(0,0);
+
return NO_ERROR;
}