summaryrefslogtreecommitdiffstats
path: root/libs/gui
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-08-25 17:03:30 -0700
committerMathias Agopian <mathias@google.com>2011-08-25 17:03:30 -0700
commit2370d0a14f09d4fb5133ff48e28459ce8343bf80 (patch)
treefb010e500044a409b8b9c0107c3bf0c6c64f89b2 /libs/gui
parentec49d8970125b3da422f93bf6f6b32ac62230a83 (diff)
downloadframeworks_base-2370d0a14f09d4fb5133ff48e28459ce8343bf80.zip
frameworks_base-2370d0a14f09d4fb5133ff48e28459ce8343bf80.tar.gz
frameworks_base-2370d0a14f09d4fb5133ff48e28459ce8343bf80.tar.bz2
make sure to re-initialize SurfaceTexture to its default state on disconnect
this caused problems where the NavigationBar would disapear or be drawn in the wrong orientation. Change-Id: I083c41338db83a4afd14f427caec2f31c180d734
Diffstat (limited to 'libs/gui')
-rw-r--r--libs/gui/SurfaceTexture.cpp5
-rw-r--r--libs/gui/SurfaceTextureClient.cpp11
2 files changed, 13 insertions, 3 deletions
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp
index ac9b33b..79a01a3 100644
--- a/libs/gui/SurfaceTexture.cpp
+++ b/libs/gui/SurfaceTexture.cpp
@@ -608,6 +608,9 @@ status_t SurfaceTexture::disconnect(int api) {
if (mConnectedApi == api) {
drainQueueAndFreeBuffersLocked();
mConnectedApi = NO_CONNECTED_API;
+ mNextCrop.makeInvalid();
+ mNextScalingMode = NATIVE_WINDOW_SCALING_MODE_FREEZE;
+ mNextTransform = 0;
mDequeueCondition.signal();
} else {
LOGE("disconnect: connected to another api (cur=%d, req=%d)",
@@ -1022,7 +1025,7 @@ void SurfaceTexture::dump(String8& result, const char* prefix,
mCurrentCrop.top, mCurrentCrop.right, mCurrentCrop.bottom,
mCurrentTransform, mCurrentTexture,
prefix, mNextCrop.left, mNextCrop.top, mNextCrop.right, mNextCrop.bottom,
- mCurrentTransform, fifoSize, fifo.string()
+ mNextTransform, fifoSize, fifo.string()
);
result.append(buffer);
diff --git a/libs/gui/SurfaceTextureClient.cpp b/libs/gui/SurfaceTextureClient.cpp
index 5a35b4d..710ef94 100644
--- a/libs/gui/SurfaceTextureClient.cpp
+++ b/libs/gui/SurfaceTextureClient.cpp
@@ -407,8 +407,15 @@ int SurfaceTextureClient::disconnect(int api) {
LOGV("SurfaceTextureClient::disconnect");
Mutex::Autolock lock(mMutex);
int err = mSurfaceTexture->disconnect(api);
- if (!err && api == NATIVE_WINDOW_API_CPU) {
- mConnectedToCpu = false;
+ if (!err) {
+ freeAllBuffers();
+ mReqFormat = 0;
+ mReqWidth = 0;
+ mReqHeight = 0;
+ mReqUsage = 0;
+ if (api == NATIVE_WINDOW_API_CPU) {
+ mConnectedToCpu = false;
+ }
}
return err;
}