*/
bool hasText() const;
- // A refcounted array of refcounted const SkPicture pointers.
- struct SnapshotArray : public SkNVRefCnt<SnapshotArray> {
+ // An array of refcounted const SkPicture pointers.
+ class SnapshotArray : ::SkNoncopyable {
+ public:
SnapshotArray(const SkPicture* pics[], size_t count) : fPics(pics), fCount(count) {}
~SnapshotArray() { for (size_t i = 0; i < fCount; i++) { fPics[i]->unref(); } }
void createHeader(SkPictInfo* info) const;
static bool IsValidPictInfo(const SkPictInfo& info);
- // Takes ownership of the SkRecord, refs the (optional) SnapshotArray and BBH.
+ // Takes ownership of the SkRecord and (optional) SnapshotArray, refs the (optional) BBH.
SkPicture(const SkRect& cullRect, SkRecord*, SnapshotArray*, SkBBoxHierarchy*);
static SkPicture* Forwardport(const SkPictInfo&, const SkPictureData*);
mutable SkTDArray<DeletionListener*> fDeletionListeners; // pointers are refed
SkAutoTDelete<const SkRecord> fRecord;
SkAutoTUnref<const SkBBoxHierarchy> fBBH;
- SkAutoTUnref<const SnapshotArray> fDrawablePicts;
+ SkAutoTDelete<const SnapshotArray> fDrawablePicts;
// helpers for fDrawablePicts
int drawableCount() const;
// TODO: we should remember these from our caller
SkBBHFactory* factory = NULL;
uint32_t recordFlags = 0;
- SkAutoTUnref<SkPicture::SnapshotArray> drawablePicts(
+ SkAutoTDelete<SkPicture::SnapshotArray> drawablePicts(
fRecorder->newDrawableSnapshot(factory, recordFlags));
SkPicture* pict = SkNEW_ARGS(SkPicture, (fCullRect, fRecord.detach(),
drawablePicts.detach(), fBBH.get()));