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

Unified Diff: src/core/SkRecords.h

Issue 449933002: change drawPicture in SkRecord to just ref the picture (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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 | « src/core/SkRecorder.cpp ('k') | tests/RecorderTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRecords.h
diff --git a/src/core/SkRecords.h b/src/core/SkRecords.h
index e6d98f7a1d2a424de800fe08da8002856c8c23fa..1de16754528c408ec195657ff5fd8c60240a19f3 100644
--- a/src/core/SkRecords.h
+++ b/src/core/SkRecords.h
@@ -9,6 +9,24 @@
#define SkRecords_DEFINED
#include "SkCanvas.h"
+#include "SkPicture.h"
+
+class SkPictureBox {
+public:
+ SkPictureBox(const SkPicture* obj) : fObj(SkRef(obj)) {}
+ SkPictureBox(const SkPictureBox& src) : fObj(SkRef(src.fObj)) {}
+ ~SkPictureBox() { fObj->unref(); }
+
+ SkPictureBox& operator=(const SkPictureBox& src) {
+ SkRefCnt_SafeAssign(fObj, src.fObj);
+ return *this;
+ }
+
+ operator const SkPicture*() const { return fObj; }
+
+private:
+ const SkPicture* fObj;
mtklein 2014/08/07 18:19:27 SkAutoTUnref<const SkPicture> ?
reed1 2014/08/07 19:10:52 Possibly, but I think the Box semantics are differ
+};
namespace SkRecords {
@@ -46,6 +64,7 @@ namespace SkRecords {
M(DrawPaint) \
M(DrawPath) \
M(DrawPatch) \
+ M(DrawPicture) \
M(DrawPoints) \
M(DrawPosText) \
M(DrawPosTextH) \
@@ -219,6 +238,7 @@ RECORD2(DrawOval, SkPaint, paint, SkRect, oval);
RECORD1(DrawPaint, SkPaint, paint);
RECORD2(DrawPath, SkPaint, paint, SkPath, path);
RECORD2(DrawPatch, SkPaint, paint, SkPatch, patch);
+RECORD1(DrawPicture, SkPictureBox, picture);
RECORD4(DrawPoints, SkPaint, paint, SkCanvas::PointMode, mode, size_t, count, SkPoint*, pts);
RECORD4(DrawPosText, SkPaint, paint,
PODArray<char>, text,
« no previous file with comments | « src/core/SkRecorder.cpp ('k') | tests/RecorderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698