Index: include/core/SkPictureRecorder.h |
diff --git a/include/core/SkPictureRecorder.h b/include/core/SkPictureRecorder.h |
index 6f95860b70afbdacbebc9507de1d9798676b2fb4..3f0cbcc801690be21002327e8d8ac380ad08dd49 100644 |
--- a/include/core/SkPictureRecorder.h |
+++ b/include/core/SkPictureRecorder.h |
@@ -72,7 +72,7 @@ public: |
* reflect their current state, but will not contain a live reference to the drawables |
* themselves. |
*/ |
- SkPicture* SK_WARN_UNUSED_RESULT endRecordingAsPicture(); |
+ sk_sp<SkPicture> finishRecordingAsPicture(); |
/** |
* Signal that the caller is done recording, and update the cull rect to use for bounding |
@@ -83,7 +83,7 @@ public: |
* and subsequent culling operations. |
* @return the picture containing the recorded content. |
*/ |
- SkPicture* SK_WARN_UNUSED_RESULT endRecordingAsPicture(const SkRect& cullRect); |
+ sk_sp<SkPicture> finishRecordingAsPictureWithCull(const SkRect& cullRect); |
/** |
* Signal that the caller is done recording. This invalidates the canvas returned by |
@@ -95,10 +95,20 @@ 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()). |
*/ |
- SkDrawable* SK_WARN_UNUSED_RESULT endRecordingAsDrawable(); |
+ sk_sp<SkDrawable> finishRecordingAsDrawable(); |
- // Legacy API -- use endRecordingAsPicture instead. |
+#ifdef SK_SUPPORT_LEGACY_PICTURE_PTR |
+ SkPicture* SK_WARN_UNUSED_RESULT endRecordingAsPicture() { |
+ return this->finishRecordingAsPicture().release(); |
+ } |
+ SkPicture* SK_WARN_UNUSED_RESULT endRecordingAsPicture(const SkRect& cullRect) { |
+ return this->finishRecordingAsPictureWithCull(cullRect).release(); |
+ } |
+ SkDrawable* SK_WARN_UNUSED_RESULT endRecordingAsDrawable() { |
+ return this->finishRecordingAsDrawable().release(); |
+ } |
SkPicture* SK_WARN_UNUSED_RESULT endRecording() { return this->endRecordingAsPicture(); } |
+#endif |
private: |
void reset(); |