From d393b17cf3427bd6f6255f8670067d9aa529e409 Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Wed, 16 Apr 2014 16:02:10 +0000 Subject: Retract SkPicture::kOptimizeForClippedPlayback_RecordingFlag from public API This CL sets the stage for retracting the SkPicture::kOptimizeForClippedPlayback_RecordingFlag flag from the public API (more work needs to be done in Blink & Chrome). In the new world the only way to set this flag (and thus instantiate an SkPicture-derived class) is by passing a factory to the SkPictureRecorder class. This is to get all clients always using factories so that we can then change the factory call used (i.e., so the factory just creates a BBH) and do away with the SkPicture-derived classes. BUG=skia:2315 R=reed@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/239703006 git-svn-id: http://skia.googlecode.com/svn/trunk@14221 2bbb7eff-a529-9590-31e7-b0007b416f81 --- tests/ImageFilterTest.cpp | 7 ++++--- tests/PictureTest.cpp | 10 ++++++---- tests/TileGridTest.cpp | 4 ++-- 3 files changed, 12 insertions(+), 9 deletions(-) (limited to 'tests') diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp index acc9bd517f..cfa7c6f79d 100644 --- a/tests/ImageFilterTest.cpp +++ b/tests/ImageFilterTest.cpp @@ -24,6 +24,7 @@ #include "SkMorphologyImageFilter.h" #include "SkOffsetImageFilter.h" #include "SkPicture.h" +#include "SkRTreePicture.h" #include "SkRect.h" #include "SkTileImageFilter.h" #include "SkXfermodeImageFilter.h" @@ -276,9 +277,9 @@ DEF_TEST(ImageFilterMatrixTest, reporter) { SkMatrix expectedMatrix = canvas.getTotalMatrix(); - SkPictureRecorder recorder; - SkCanvas* recordingCanvas = recorder.beginRecording(100, 100, - SkPicture::kOptimizeForClippedPlayback_RecordingFlag); + SkAutoTUnref factory(SkNEW(SkRTreePictureFactory)); + SkPictureRecorder recorder(factory); + SkCanvas* recordingCanvas = recorder.beginRecording(100, 100); SkPaint paint; SkAutoTUnref imageFilter( diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp index defb2e93ed..81abd8b661 100644 --- a/tests/PictureTest.cpp +++ b/tests/PictureTest.cpp @@ -19,6 +19,7 @@ #include "SkQuadTreePicture.h" #include "SkRRect.h" #include "SkRandom.h" +#include "SkRTreePicture.h" #include "SkShader.h" #include "SkStream.h" #include "SkTileGrid.h" @@ -917,7 +918,7 @@ static void test_draw_empty(skiatest::Reporter* reporter) { SkAutoTUnref factory(SkNEW_ARGS(SkTileGridPictureFactory, (gridInfo))); SkPictureRecorder recorder(factory); - recorder.beginRecording(1, 1, SkPicture::kOptimizeForClippedPlayback_RecordingFlag); + recorder.beginRecording(1, 1); SkAutoTUnref picture(recorder.endRecording()); canvas.drawPicture(*picture); @@ -925,8 +926,9 @@ static void test_draw_empty(skiatest::Reporter* reporter) { { // RTree - SkPictureRecorder recorder; - recorder.beginRecording(1, 1, SkPicture::kOptimizeForClippedPlayback_RecordingFlag); + SkAutoTUnref factory(SkNEW(SkRTreePictureFactory)); + SkPictureRecorder recorder(factory); + recorder.beginRecording(1, 1); SkAutoTUnref picture(recorder.endRecording()); canvas.drawPicture(*picture); @@ -936,7 +938,7 @@ static void test_draw_empty(skiatest::Reporter* reporter) { // quad tree SkAutoTUnref factory(SkNEW(SkQuadTreePictureFactory)); SkPictureRecorder recorder(factory); - recorder.beginRecording(1, 1, SkPicture::kOptimizeForClippedPlayback_RecordingFlag); + recorder.beginRecording(1, 1); SkAutoTUnref picture(recorder.endRecording()); canvas.drawPicture(*picture); diff --git a/tests/TileGridTest.cpp b/tests/TileGridTest.cpp index 25425fa5bb..9b5bdebe54 100644 --- a/tests/TileGridTest.cpp +++ b/tests/TileGridTest.cpp @@ -62,7 +62,7 @@ DEF_TEST(TileGrid_UnalignedQuery, reporter) { SkIntToScalar(1), SkIntToScalar(1)); SkAutoTUnref factory(SkNEW_ARGS(SkTileGridPictureFactory, (info))); SkPictureRecorder recorder(factory); - SkCanvas* canvas = recorder.beginRecording(20, 20, SkPicture::kOptimizeForClippedPlayback_RecordingFlag); + SkCanvas* canvas = recorder.beginRecording(20, 20); SkPaint paint; canvas->drawRect(rect1, paint); canvas->drawRect(rect2, paint); @@ -151,7 +151,7 @@ DEF_TEST(TileGrid_OverlapOffsetQueryAlignment, reporter) { SkIntToScalar(1), SkIntToScalar(1)); SkAutoTUnref factory(SkNEW_ARGS(SkTileGridPictureFactory, (info))); SkPictureRecorder recorder(factory); - SkCanvas* canvas = recorder.beginRecording(20, 20, SkPicture::kOptimizeForClippedPlayback_RecordingFlag); + SkCanvas* canvas = recorder.beginRecording(20, 20); SkPaint paint; canvas->drawRect(rect1, paint); canvas->drawRect(rect2, paint); -- cgit v1.2.3