Index: src/core/SkRecorder.h |
diff --git a/src/core/SkRecorder.h b/src/core/SkRecorder.h |
index b532c89060ea0ece9b014eb472f6ef78198097f3..d96848eb5461e41cd1f1d1ad8807d2a6a75e0605 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,9 +38,11 @@ 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. |
+ SkCanvasDrawableList* detachDrawableList() { |
+ return fDrawableList.detach(); |
+ } |
+ |
SkPicture::SnapshotArray* newDrawableSnapshot(SkBBHFactory*, uint32_t recordFlags); |
// Make SkRecorder forget entirely about its SkRecord*; all calls to SkRecorder will fail. |
@@ -145,7 +165,7 @@ private: |
int fSaveLayerCount; |
SkTDArray<SkBool8> fSaveIsSaveLayer; |
- SkTDArray<SkCanvasDrawable*> fDrawableList; |
+ SkAutoTDelete<SkCanvasDrawableList> fDrawableList; |
}; |
#endif//SkRecorder_DEFINED |