Index: cc/render_surface_impl.cc |
diff --git a/cc/render_surface_impl.cc b/cc/render_surface_impl.cc |
index bc3d7303ba917f79bf2d4abed882ec33d6c69e9f..8023da68239d2e1dc864095b994075866f338213 100644 |
--- a/cc/render_surface_impl.cc |
+++ b/cc/render_surface_impl.cc |
@@ -224,8 +224,14 @@ void RenderSurfaceImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& appendQ |
gfx::RectF maskUVRect(0.0f, 0.0f, 1.0f, 1.0f); |
if (maskLayer) { |
- float scaleX = contentRect().width() / maskLayer->contentsScaleX() / maskLayer->bounds().width(); |
- float scaleY = contentRect().height() / maskLayer->contentsScaleY() / maskLayer->bounds().height(); |
+ // Because the RenderSurface is sized base on the screen footprint, |
+ // there can be a scale between the RenderSurface and the owning layer, |
+ // as well as the mask. While the mask doesn't have a drawTransform, the |
+ // owning layer has it (and should be pure scaling), so use that to |
+ // scale the mask to the right size. |
+ gfx::Vector2dF maskDrawScale = MathUtil::computeTransform2dScaleComponents(m_owningLayer->drawTransform(), 1.f); |
enne (OOO)
2013/01/15 04:12:43
This will work given the current implementation of
danakj
2013/01/15 16:31:11
I'm not sure I agree. My POV is that the mask is a
danakj
2013/01/15 17:11:53
Ok I take this back. I had developed an impression
|
+ float scaleX = contentRect().width() / maskLayer->contentsScaleX() / maskLayer->bounds().width() / maskDrawScale.x(); |
+ float scaleY = contentRect().height() / maskLayer->contentsScaleY() / maskLayer->bounds().height() / maskDrawScale.y(); |
maskUVRect = gfx::RectF(static_cast<float>(contentRect().x()) / contentRect().width() * scaleX, |
static_cast<float>(contentRect().y()) / contentRect().height() * scaleY, |