| Index: src/core/SkPictureRecorder.cpp
|
| diff --git a/src/core/SkPictureRecorder.cpp b/src/core/SkPictureRecorder.cpp
|
| index 42f8732c79032764cea607384538a64c93c0f505..69411d3bc374e78a004883abbfdc05bfdf48ca11 100644
|
| --- a/src/core/SkPictureRecorder.cpp
|
| +++ b/src/core/SkPictureRecorder.cpp
|
| @@ -5,8 +5,8 @@
|
| * found in the LICENSE file.
|
| */
|
|
|
| +#include "SkCanvasDrawable.h"
|
| #include "SkData.h"
|
| -#include "SkDrawable.h"
|
| #include "SkLayerInfo.h"
|
| #include "SkPictureRecorder.h"
|
| #include "SkRecord.h"
|
| @@ -51,7 +51,7 @@
|
| saveLayerData.reset(SkNEW_ARGS(SkLayerInfo, (key)));
|
| }
|
|
|
| - SkDrawableList* drawableList = fRecorder->getDrawableList();
|
| + SkCanvasDrawableList* drawableList = fRecorder->getDrawableList();
|
| SkPicture::SnapshotArray* pictList = drawableList ? drawableList->newDrawableSnapshot() : NULL;
|
|
|
| if (fBBH.get()) {
|
| @@ -82,8 +82,8 @@
|
| }
|
|
|
| int drawableCount = 0;
|
| - SkDrawable* const* drawables = NULL;
|
| - SkDrawableList* drawableList = fRecorder->getDrawableList();
|
| + SkCanvasDrawable* const* drawables = NULL;
|
| + SkCanvasDrawableList* drawableList = fRecorder->getDrawableList();
|
| if (drawableList) {
|
| drawableCount = drawableList->count();
|
| drawables = drawableList->begin();
|
| @@ -93,15 +93,15 @@
|
|
|
| ///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
| -class SkRecordedDrawable : public SkDrawable {
|
| - SkAutoTUnref<SkRecord> fRecord;
|
| - SkAutoTUnref<SkBBoxHierarchy> fBBH;
|
| - SkAutoTDelete<SkDrawableList> fDrawableList;
|
| - const SkRect fBounds;
|
| - const bool fDoSaveLayerInfo;
|
| +class SkRecordedDrawable : public SkCanvasDrawable {
|
| + SkAutoTUnref<SkRecord> fRecord;
|
| + SkAutoTUnref<SkBBoxHierarchy> fBBH;
|
| + SkAutoTDelete<SkCanvasDrawableList> fDrawableList;
|
| + const SkRect fBounds;
|
| + const bool fDoSaveLayerInfo;
|
|
|
| public:
|
| - SkRecordedDrawable(SkRecord* record, SkBBoxHierarchy* bbh, SkDrawableList* drawableList,
|
| + SkRecordedDrawable(SkRecord* record, SkBBoxHierarchy* bbh, SkCanvasDrawableList* drawableList,
|
| const SkRect& bounds, bool doSaveLayerInfo)
|
| : fRecord(SkRef(record))
|
| , fBBH(SkSafeRef(bbh))
|
| @@ -114,7 +114,7 @@
|
| SkRect onGetBounds() SK_OVERRIDE { return fBounds; }
|
|
|
| void onDraw(SkCanvas* canvas) SK_OVERRIDE {
|
| - SkDrawable* const* drawables = NULL;
|
| + SkCanvasDrawable* const* drawables = NULL;
|
| int drawableCount = 0;
|
| if (fDrawableList) {
|
| drawables = fDrawableList->begin();
|
| @@ -153,7 +153,7 @@
|
| }
|
| };
|
|
|
| -SkDrawable* SkPictureRecorder::endRecordingAsDrawable() {
|
| +SkCanvasDrawable* SkPictureRecorder::EXPERIMENTAL_endRecordingAsDrawable() {
|
| // TODO: delay as much of this work until just before first playback?
|
| SkRecordOptimize(fRecord);
|
|
|
| @@ -161,10 +161,10 @@
|
| SkRecordFillBounds(fCullRect, *fRecord, fBBH.get());
|
| }
|
|
|
| - SkDrawable* drawable = SkNEW_ARGS(SkRecordedDrawable,
|
| - (fRecord, fBBH, fRecorder->detachDrawableList(),
|
| - fCullRect,
|
| - SkToBool(fFlags & kComputeSaveLayerInfo_RecordFlag)));
|
| + SkCanvasDrawable* drawable = SkNEW_ARGS(SkRecordedDrawable,
|
| + (fRecord, fBBH, fRecorder->detachDrawableList(),
|
| + fCullRect,
|
| + SkToBool(fFlags & kComputeSaveLayerInfo_RecordFlag)));
|
|
|
| // release our refs now, so only the drawable will be the owner.
|
| fRecorder.reset(NULL);
|
|
|