From fc92ca2409a95b539274985812d88016b6b84b7e Mon Sep 17 00:00:00 2001 From: Derek Sollenberger Date: Tue, 2 Nov 2010 11:15:08 -0400 Subject: Support partial invalidation of tiles based on webkit's inval rect. This CL causes the selective repainting of BaseTiles (and their associated GL textures) using the information provided by Webkit. If tiles need repainted they are marked with as dirty and the thread painting and uploading the textures will only operate on dirty tiles. This change resulted in some significant refactoring most of which revolved around these changes... (1) Removed PaintingInfo from the Texture object and instead track the state of the tile in Tile object. (2) Removed all pending TileSets for a TiledPage when the page produces a new set. This ensures that the tiles currently visible to the user are painted instead of ones that may already be offscreen. Change-Id: I93845d8e6e7b066e6bab84bcde11be4a6940002f --- WebCore/platform/graphics/android/GLWebViewState.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'WebCore/platform/graphics/android/GLWebViewState.cpp') diff --git a/WebCore/platform/graphics/android/GLWebViewState.cpp b/WebCore/platform/graphics/android/GLWebViewState.cpp index e1e517c..814e590 100644 --- a/WebCore/platform/graphics/android/GLWebViewState.cpp +++ b/WebCore/platform/graphics/android/GLWebViewState.cpp @@ -81,7 +81,6 @@ GLWebViewState::GLWebViewState() , m_extra(0) , m_navLayer(0) { - m_invalidatedRect.setEmpty(); m_tiledPageA = new TiledPage(FIRST_TILED_PAGE_ID, this); m_tiledPageB = new TiledPage(SECOND_TILED_PAGE_ID, this); #ifdef DEBUG_COUNT @@ -108,8 +107,13 @@ void GLWebViewState::setBaseLayer(BaseLayerAndroid* layer, IntRect& rect) m_navLayer = 0; if (m_baseLayer) { m_baseLayer->setGLWebViewState(this); - m_invalidatedRect.set(rect); m_currentPictureCounter++; + + if (!rect.isEmpty()) { + // find which tiles fall within the invalRect and mark them as dirty + m_tiledPageA->invalidateRect(rect, m_currentPictureCounter); + m_tiledPageB->invalidateRect(rect, m_currentPictureCounter); + } } } @@ -132,7 +136,7 @@ void GLWebViewState::resetExtra(bool repaint) m_navLayer = 0; } -void GLWebViewState::paintBaseLayerContent(SkCanvas* canvas) +int GLWebViewState::paintBaseLayerContent(SkCanvas* canvas) { android::Mutex::Autolock lock(m_baseLayerLock); if (m_baseLayer) { @@ -140,6 +144,7 @@ void GLWebViewState::paintBaseLayerContent(SkCanvas* canvas) if (m_extra && m_navLayer) m_extra->draw(canvas, m_navLayer); } + return m_currentPictureCounter; } void GLWebViewState::scheduleUpdate(const double& currentTime, float scale) -- cgit v1.1