diff options
author | Mathias Agopian <mathias@google.com> | 2012-06-07 17:21:53 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-06-07 17:21:53 -0700 |
commit | af1cb83516589034aedcbf211f1b66bd80250136 (patch) | |
tree | ab0fe6b96518bad81487e1acd3e0dc9f1f6ef5e9 | |
parent | 05ef75e4a0111b0992994fd5876e28e12f3aa3e6 (diff) | |
parent | b2c1cfbe95bed419487455d1b82956f9c5b2a40c (diff) | |
download | frameworks_native-af1cb83516589034aedcbf211f1b66bd80250136.zip frameworks_native-af1cb83516589034aedcbf211f1b66bd80250136.tar.gz frameworks_native-af1cb83516589034aedcbf211f1b66bd80250136.tar.bz2 |
am b2c1cfbe: am 0cd545f1: sometimes we would incorrectly scale the content of a surface
* commit 'b2c1cfbe95bed419487455d1b82956f9c5b2a40c':
sometimes we would incorrectly scale the content of a surface
-rw-r--r-- | services/surfaceflinger/Layer.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 593f178..4062340 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -469,18 +469,31 @@ uint32_t Layer::doTransaction(uint32_t flags) front.requested.crop.getWidth(), front.requested.crop.getHeight()); - if (!isFixedSize()) { - // this will make sure LayerBase::doTransaction doesn't update - // the drawing state's geometry - flags |= eDontUpdateGeometryState; - } - // record the new size, form this point on, when the client request // a buffer, it'll get the new size. mSurfaceTexture->setDefaultBufferSize( temp.requested.w, temp.requested.h); } + if (!isFixedSize()) { + + const bool resizePending = (temp.requested.w != temp.active.w) || + (temp.requested.h != temp.active.h); + + if (resizePending) { + // don't let LayerBase::doTransaction update the drawing state + // if we have a pending resize, unless we are in fixed-size mode. + // the drawing state will be updated only once we receive a buffer + // with the correct size. + // + // in particular, we want to make sure the clip (which is part + // of the geometry state) is latched together with the size but is + // latched immediately when no resizing is involved. + + flags |= eDontUpdateGeometryState; + } + } + return LayerBase::doTransaction(flags); } |