Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Unified Diff: include/core/SkPictureRecorder.h

Issue 344253005: Use smart pointers to make SkPictureRecorder lifetimes less manual. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: record Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkPictureRecorder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPictureRecorder.h
diff --git a/include/core/SkPictureRecorder.h b/include/core/SkPictureRecorder.h
index cf17e1aec279b2edd887dfa91bfb2efa10103183..bd22d5560647447d5c65953bc562d70adb2ebcc5 100644
--- a/include/core/SkPictureRecorder.h
+++ b/include/core/SkPictureRecorder.h
@@ -25,7 +25,7 @@ class SkRecorder;
class SK_API SkPictureRecorder : SkNoncopyable {
public:
- SkPictureRecorder() : fPictureRecord(NULL), fRecorder(NULL), fRecord(NULL) { }
+ SkPictureRecorder();
~SkPictureRecorder();
/** Returns the canvas that records the drawing commands.
@@ -77,15 +77,15 @@ private:
friend class SkPictureRecorderReplayTester; // for unit testing
void partialReplay(SkCanvas* canvas) const;
- int fWidth;
- int fHeight;
+ int fWidth;
+ int fHeight;
- // Both ref counted. One of these two will be non-null:
- SkPictureRecord* fPictureRecord; // beginRecording()
- SkRecorder* fRecorder; // EXPERIMENTAL_beginRecording()
+ // One of these two canvases will be non-NULL.
+ SkAutoTUnref<SkPictureRecord> fPictureRecord; // beginRecording()
+ SkAutoTUnref<SkRecorder> fRecorder; // EXPERIMENTAL_beginRecording()
- // Not refcounted. Used by EXPERIMENTAL_beginRecording().
- SkRecord* fRecord;
+ // Used by EXPERIMENTAL_beginRecording().
+ SkAutoTDelete<SkRecord> fRecord;
typedef SkNoncopyable INHERITED;
};
« no previous file with comments | « no previous file | src/core/SkPictureRecorder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698