aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkPictureRecorder.h
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-07-06 09:29:16 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-06 09:29:17 -0700
commit41c27e15ec2740850700f1b82038ce0f7a632481 (patch)
tree5830ed6b2047502cb68cf0e0a805a4d670f74c64 /include/core/SkPictureRecorder.h
parent7ec92413307c9da43c013d1e4e15716a44059810 (diff)
Experiment: add flag for finish-recording to return null
Diffstat (limited to 'include/core/SkPictureRecorder.h')
-rw-r--r--include/core/SkPictureRecorder.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/include/core/SkPictureRecorder.h b/include/core/SkPictureRecorder.h
index 3f0cbcc801..419c01bc88 100644
--- a/include/core/SkPictureRecorder.h
+++ b/include/core/SkPictureRecorder.h
@@ -33,11 +33,15 @@ public:
enum RecordFlags {
// This flag indicates that, if some BHH is being computed, saveLayer
// information should also be extracted at the same time.
- kComputeSaveLayerInfo_RecordFlag = 0x01,
+ kComputeSaveLayerInfo_RecordFlag = 1 << 0,
// If you call drawPicture() or drawDrawable() on the recording canvas, this flag forces
// that object to playback its contents immediately rather than reffing the object.
- kPlaybackDrawPicture_RecordFlag = 0x02,
+ kPlaybackDrawPicture_RecordFlag = 1 << 1,
+ };
+
+ enum FinishFlags {
+ kReturnNullForEmpty_FinishFlag = 1 << 0, // no draw-ops will return nullptr
};
/** Returns the canvas that records the drawing commands.
@@ -72,7 +76,7 @@ public:
* reflect their current state, but will not contain a live reference to the drawables
* themselves.
*/
- sk_sp<SkPicture> finishRecordingAsPicture();
+ sk_sp<SkPicture> finishRecordingAsPicture(uint32_t endFlags = 0);
/**
* Signal that the caller is done recording, and update the cull rect to use for bounding
@@ -83,7 +87,8 @@ public:
* and subsequent culling operations.
* @return the picture containing the recorded content.
*/
- sk_sp<SkPicture> finishRecordingAsPictureWithCull(const SkRect& cullRect);
+ sk_sp<SkPicture> finishRecordingAsPictureWithCull(const SkRect& cullRect,
+ uint32_t endFlags = 0);
/**
* Signal that the caller is done recording. This invalidates the canvas returned by
@@ -95,7 +100,7 @@ public:
* and therefore this drawable will reflect the current state of those nested drawables anytime
* it is drawn or a new picture is snapped from it (by calling drawable->newPictureSnapshot()).
*/
- sk_sp<SkDrawable> finishRecordingAsDrawable();
+ sk_sp<SkDrawable> finishRecordingAsDrawable(uint32_t endFlags = 0);
#ifdef SK_SUPPORT_LEGACY_PICTURE_PTR
SkPicture* SK_WARN_UNUSED_RESULT endRecordingAsPicture() {