From fc8059b4fc435c673ee9fd5ba93322ce1f3e95ab Mon Sep 17 00:00:00 2001 From: Michael Kolb Date: Fri, 24 Feb 2012 09:57:16 -0800 Subject: fix scrollable layer inside scrollable layer Bug: 6065371 take the layer offset out of the transformation matrix used for the children. Change-Id: I464eda636df50c98e2042687c80f4a2c4a9bddc3 --- Source/WebCore/platform/graphics/android/LayerAndroid.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Source/WebCore/platform/graphics/android/LayerAndroid.cpp b/Source/WebCore/platform/graphics/android/LayerAndroid.cpp index 79c02eb..83fb414 100644 --- a/Source/WebCore/platform/graphics/android/LayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/LayerAndroid.cpp @@ -685,13 +685,16 @@ void LayerAndroid::updateGLPositionsAndScale(const TransformationMatrix& parentM // now apply it to our children + TransformationMatrix childMatrix; + childMatrix = localMatrix; + childMatrix.translate3d(m_offset.x(), m_offset.y(), 0); if (!m_childrenTransform.isIdentity()) { - localMatrix.translate(getSize().width() * 0.5f, getSize().height() * 0.5f); - localMatrix.multiply(m_childrenTransform); - localMatrix.translate(-getSize().width() * 0.5f, -getSize().height() * 0.5f); + childMatrix.translate(getSize().width() * 0.5f, getSize().height() * 0.5f); + childMatrix.multiply(m_childrenTransform); + childMatrix.translate(-getSize().width() * 0.5f, -getSize().height() * 0.5f); } for (int i = 0; i < count; i++) - this->getChild(i)->updateGLPositionsAndScale(localMatrix, drawClip(), opacity, scale); + this->getChild(i)->updateGLPositionsAndScale(childMatrix, drawClip(), opacity, scale); } void LayerAndroid::setContentsImage(SkBitmapRef* img) -- cgit v1.1