diff options
author | Teng-Hui Zhu <ztenghui@google.com> | 2011-01-04 15:13:55 -0800 |
---|---|---|
committer | Teng-Hui Zhu <ztenghui@google.com> | 2011-01-04 16:37:41 -0800 |
commit | cfd55bfb8f35d19b1b6e16bfab7df8df384304ac (patch) | |
tree | 9f244800baae75850d22a688cc960e11f0329f10 /WebCore/platform | |
parent | 6e57d42a665c4991895ef38776269e59fa164308 (diff) | |
download | external_webkit-cfd55bfb8f35d19b1b6e16bfab7df8df384304ac.zip external_webkit-cfd55bfb8f35d19b1b6e16bfab7df8df384304ac.tar.gz external_webkit-cfd55bfb8f35d19b1b6e16bfab7df8df384304ac.tar.bz2 |
clip rect fix for iframe when GL on
First, for each layer, the clip rect should be intersecting with
all of its parents.
Then the rect should use pre-transformation info, the real
transformation will handle by the clip() function.
P.S: renaming variable "bounds" b/c there is a member function
using the same name.
bug:3304761
Change-Id: Id5d602b55da904c63b37cb5436b5bf2f5526a94f
Diffstat (limited to 'WebCore/platform')
-rw-r--r-- | WebCore/platform/graphics/android/LayerAndroid.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/WebCore/platform/graphics/android/LayerAndroid.cpp b/WebCore/platform/graphics/android/LayerAndroid.cpp index 49cd4ca..91e38e5 100644 --- a/WebCore/platform/graphics/android/LayerAndroid.cpp +++ b/WebCore/platform/graphics/android/LayerAndroid.cpp @@ -475,13 +475,13 @@ void LayerAndroid::updatePositions() void LayerAndroid::updateGLPositions(const TransformationMatrix& parentMatrix, const FloatRect& clipping, float opacity) { - IntSize bounds(getSize().width(), getSize().height()); + IntSize layerSize(getSize().width(), getSize().height()); FloatPoint anchorPoint(getAnchorPoint().fX, getAnchorPoint().fY); FloatPoint position(getPosition().fX, getPosition().fY); - float centerOffsetX = (0.5f - anchorPoint.x()) * bounds.width(); - float centerOffsetY = (0.5f - anchorPoint.y()) * bounds.height(); - float originX = anchorPoint.x() * bounds.width(); - float originY = anchorPoint.y() * bounds.height(); + float centerOffsetX = (0.5f - anchorPoint.x()) * layerSize.width(); + float centerOffsetY = (0.5f - anchorPoint.y()) * layerSize.height(); + float originX = anchorPoint.x() * layerSize.width(); + float originY = anchorPoint.y() * layerSize.height(); TransformationMatrix localMatrix = parentMatrix; localMatrix.translate3d(originX + position.x(), originY + position.y(), @@ -501,10 +501,8 @@ void LayerAndroid::updateGLPositions(const TransformationMatrix& parentMatrix, setDrawOpacity(opacity); if (m_haveClip) { - FloatRect clip; - clip.setLocation(p); - clip.setWidth(getSize().width()); - clip.setHeight(getSize().height()); + FloatRect clip = (FloatRect) bounds(); + clip.intersect(clipping); setDrawClip(clip); } else { setDrawClip(clipping); |