diff options
| author | Mathias Agopian <mathias@google.com> | 2010-08-25 15:25:32 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-08-25 15:25:32 -0700 |
| commit | 4cffbb47a28faa594c2217d1e84f9382e0b57cc4 (patch) | |
| tree | 79929c4a910df132c4e2f52a566cc080360b738b | |
| parent | d0e6598b4a32f3000247341414449a3aa4d9f7f4 (diff) | |
| parent | c51114fe044769d078dd9776f790b881c2a20cae (diff) | |
| download | frameworks_base-4cffbb47a28faa594c2217d1e84f9382e0b57cc4.zip frameworks_base-4cffbb47a28faa594c2217d1e84f9382e0b57cc4.tar.gz frameworks_base-4cffbb47a28faa594c2217d1e84f9382e0b57cc4.tar.bz2 | |
Merge "fix [2946787] Screen flicker on low resolution setting in camcorder." into gingerbread
| -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); } } |
