diff options
author | Mathias Agopian <mathias@google.com> | 2010-08-25 14:59:15 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2010-08-25 15:09:52 -0700 |
commit | c51114fe044769d078dd9776f790b881c2a20cae (patch) | |
tree | 381a461487257e0fecbd90066d5a6ba3c0343ad0 /services/surfaceflinger | |
parent | c14f9ca6e5e795b641e7809786b4e51e13493907 (diff) | |
download | frameworks_base-c51114fe044769d078dd9776f790b881c2a20cae.zip frameworks_base-c51114fe044769d078dd9776f790b881c2a20cae.tar.gz frameworks_base-c51114fe044769d078dd9776f790b881c2a20cae.tar.bz2 |
fix [2946787] Screen flicker on low resolution setting in camcorder.
Change-Id: I7e86f2b6d85dcae8dd212890b978fa6ac7de6893
Diffstat (limited to 'services/surfaceflinger')
-rw-r--r-- | services/surfaceflinger/Layer.cpp | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 03d7a02..695cbfa 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -162,9 +162,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; @@ -304,16 +308,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); } } |