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
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user