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

Unified Diff: src/core/SkPictureRecorder.cpp

Issue 903993002: rename SkCanvasDrawable to SkDrawable, and make public (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add dox for drawDrawable Created 5 years, 10 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 | « src/core/SkDrawable.cpp ('k') | src/core/SkRecordDraw.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPictureRecorder.cpp
diff --git a/src/core/SkPictureRecorder.cpp b/src/core/SkPictureRecorder.cpp
index 69411d3bc374e78a004883abbfdc05bfdf48ca11..42f8732c79032764cea607384538a64c93c0f505 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 @@ SkPicture* SkPictureRecorder::endRecordingAsPicture() {
saveLayerData.reset(SkNEW_ARGS(SkLayerInfo, (key)));
}
- SkCanvasDrawableList* drawableList = fRecorder->getDrawableList();
+ SkDrawableList* drawableList = fRecorder->getDrawableList();
SkPicture::SnapshotArray* pictList = drawableList ? drawableList->newDrawableSnapshot() : NULL;
if (fBBH.get()) {
@@ -82,8 +82,8 @@ void SkPictureRecorder::partialReplay(SkCanvas* canvas) const {
}
int drawableCount = 0;
- SkCanvasDrawable* const* drawables = NULL;
- SkCanvasDrawableList* drawableList = fRecorder->getDrawableList();
+ SkDrawable* const* drawables = NULL;
+ SkDrawableList* drawableList = fRecorder->getDrawableList();
if (drawableList) {
drawableCount = drawableList->count();
drawables = drawableList->begin();
@@ -93,15 +93,15 @@ void SkPictureRecorder::partialReplay(SkCanvas* canvas) const {
///////////////////////////////////////////////////////////////////////////////////////////////////
-class SkRecordedDrawable : public SkCanvasDrawable {
- SkAutoTUnref<SkRecord> fRecord;
- SkAutoTUnref<SkBBoxHierarchy> fBBH;
- SkAutoTDelete<SkCanvasDrawableList> fDrawableList;
- const SkRect fBounds;
- const bool fDoSaveLayerInfo;
+class SkRecordedDrawable : public SkDrawable {
+ SkAutoTUnref<SkRecord> fRecord;
+ SkAutoTUnref<SkBBoxHierarchy> fBBH;
+ SkAutoTDelete<SkDrawableList> fDrawableList;
+ const SkRect fBounds;
+ const bool fDoSaveLayerInfo;
public:
- SkRecordedDrawable(SkRecord* record, SkBBoxHierarchy* bbh, SkCanvasDrawableList* drawableList,
+ SkRecordedDrawable(SkRecord* record, SkBBoxHierarchy* bbh, SkDrawableList* drawableList,
const SkRect& bounds, bool doSaveLayerInfo)
: fRecord(SkRef(record))
, fBBH(SkSafeRef(bbh))
@@ -114,7 +114,7 @@ protected:
SkRect onGetBounds() SK_OVERRIDE { return fBounds; }
void onDraw(SkCanvas* canvas) SK_OVERRIDE {
- SkCanvasDrawable* const* drawables = NULL;
+ SkDrawable* const* drawables = NULL;
int drawableCount = 0;
if (fDrawableList) {
drawables = fDrawableList->begin();
@@ -153,7 +153,7 @@ protected:
}
};
-SkCanvasDrawable* SkPictureRecorder::EXPERIMENTAL_endRecordingAsDrawable() {
+SkDrawable* SkPictureRecorder::endRecordingAsDrawable() {
// TODO: delay as much of this work until just before first playback?
SkRecordOptimize(fRecord);
@@ -161,10 +161,10 @@ SkCanvasDrawable* SkPictureRecorder::EXPERIMENTAL_endRecordingAsDrawable() {
SkRecordFillBounds(fCullRect, *fRecord, fBBH.get());
}
- SkCanvasDrawable* drawable = SkNEW_ARGS(SkRecordedDrawable,
- (fRecord, fBBH, fRecorder->detachDrawableList(),
- fCullRect,
- SkToBool(fFlags & kComputeSaveLayerInfo_RecordFlag)));
+ SkDrawable* 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);
« no previous file with comments | « src/core/SkDrawable.cpp ('k') | src/core/SkRecordDraw.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698