diff options
author | Chris Craik <ccraik@google.com> | 2011-08-03 09:46:14 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-08-03 09:46:14 -0700 |
commit | 2379a24a13c36a6497eb9ba266c511e68c23d056 (patch) | |
tree | 924502a2bd56c34b3d0ec79f6021796e7e3bd22a /Source/WebCore/platform/graphics/android | |
parent | 882895765cd1ba53b1fb5956e8546f6fd252ba13 (diff) | |
parent | af33356e96e56310c66b47b6db913e1a61981ca3 (diff) | |
download | external_webkit-2379a24a13c36a6497eb9ba266c511e68c23d056.zip external_webkit-2379a24a13c36a6497eb9ba266c511e68c23d056.tar.gz external_webkit-2379a24a13c36a6497eb9ba266c511e68c23d056.tar.bz2 |
Merge "Support registering page swap callback, content inval"
Diffstat (limited to 'Source/WebCore/platform/graphics/android')
3 files changed, 13 insertions, 0 deletions
diff --git a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp index 014fa40..3aa325f 100644 --- a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp @@ -254,6 +254,11 @@ bool BaseLayerAndroid::drawBasePictureInGL(SkRect& viewport, float scale, *pagesSwapped = true; } + // if no longer trailing behind invalidates, unlock (so invalidates can + // go directly to the the TiledPages without deferral) + if (!needsRedraw) + m_glWebViewState->unlockBaseLayerUpdate(); + m_glWebViewState->paintExtras(); return needsRedraw; } diff --git a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp index df8ecbe..4155461 100644 --- a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp +++ b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp @@ -223,6 +223,7 @@ void GLWebViewState::setExtra(BaseLayerAndroid* layer, SkPicture& picture, void GLWebViewState::inval(const IntRect& rect) { if (m_baseLayerUpdate) { + // base layer isn't locked, so go ahead and issue the inval to both tiled pages m_currentPictureCounter++; if (!rect.isEmpty()) { // find which tiles fall within the invalRect and mark them as dirty @@ -237,6 +238,7 @@ void GLWebViewState::inval(const IntRect& rect) rect.x(), rect.y(), rect.width(), rect.height()); } } else { + // base layer is locked, so defer invalidation until unlockBaseLayerUpdate() m_invalidateRegion.op(rect.x(), rect.y(), rect.maxX(), rect.maxY(), SkRegion::kUnion_Op); } TilesManager::instance()->getProfiler()->nextInval(rect, m_currentScale); diff --git a/Source/WebCore/platform/graphics/android/GLWebViewState.h b/Source/WebCore/platform/graphics/android/GLWebViewState.h index 4f8d4fe..82b6f12 100644 --- a/Source/WebCore/platform/graphics/android/GLWebViewState.h +++ b/Source/WebCore/platform/graphics/android/GLWebViewState.h @@ -129,6 +129,12 @@ class LayerAndroid; // paint the tile and the second id (B) represents the pictureSet in which the // tile was invalidated by webkit. Thus, if A < B then tile is dirty. // +// Since invalidates can occur faster than a full tiled page update, the tiled +// page is protected by a 'lock' (m_baseLayerUpdate) that is set to true to +// defer updates to the background layer, giving the foreground time to render +// content instead of constantly flushing with invalidates. See +// lockBaseLayerUpdate() & unlockBaseLayerUpdate(). +// // Painting scheduling // ------------------- // |