diff options
author | John Reck <jreck@google.com> | 2011-03-23 18:02:27 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2011-03-25 13:25:16 -0700 |
commit | 417789b7c56928a5fcb610583346d07ffa380900 (patch) | |
tree | 3f8902d06b229fa826b866778bfc57cf852f9742 /WebCore/platform/graphics/android/BaseLayerAndroid.cpp | |
parent | 78eb447490d235178fafa5bd046918ffe965003f (diff) | |
download | external_webkit-417789b7c56928a5fcb610583346d07ffa380900.zip external_webkit-417789b7c56928a5fcb610583346d07ffa380900.tar.gz external_webkit-417789b7c56928a5fcb610583346d07ffa380900.tar.bz2 |
My attempt at a smarter tile manager
Removes TileSets and queues tiles individually
Uses a priority queue to determine which tiles to render first
Stops rendering the front tile page if we are prepping the back one
Limits queue spam by tracking which tiles are already in the queue
Change-Id: I2f2c9539e0d8a421ac7f1f4cb80ee831b9894293
Diffstat (limited to 'WebCore/platform/graphics/android/BaseLayerAndroid.cpp')
-rw-r--r-- | WebCore/platform/graphics/android/BaseLayerAndroid.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/WebCore/platform/graphics/android/BaseLayerAndroid.cpp b/WebCore/platform/graphics/android/BaseLayerAndroid.cpp index 1786d64..cf8b6fa 100644 --- a/WebCore/platform/graphics/android/BaseLayerAndroid.cpp +++ b/WebCore/platform/graphics/android/BaseLayerAndroid.cpp @@ -163,13 +163,19 @@ bool BaseLayerAndroid::drawBasePictureInGL(SkRect& viewport, float scale, double zooming = true; } + // Display the current page + TiledPage* tiledPage = m_glWebViewState->frontPage(); + tiledPage->setScale(m_glWebViewState->currentScale()); + // Let's prepare the page if needed if (prepareNextTiledPage) { TiledPage* nextTiledPage = m_glWebViewState->backPage(); nextTiledPage->setScale(scale); m_glWebViewState->setFutureViewport(viewportTileBounds); m_glWebViewState->lockBaseLayerUpdate(); - nextTiledPage->prepare(goingDown, goingLeft, viewportTileBounds, true); + nextTiledPage->prepare(goingDown, goingLeft, viewportTileBounds); + // Cancel pending paints for the foreground page + TilesManager::instance()->removePaintOperationsForPage(tiledPage, false); } float transparency = 1; @@ -205,9 +211,6 @@ bool BaseLayerAndroid::drawBasePictureInGL(SkRect& viewport, float scale, double } } - // Display the current page - TiledPage* tiledPage = m_glWebViewState->frontPage(); - tiledPage->setScale(m_glWebViewState->currentScale()); const SkIRect& preZoomBounds = m_glWebViewState->preZoomBounds(); TiledPage* nextTiledPage = m_glWebViewState->backPage(); @@ -240,7 +243,8 @@ bool BaseLayerAndroid::drawBasePictureInGL(SkRect& viewport, float scale, double if (!zooming) m_glWebViewState->unlockBaseLayerUpdate(); - tiledPage->prepare(goingDown, goingLeft, preZoomBounds, true); + if (!prepareNextTiledPage) + tiledPage->prepare(goingDown, goingLeft, preZoomBounds); tiledPage->draw(transparency, preZoomBounds); } |