Chromium Code Reviews| Index: samplecode/SampleFilterFuzz.cpp |
| diff --git a/samplecode/SampleFilterFuzz.cpp b/samplecode/SampleFilterFuzz.cpp |
| index 0cba43c2669b5b0d526d98c21b3ca10395c12b24..adb0aa5450a679aa8943642271e7a257f52e376d 100644 |
| --- a/samplecode/SampleFilterFuzz.cpp |
| +++ b/samplecode/SampleFilterFuzz.cpp |
| @@ -27,6 +27,7 @@ |
| #include "SkOffsetImageFilter.h" |
| #include "SkPerlinNoiseShader.h" |
| #include "SkPictureImageFilter.h" |
| +#include "SkPictureRecorder.h" |
| #include "SkRandom.h" |
| #include "SkRectShaderImageFilter.h" |
| #include "SkTestImageFilters.h" |
| @@ -206,7 +207,6 @@ static const SkBitmap& make_bitmap() { |
| return bitmap[R(2)]; |
| } |
| -#ifdef SK_ALLOW_PICTUREIMAGEFILTER_SERIALIZATION |
| static void drawSomething(SkCanvas* canvas) { |
| SkPaint paint; |
| @@ -228,7 +228,6 @@ static void drawSomething(SkCanvas* canvas) { |
| paint.setTextSize(SkIntToScalar(kBitmapSize/3)); |
| canvas->drawText("Picture", 7, SkIntToScalar(kBitmapSize/2), SkIntToScalar(kBitmapSize/4), paint); |
| } |
| -#endif |
| static SkImageFilter* make_image_filter(bool canBeNull = true) { |
| SkImageFilter* filter = 0; |
| @@ -377,12 +376,14 @@ static SkImageFilter* make_image_filter(bool canBeNull = true) { |
| case PICTURE: |
| { |
| SkPicture* pict = NULL; |
| -#ifdef SK_ALLOW_PICTUREIMAGEFILTER_SERIALIZATION |
| pict = new SkPicture; |
| SkAutoUnref aur(pict); |
| - drawSomething(pict->beginRecording(kBitmapSize, kBitmapSize)); |
| - pict->endRecording(); |
| -#endif |
| + |
| + SkRTreeFactory factory; |
| + SkPictureRecorder recorder; |
| + SkCanvas* recordingCanvas = recorder.beginRecording(kBitmapSize, kBitmapSize, &factory, 0); |
| + drawSomething(recordingCanvas); |
| + recorder.endRecording(); |
|
sugoi
2014/05/30 20:24:45
missing "pict = " ?
|
| filter = SkPictureImageFilter::Create(pict, make_rect()); |
| } |
| break; |