summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2011-12-09 11:36:44 -0800
committerChris Craik <ccraik@google.com>2011-12-09 13:54:56 -0800
commit346a3e8a4362562e79c622751aa11cd6941f6208 (patch)
tree770f5fcc068f96534b7d829126d9a848b09103a7 /Source/WebCore/platform/graphics/android/GLWebViewState.cpp
parent46ded0d896cca693053fe2459c1930de95b65cd9 (diff)
downloadexternal_webkit-346a3e8a4362562e79c622751aa11cd6941f6208.zip
external_webkit-346a3e8a4362562e79c622751aa11cd6941f6208.tar.gz
external_webkit-346a3e8a4362562e79c622751aa11cd6941f6208.tar.bz2
Swap tiles when viewport changes slightly, and properly cap prepare bounds
bug:5738336 Viewport changes that overlap previous viewports will result in fast scrolling mode being activated. Change-Id: I356df0054caff19519fcf8543f96726e78918922
Diffstat (limited to 'Source/WebCore/platform/graphics/android/GLWebViewState.cpp')
-rw-r--r--Source/WebCore/platform/graphics/android/GLWebViewState.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
index cf49b9e..710ae25 100644
--- a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
+++ b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
@@ -87,6 +87,7 @@ GLWebViewState::GLWebViewState()
, m_frameworkInval(0, 0, 0, 0)
, m_frameworkLayersInval(0, 0, 0, 0)
, m_isScrolling(false)
+ , m_isViewportScrolling(false)
, m_goingDown(true)
, m_goingLeft(false)
, m_expandedTileBoundsX(0)
@@ -246,11 +247,16 @@ int GLWebViewState::baseContentHeight()
void GLWebViewState::setViewport(SkRect& viewport, float scale)
{
if ((m_viewport == viewport) &&
- (zoomManager()->futureScale() == scale))
+ (zoomManager()->futureScale() == scale)) {
+ m_isViewportScrolling = false;
return;
+ }
m_goingDown = m_viewport.fTop - viewport.fTop <= 0;
m_goingLeft = m_viewport.fLeft - viewport.fLeft >= 0;
+
+ // detect viewport scrolling from short programmatic scrolls/jumps
+ m_isViewportScrolling = m_viewport != viewport && SkRect::Intersects(m_viewport, viewport);
m_viewport = viewport;
XLOG("New VIEWPORT %.2f - %.2f %.2f - %.2f (w: %2.f h: %.2f scale: %.2f currentScale: %.2f futureScale: %.2f)",