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; |
}; |