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

Unified Diff: gm/pictureimagefilter.cpp

Issue 214953003: split SkPictureRecorder out of SkPicture (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: update to ToT (again) Created 6 years, 8 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
Index: gm/pictureimagefilter.cpp
===================================================================
--- gm/pictureimagefilter.cpp (revision 14159)
+++ gm/pictureimagefilter.cpp (working copy)
@@ -22,7 +22,8 @@
}
void makePicture() {
- SkCanvas* canvas = fPicture.beginRecording(100, 100);
+ SkPictureRecorder recorder;
+ SkCanvas* canvas = recorder.beginRecording(100, 100);
canvas->clear(0x00000000);
SkPaint paint;
paint.setAntiAlias(true);
@@ -30,7 +31,7 @@
paint.setTextSize(SkIntToScalar(96));
const char* str = "e";
canvas->drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70), paint);
- fPicture.endRecording();
+ fPicture.reset(recorder.endRecording());
}
virtual SkISize onISize() SK_OVERRIDE { return SkISize::Make(500, 150); }
@@ -54,9 +55,9 @@
SkRect srcRect = SkRect::MakeXYWH(20, 20, 30, 30);
SkRect emptyRect = SkRect::MakeXYWH(20, 20, 0, 0);
SkRect bounds = SkRect::MakeXYWH(0, 0, 100, 100);
- SkAutoTUnref<SkImageFilter> pictureSource(SkPictureImageFilter::Create(&fPicture));
- SkAutoTUnref<SkImageFilter> pictureSourceSrcRect(SkPictureImageFilter::Create(&fPicture, srcRect));
- SkAutoTUnref<SkImageFilter> pictureSourceEmptyRect(SkPictureImageFilter::Create(&fPicture, emptyRect));
+ SkAutoTUnref<SkImageFilter> pictureSource(SkPictureImageFilter::Create(fPicture));
+ SkAutoTUnref<SkImageFilter> pictureSourceSrcRect(SkPictureImageFilter::Create(fPicture, srcRect));
+ SkAutoTUnref<SkImageFilter> pictureSourceEmptyRect(SkPictureImageFilter::Create(fPicture, emptyRect));
// Draw the picture unscaled.
fillRectFiltered(canvas, bounds, pictureSource);
@@ -82,7 +83,7 @@
}
private:
- SkPicture fPicture;
+ SkAutoTUnref<SkPicture> fPicture;
typedef GM INHERITED;
};
« no previous file with comments | « gm/pathopsskpclip.cpp ('k') | gm/pictureshader.cpp » ('j') | samplecode/SampleTiling.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698