summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/android/jni/PictureSet.cpp
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2011-08-28 19:15:00 -0700
committerChris Craik <ccraik@google.com>2011-09-02 16:12:04 -0700
commit8ad3ab0e47f0d5039e89c1873c178f538ec1b0df (patch)
tree80f8455d94b5ae10753e35b4f6badeea5fb8e040 /Source/WebKit/android/jni/PictureSet.cpp
parente3edcfcfc731bd5051947d8c0a4b2685e7cae84d (diff)
downloadexternal_webkit-8ad3ab0e47f0d5039e89c1873c178f538ec1b0df.zip
external_webkit-8ad3ab0e47f0d5039e89c1873c178f538ec1b0df.tar.gz
external_webkit-8ad3ab0e47f0d5039e89c1873c178f538ec1b0df.tar.bz2
Enable double buffering via base tiles
bug:2522049 allocate textures and tiles using the gldraw count when they were most recently prepared remaining issues: -layers still flicker (presumably from texture stealing) -layers aren't double buffered yet Change-Id: Iccdf68326d7d476269d4e3a13903aaab249ee92d
Diffstat (limited to 'Source/WebKit/android/jni/PictureSet.cpp')
-rw-r--r--Source/WebKit/android/jni/PictureSet.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/Source/WebKit/android/jni/PictureSet.cpp b/Source/WebKit/android/jni/PictureSet.cpp
index 3c62205..839a887 100644
--- a/Source/WebKit/android/jni/PictureSet.cpp
+++ b/Source/WebKit/android/jni/PictureSet.cpp
@@ -155,6 +155,11 @@ void PictureSet::add(const SkRegion& area, SkPicture* picture,
Bucket* PictureSet::getBucket(int x, int y)
{
+ // only create buckets for valid, positive coordinates, ignore and return
+ // NULL otherwise
+ if (x < 0 || y < 0)
+ return 0;
+
BucketPosition position(x+1, y+1);
if (!mBuckets.contains(position)) {
Bucket* bucket = new Bucket();
@@ -277,6 +282,10 @@ void PictureSet::gatherBucketsForArea(WTF::Vector<Bucket*>& list, const SkIRect&
{
int maxSize = BUCKET_SIZE;
+ XLOG("\n--- gatherBucketsForArea for rect %d, %d, %d, %d (%d x %d)",
+ rect.fLeft, rect.fTop, rect.fRight, rect.fBottom,
+ rect.width(), rect.height());
+
int x = rect.fLeft;
int y = rect.fTop;
int firstTileX = rect.fLeft / maxSize;
@@ -288,7 +297,8 @@ void PictureSet::gatherBucketsForArea(WTF::Vector<Bucket*>& list, const SkIRect&
for (int j = firstTileY; j <= lastTileY; j++) {
Bucket* bucket = getBucket(i, j);
XLOG("gather bucket %x for %d, %d", bucket, i+1, j+1);
- list.append(bucket);
+ if (bucket)
+ list.append(bucket);
}
}
}
@@ -319,6 +329,9 @@ void PictureSet::splitAdd(const SkIRect& rect)
for (int i = firstTileX; i <= lastTileX; i++) {
for (int j = firstTileY; j <= lastTileY; j++) {
Bucket* bucket = getBucket(i, j);
+ if (!bucket)
+ continue;
+
SkIRect newRect;
int deltaX = i * maxSize;
int deltaY = j * maxSize;
@@ -442,8 +455,10 @@ void PictureSet::add(const SkRegion& area, SkPicture* picture,
Pictures pictureAndBounds = {collect, 0, collect.getBounds(),
elapsed, split, false, false, empty};
+#ifdef FAST_PICTURESET
if (mPictures.size() == 0)
checkForNewBases = true;
+#endif
mPictures.append(pictureAndBounds);
mAdditionalArea += totalArea.width() * totalArea.height();