diff options
author | Nicolas Roard <nicolasroard@google.com> | 2011-08-30 19:33:56 -0700 |
---|---|---|
committer | Nicolas Roard <nicolasroard@google.com> | 2011-08-31 12:17:37 -0700 |
commit | aea871699cf64ab1d1909fd46a7059d379747919 (patch) | |
tree | fa0bf8ba292ce8c505c1531158e5debe0b183096 /Source/WebKit/android/jni/WebViewCore.cpp | |
parent | 12b77e280bad970089c6ef32e247a39a13e36057 (diff) | |
download | external_webkit-aea871699cf64ab1d1909fd46a7059d379747919.zip external_webkit-aea871699cf64ab1d1909fd46a7059d379747919.tar.gz external_webkit-aea871699cf64ab1d1909fd46a7059d379747919.tar.bz2 |
Implement a faster pictureset
Cluster the invalidations in regular buckets
bug:5218173 bug:5145259
Change-Id: Ie3b4be6848b51ca0306bd163803635f9481ace9b
Diffstat (limited to 'Source/WebKit/android/jni/WebViewCore.cpp')
-rw-r--r-- | Source/WebKit/android/jni/WebViewCore.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index 5bc7f48..3ad8ab2 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -888,6 +888,22 @@ SkPicture* WebViewCore::rebuildPicture(const SkIRect& inval) void WebViewCore::rebuildPictureSet(PictureSet* pictureSet) { WebCore::FrameView* view = m_mainFrame->view(); + +#ifdef FAST_PICTURESET + WTF::Vector<Bucket*>* buckets = pictureSet->bucketsToUpdate(); + + for (unsigned int i = 0; i < buckets->size(); i++) { + Bucket* bucket = (*buckets)[i]; + for (unsigned int j = 0; j < bucket->size(); j++) { + BucketPicture& bucketPicture = (*bucket)[j]; + const SkIRect& inval = bucketPicture.mRealArea; + SkPicture* picture = rebuildPicture(inval); + SkSafeUnref(bucketPicture.mPicture); + bucketPicture.mPicture = picture; + } + } + buckets->clear(); +#else size_t size = pictureSet->size(); for (size_t index = 0; index < size; index++) { if (pictureSet->upToDate(index)) @@ -897,7 +913,9 @@ void WebViewCore::rebuildPictureSet(PictureSet* pictureSet) inval.fLeft, inval.fTop, inval.width(), inval.height()); pictureSet->setPicture(index, rebuildPicture(inval)); } + pictureSet->validate(__FUNCTION__); +#endif } BaseLayerAndroid* WebViewCore::createBaseLayer() @@ -973,11 +991,14 @@ BaseLayerAndroid* WebViewCore::recordContent(SkRegion* region, SkIPoint* point) void WebViewCore::splitContent(PictureSet* content) { +#ifdef FAST_PICTURESET +#else bool layoutSucceeded = layoutIfNeededRecursive(m_mainFrame); LOG_ASSERT(layoutSucceeded, "Can never be called recursively"); content->split(&m_content); rebuildPictureSet(&m_content); content->set(m_content); +#endif // FAST_PICTURESET } void WebViewCore::scrollTo(int x, int y, bool animate) |