summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2011-09-07 15:16:17 -0700
committerJohn Reck <jreck@google.com>2011-09-07 15:16:17 -0700
commit21ece83c0c88c197e90db19b44a52382fa3e325b (patch)
tree75044168dc509f00233cb2a6243ef04c6124d3e2
parent666a074f73aab3617c866ebe204ce841978ba270 (diff)
downloadexternal_webkit-21ece83c0c88c197e90db19b44a52382fa3e325b.zip
external_webkit-21ece83c0c88c197e90db19b44a52382fa3e325b.tar.gz
external_webkit-21ece83c0c88c197e90db19b44a52382fa3e325b.tar.bz2
Implement PictureSet(SkPicture*) ctor in FAST_PICTURESET case
Bug: 5270617 Change-Id: I5bcdf551a028588aa34956f98039d893d646b362
-rw-r--r--Source/WebKit/android/jni/PictureSet.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/WebKit/android/jni/PictureSet.cpp b/Source/WebKit/android/jni/PictureSet.cpp
index 839a887..e6a9ed5 100644
--- a/Source/WebKit/android/jni/PictureSet.cpp
+++ b/Source/WebKit/android/jni/PictureSet.cpp
@@ -96,6 +96,27 @@ PictureSet::PictureSet(SkPicture* picture)
mHeight = picture->height();
mBaseArea = mWidth * mHeight;
#ifdef FAST_PICTURESET
+ SkIRect area;
+ area.set(0, 0, mWidth, mHeight);
+ splitAdd(area);
+ WTF::Vector<Bucket*>* buckets = 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 *splitPicture = new SkPicture();
+ SkCanvas *canvas = splitPicture->beginRecording(
+ inval.width(), inval.height(),
+ SkPicture::kUsePathBoundsForClip_RecordingFlag);
+ canvas->translate(-inval.fLeft, -inval.fTop);
+ picture->draw(canvas);
+ splitPicture->endRecording();
+ SkSafeUnref(bucketPicture.mPicture);
+ bucketPicture.mPicture = splitPicture;
+ }
+ }
+ buckets->clear();
#else
Pictures pictureAndBounds;
pictureAndBounds.mPicture = picture;