summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-08-25 16:40:28 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-08-25 16:40:28 -0700
commit1c25dcc92435aac0383e860e55ad9a8dc6185820 (patch)
treeb2b553154fdb97d5be1cdb403e7afde16c4409d9
parent4cbc4f1067503b5de62a5338478d3cad8c25bd3d (diff)
parent6d4346ce35a521d67f45d7c9658c450c0fc461d2 (diff)
downloadframeworks_base-1c25dcc92435aac0383e860e55ad9a8dc6185820.zip
frameworks_base-1c25dcc92435aac0383e860e55ad9a8dc6185820.tar.gz
frameworks_base-1c25dcc92435aac0383e860e55ad9a8dc6185820.tar.bz2
am 6d4346ce: am 4cffbb47: Merge "fix [2946787] Screen flicker on low resolution setting in camcorder." into gingerbread
Merge commit '6d4346ce35a521d67f45d7c9658c450c0fc461d2' * commit '6d4346ce35a521d67f45d7c9658c450c0fc461d2': fix [2946787] Screen flicker on low resolution setting in camcorder.
-rw-r--r--services/surfaceflinger/Layer.cpp32
1 files changed, 21 insertions, 11 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 7f7ef60..194c295 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -163,9 +163,13 @@ status_t Layer::setBuffers( uint32_t w, uint32_t h,
const uint32_t hwFlags = hw.getFlags();
mFormat = format;
- mReqFormat = format;
mWidth = w;
mHeight = h;
+
+ mReqFormat = format;
+ mReqWidth = w;
+ mReqHeight = h;
+
mSecure = (flags & ISurfaceComposer::eSecure) ? true : false;
mNeedsBlending = (info.h_alpha - info.l_alpha) > 0;
@@ -361,16 +365,22 @@ sp<GraphicBuffer> Layer::requestBuffer(int index,
uint32_t w, h, f;
{ // scope for the lock
Mutex::Autolock _l(mLock);
- const bool fixedSizeChanged = mFixedSize != (reqWidth && reqHeight);
- const bool formatChanged = mReqFormat != reqFormat;
- mReqWidth = reqWidth;
- mReqHeight = reqHeight;
- mReqFormat = reqFormat;
- mFixedSize = reqWidth && reqHeight;
- w = reqWidth ? reqWidth : mWidth;
- h = reqHeight ? reqHeight : mHeight;
- f = reqFormat ? reqFormat : mFormat;
- if (fixedSizeChanged || formatChanged) {
+
+ // zero means default
+ if (!reqFormat) reqFormat = mFormat;
+ if (!reqWidth) reqWidth = mWidth;
+ if (!reqHeight) reqHeight = mHeight;
+
+ w = reqWidth;
+ h = reqHeight;
+ f = reqFormat;
+
+ if ((reqWidth != mReqWidth) || (reqHeight != mReqHeight) ||
+ (reqFormat != mReqFormat)) {
+ mReqWidth = reqWidth;
+ mReqHeight = reqHeight;
+ mReqFormat = reqFormat;
+
lcblk->reallocateAllExcept(index);
}
}