aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPictureRecorder.cpp
diff options
context:
space:
mode:
authorGravatar schenney <schenney@chromium.org>2015-03-06 16:20:28 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-06 16:20:28 -0800
commit23d8593f8127411d9d687b4565b34b4ecd6b11d3 (patch)
treeca55294aa7b3e519f64daedde3de846e615188b2 /src/core/SkPictureRecorder.cpp
parenta27cdefae19d1d40e6a9ca84935c72bde48236b3 (diff)
Update SkPicture cull rects with RTree information
When computed, the RTree for an SkPicture will have a root bounds that reflects the best bounding information available, rather than the best estimate at the time the picture recorder is created. Given that creators frequently don't know ahead of time what will be drawn, the RTree bound is often tighter. Perf testing on Chrome indicates a small raster performance advantage. For upcoming painting changes in Chrome the performance advantage is much larger. BUG= Committed: https://skia.googlesource.com/skia/+/2dd3b6647dc726f36fd8774b3d0d2e83b493aeac Review URL: https://codereview.chromium.org/971803002
Diffstat (limited to 'src/core/SkPictureRecorder.cpp')
-rw-r--r--src/core/SkPictureRecorder.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/SkPictureRecorder.cpp b/src/core/SkPictureRecorder.cpp
index 42f8732c79..1972ad3341 100644
--- a/src/core/SkPictureRecorder.cpp
+++ b/src/core/SkPictureRecorder.cpp
@@ -60,6 +60,10 @@ SkPicture* SkPictureRecorder::endRecordingAsPicture() {
} else {
SkRecordFillBounds(fCullRect, *fRecord, fBBH.get());
}
+ SkRect bbhBound = fBBH->getRootBound();
+ SkASSERT((bbhBound.isEmpty() || fCullRect.contains(bbhBound))
+ || (bbhBound.isEmpty() && fCullRect.isEmpty()));
+ fCullRect = bbhBound;
}
SkPicture* pict = SkNEW_ARGS(SkPicture, (fCullRect, fRecord, pictList, fBBH));