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

Unified Diff: include/core/SkPicture.h

Issue 333823007: Enable basic drawing with SkRecord-based pictures. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: ref accel data 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 | « debugger/QT/SkDebuggerGUI.cpp ('k') | src/core/SkPicture.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPicture.h
diff --git a/include/core/SkPicture.h b/include/core/SkPicture.h
index 7b38230186027e35030f5ef936a66e3d1d66bf56..7cba671d0a513ff4cce3330723ecf67609a063b5 100644
--- a/include/core/SkPicture.h
+++ b/include/core/SkPicture.h
@@ -30,6 +30,8 @@ class SkWStream;
struct SkPictInfo;
+class SkRecord;
+
/** \class SkPicture
The SkPicture class records the drawing commands made to a canvas, to
@@ -67,16 +69,10 @@ public:
SkPicture(const SkPicture& src);
/** PRIVATE / EXPERIMENTAL -- do not call */
- void EXPERIMENTAL_addAccelData(const AccelData* data) const {
- SkRefCnt_SafeAssign(fAccelData, data);
- }
+ void EXPERIMENTAL_addAccelData(const AccelData*) const;
+
/** PRIVATE / EXPERIMENTAL -- do not call */
- const AccelData* EXPERIMENTAL_getAccelData(AccelData::Key key) const {
- if (NULL != fAccelData && fAccelData->getKey() == key) {
- return fAccelData;
- }
- return NULL;
- }
+ const AccelData* EXPERIMENTAL_getAccelData(AccelData::Key) const;
/**
* Function signature defining a function that sets up an SkBitmap from encoded data. On
@@ -255,12 +251,12 @@ protected:
mutable uint32_t fUniqueID;
- // fPlayback, fRecord, fWidth & fHeight are protected to allow derived classes to
+ // fPlayback, fWidth & fHeight are protected to allow derived classes to
// install their own SkPicturePlayback-derived players,SkPictureRecord-derived
// recorders and set the picture size
- SkPicturePlayback* fPlayback;
+ SkAutoTDelete<SkPicturePlayback> fPlayback;
int fWidth, fHeight;
- mutable const AccelData* fAccelData;
+ mutable SkAutoTUnref<const AccelData> fAccelData;
void needsNewGenID() { fUniqueID = SK_InvalidGenID; }
@@ -318,6 +314,9 @@ private:
friend class SkDebugCanvas;
typedef SkRefCnt INHERITED;
+
+ SkPicture(int width, int height, SkRecord*); // Takes ownership.
+ SkAutoTDelete<SkRecord> fRecord;
};
/**
« no previous file with comments | « debugger/QT/SkDebuggerGUI.cpp ('k') | src/core/SkPicture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698