summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2012-02-15 19:14:43 -0800
committerChris Craik <ccraik@google.com>2012-02-16 16:09:09 -0800
commit6ed5ffb1c54be9d646d4e4550a2e46b3f0a40305 (patch)
treeb04d6d32b2ab0cc7df8492366d0581b0476afea3 /Source/WebCore/platform/graphics/android/GLWebViewState.cpp
parent3410ffc0890f04ba9ca38573ab37c309b4aff5bd (diff)
downloadexternal_webkit-6ed5ffb1c54be9d646d4e4550a2e46b3f0a40305.zip
external_webkit-6ed5ffb1c54be9d646d4e4550a2e46b3f0a40305.tar.gz
external_webkit-6ed5ffb1c54be9d646d4e4550a2e46b3f0a40305.tar.bz2
Fix rounding error in clip
bug:5460425 Was intermittently causing top row of pixels in a layer to be incorrectly clipped. Additionally, cleaned up shader draw setup. Change-Id: Ib089354a1953e9a574e58a459d5f3623cc68dd21
Diffstat (limited to 'Source/WebCore/platform/graphics/android/GLWebViewState.cpp')
-rw-r--r--Source/WebCore/platform/graphics/android/GLWebViewState.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
index c96f5ea..16f2154 100644
--- a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
+++ b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
@@ -243,7 +243,7 @@ int GLWebViewState::baseContentHeight()
return m_treeManager.baseContentHeight();
}
-void GLWebViewState::setViewport(SkRect& viewport, float scale)
+void GLWebViewState::setViewport(const SkRect& viewport, float scale)
{
// allocate max possible number of tiles visible with this viewport / expandedTileBounds
const float invTileContentWidth = scale / TilesManager::tileWidth();
@@ -343,9 +343,9 @@ void GLWebViewState::drawBackground(Color& backgroundColor)
glClear(GL_COLOR_BUFFER_BIT);
}
-double GLWebViewState::setupDrawing(IntRect& viewRect, SkRect& visibleRect,
- IntRect& webViewRect, int titleBarHeight,
- IntRect& screenClip, float scale)
+double GLWebViewState::setupDrawing(const IntRect& viewRect, const SkRect& visibleRect,
+ const IntRect& webViewRect, int titleBarHeight,
+ const IntRect& screenClip, float scale)
{
int left = viewRect.x();
int top = viewRect.y();
@@ -364,13 +364,8 @@ double GLWebViewState::setupDrawing(IntRect& viewRect, SkRect& visibleRect,
TilesManager::tileHeight());
}
- shader->setViewport(visibleRect, scale);
- shader->setViewRect(viewRect);
- shader->setWebViewRect(webViewRect);
- shader->setTitleBarHeight(titleBarHeight);
- shader->setScreenClip(screenClip);
- shader->resetBlending();
-
+ shader->setupDrawing(viewRect, visibleRect, webViewRect,
+ titleBarHeight, screenClip, scale);
shader->calculateAnimationDelta();
glViewport(left + shader->getAnimationDeltaX(),