diff options
author | Teng-Hui Zhu <ztenghui@google.com> | 2011-01-06 11:56:00 -0800 |
---|---|---|
committer | Teng-Hui Zhu <ztenghui@google.com> | 2011-01-07 10:11:51 -0800 |
commit | eb2b1cb78cf15cf3e33bc5752ab080ecfd2ec6b9 (patch) | |
tree | 3c25e33f5cb41c177077dc10fa340d00bbca9d8d /WebCore/platform/graphics/android/LayerAndroid.cpp | |
parent | 45a8f6360a851a7c7d75a7e2fa11cc71f778ce89 (diff) | |
download | external_webkit-eb2b1cb78cf15cf3e33bc5752ab080ecfd2ec6b9.zip external_webkit-eb2b1cb78cf15cf3e33bc5752ab080ecfd2ec6b9.tar.gz external_webkit-eb2b1cb78cf15cf3e33bc5752ab080ecfd2ec6b9.tar.bz2 |
Redo the clippingRect calculation
Although the intersetcion is done correctly, but the clippingRect
should take the parents' matrix into account.
To make the code cleaner, we convert all the rects into screen
coordinate for intersection.
bug:3304761
Change-Id: Ia3dc3e7b72f2e72eaab66ba8e017d89ab71dc468
Diffstat (limited to 'WebCore/platform/graphics/android/LayerAndroid.cpp')
-rw-r--r-- | WebCore/platform/graphics/android/LayerAndroid.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/WebCore/platform/graphics/android/LayerAndroid.cpp b/WebCore/platform/graphics/android/LayerAndroid.cpp index 91e38e5..94e16da 100644 --- a/WebCore/platform/graphics/android/LayerAndroid.cpp +++ b/WebCore/platform/graphics/android/LayerAndroid.cpp @@ -486,22 +486,19 @@ void LayerAndroid::updateGLPositions(const TransformationMatrix& parentMatrix, localMatrix.translate3d(originX + position.x(), originY + position.y(), anchorPointZ()); - FloatPoint p(0, 0); - p = localMatrix.mapPoint(p); - p = m_transform.mapPoint(p); - localMatrix.multLeft(m_transform); localMatrix.translate3d(-originX, -originY, -anchorPointZ()); - p = localMatrix.mapPoint(p); setDrawTransform(localMatrix); opacity *= getOpacity(); setDrawOpacity(opacity); if (m_haveClip) { - FloatRect clip = (FloatRect) bounds(); + //The clipping rect calculation and intersetion will be done in Screen Coord now. + FloatRect clip = + TilesManager::instance()->shader()->clipRectInScreenCoord(drawTransform(), layerSize); clip.intersect(clipping); setDrawClip(clip); } else { @@ -620,7 +617,7 @@ bool LayerAndroid::drawGL(SkMatrix& matrix) SkRect rect; rect.set(0, 0, getSize().width(), getSize().height()); - TilesManager::instance()->shader()->clip(drawTransform(), m_clippingRect); + TilesManager::instance()->shader()->clip(m_clippingRect); if (prepareContext() && m_texture) { TextureInfo* textureInfo = m_texture->consumerLock(); |