aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPictureRecorder.cpp
diff options
context:
space:
mode:
authorGravatar schenney <schenney@chromium.org>2015-07-07 14:27:10 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-07 14:27:10 -0700
commiteeff8bb8ffdd6e77823a23bad3d23e4f15057681 (patch)
treeabc031970b47be982d6570749ce8107fe2c6426a /src/core/SkPictureRecorder.cpp
parent0dacc6708d5db4fbe755d7b1d0716b51fe703058 (diff)
Allow reset of the SkPictureRecorder cull rect and other parameters during endRecording.
For some users of SkPictureRecorder, the cull rect is more efficiently determined while drawing is in progress, rather than when recording starts. The existing API requires the cull rect at start time, even though the information is not used for any culling purpose until the end of recording. This patch provides a means to reset the cull rect when recording ends, allowing users to update the rect based on information learned during drawing and for the new rect to be used as the culling bound. A valid bound is still required on the beginRecording call because it sizes the underlying canvas and sets the aspect ratio for any bounding box hierarchy. The bounding box factory can also be specified and parameters that control SkPicture creation. R=mtklein, reed1 BUG=skia:3919 Review URL: https://codereview.chromium.org/1178673007
Diffstat (limited to 'src/core/SkPictureRecorder.cpp')
-rw-r--r--src/core/SkPictureRecorder.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/SkPictureRecorder.cpp b/src/core/SkPictureRecorder.cpp
index 877314ccaf..0c50dd9bb7 100644
--- a/src/core/SkPictureRecorder.cpp
+++ b/src/core/SkPictureRecorder.cpp
@@ -95,6 +95,12 @@ SkPicture* SkPictureRecorder::endRecordingAsPicture() {
subPictureBytes));
}
+SkPicture* SkPictureRecorder::endRecordingAsPicture(const SkRect& cullRect) {
+ fCullRect = cullRect;
+ return this->endRecordingAsPicture();
+}
+
+
void SkPictureRecorder::partialReplay(SkCanvas* canvas) const {
if (NULL == canvas) {
return;