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

Unified Diff: src/core/SkRecorder.h

Issue 732653004: option to return drawable from recording (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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/SkRecordDraw.cpp ('k') | src/core/SkRecorder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRecorder.h
diff --git a/src/core/SkRecorder.h b/src/core/SkRecorder.h
index b532c89060ea0ece9b014eb472f6ef78198097f3..be67dddd2ef6c5c1a5a77f09dfa8d9655a895caf 100644
--- a/src/core/SkRecorder.h
+++ b/src/core/SkRecorder.h
@@ -13,6 +13,24 @@
#include "SkRecords.h"
#include "SkTDArray.h"
+class SkBBHFactory;
+
+class SkCanvasDrawableList : SkNoncopyable {
+public:
+ ~SkCanvasDrawableList();
+
+ int count() const { return fArray.count(); }
+ SkCanvasDrawable* const* begin() const { return fArray.begin(); }
+
+ void append(SkCanvasDrawable* drawable);
+
+ // Return a new or ref'd array of pictures that were snapped from our drawables.
+ SkPicture::SnapshotArray* newDrawableSnapshot();
+
+private:
+ SkTDArray<SkCanvasDrawable*> fArray;
+};
+
// SkRecorder provides an SkCanvas interface for recording into an SkRecord.
class SkRecorder : public SkCanvas {
@@ -20,10 +38,9 @@ public:
// Does not take ownership of the SkRecord.
SkRecorder(SkRecord*, int width, int height); // legacy version
SkRecorder(SkRecord*, const SkRect& bounds);
- virtual ~SkRecorder() SK_OVERRIDE;
- // Return a new or ref'd array of pictures that were snapped from our drawables.
- SkPicture::SnapshotArray* newDrawableSnapshot(SkBBHFactory*, uint32_t recordFlags);
+ SkCanvasDrawableList* getDrawableList() const { return fDrawableList.get(); }
+ SkCanvasDrawableList* detachDrawableList() { return fDrawableList.detach(); }
// Make SkRecorder forget entirely about its SkRecord*; all calls to SkRecorder will fail.
void forgetRecord();
@@ -145,7 +162,7 @@ private:
int fSaveLayerCount;
SkTDArray<SkBool8> fSaveIsSaveLayer;
- SkTDArray<SkCanvasDrawable*> fDrawableList;
+ SkAutoTDelete<SkCanvasDrawableList> fDrawableList;
};
#endif//SkRecorder_DEFINED
« no previous file with comments | « src/core/SkRecordDraw.cpp ('k') | src/core/SkRecorder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698