diff options
author | Tom Hudson <tomhudson@google.com> | 2015-04-16 10:50:53 -0400 |
---|---|---|
committer | Tom Hudson <tomhudson@google.com> | 2015-04-16 13:39:51 -0400 |
commit | 040b6d8baf595865242790186672812f1df55cbb (patch) | |
tree | 9cff121e46d7fcb48aa46452bf85ad9c5a6940eb /libs/hwui/OpenGLRenderer.cpp | |
parent | ad83f87bcfc4f3ee4bcc972bad4ddcaaf4e57426 (diff) | |
download | frameworks_base-040b6d8baf595865242790186672812f1df55cbb.zip frameworks_base-040b6d8baf595865242790186672812f1df55cbb.tar.gz frameworks_base-040b6d8baf595865242790186672812f1df55cbb.tar.bz2 |
Fix offset of composeLayerRegion
composeLayerRect() pays attention to the offset of the layer, but
composeLayerRegion() ignores it. This patch makes the behavior of
the region case match the behavior of the rect case.
The difference will only be shown by tests which do not position
the saved layer at the origin.
BUG=20288561
R=ccraik@google.com,djsollen@google.com
Change-Id: Ie22737a8614c508cbffe39aa4c55f7d5434277aa
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index aa722d0..d06534e 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -1009,12 +1009,13 @@ void OpenGLRenderer::composeLayerRegion(Layer* layer, const Rect& rect) { TextureVertex::set(mesh++, r->left, r->bottom, u1, v2); TextureVertex::set(mesh++, r->right, r->bottom, u2, v2); } + Rect modelRect = Rect(rect.getWidth(), rect.getHeight()); Glop glop; GlopBuilder(mRenderState, mCaches, &glop) .setMeshTexturedIndexedQuads(&quadVertices[0], count * 6) .setFillLayer(layer->getTexture(), layer->getColorFilter(), getLayerAlpha(layer), layer->getMode(), Blend::ModeOrderSwap::NoSwap) .setTransform(currentSnapshot()->getOrthoMatrix(), *currentTransform(), false) - .setModelViewOffsetRectSnap(0, 0, rect) + .setModelViewOffsetRectSnap(rect.left, rect.top, modelRect) .setRoundRectClipState(currentSnapshot()->roundRectClipState) .build(); DRAW_DOUBLE_STENCIL_IF(!layer->hasDrawnSinceUpdate, renderGlop(glop)); |