diff options
author | Derek Sollenberger <djsollen@google.com> | 2010-11-02 11:15:08 -0400 |
---|---|---|
committer | Derek Sollenberger <djsollen@google.com> | 2010-11-04 09:53:33 -0400 |
commit | fc92ca2409a95b539274985812d88016b6b84b7e (patch) | |
tree | f7e226a3dc2ea59204b6556845962e431ca9dbd0 /WebCore/platform/graphics/android/GLWebViewState.cpp | |
parent | 2689b38c74169006cadfbce7184976223bc13afc (diff) | |
download | external_webkit-fc92ca2409a95b539274985812d88016b6b84b7e.zip external_webkit-fc92ca2409a95b539274985812d88016b6b84b7e.tar.gz external_webkit-fc92ca2409a95b539274985812d88016b6b84b7e.tar.bz2 |
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
Diffstat (limited to 'WebCore/platform/graphics/android/GLWebViewState.cpp')
-rw-r--r-- | WebCore/platform/graphics/android/GLWebViewState.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
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) |