From b9f9e00ba35500bff6ac6bd8e0c444e60cb18a0b Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Fri, 31 Jul 2015 17:04:43 -0400 Subject: [PATCH] Bug 1189710 - Use correct offset for LayerRenderState in TiledContentHost. r=jrmuizel --- gfx/layers/composite/TiledContentHost.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gfx/layers/composite/TiledContentHost.h b/gfx/layers/composite/TiledContentHost.h index 44c547b733d8..1291fb1a0b85 100644 --- a/gfx/layers/composite/TiledContentHost.h +++ b/gfx/layers/composite/TiledContentHost.h @@ -195,14 +195,17 @@ public: TextureHost* host = mTiledBuffer.GetTile(0).mTextureHost; if (host) { MOZ_ASSERT(!mTiledBuffer.GetTile(0).mTextureHostOnWhite, "Component alpha not supported!"); - LayerRenderState state = host->GetRenderState(); - // Offset by the distance between the start of the valid (visible) region and the top-left - // of the tile. gfx::IntPoint offset = mTiledBuffer.GetTileOffset(mTiledBuffer.GetPlacement().TilePosition(0)); - state.SetOffset(offset - GetValidRegion().GetBounds().TopLeft()); - return host->GetRenderState(); + // Don't try to use HWC if the content doesn't start at the top-left of the tile. + if (offset != GetValidRegion().GetBounds().TopLeft()) { + return LayerRenderState(); + } + + LayerRenderState state = host->GetRenderState(); + state.SetOffset(offset); + return state; } } return LayerRenderState();