diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-04-16 16:02:10 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-04-16 16:02:10 +0000 |
commit | d393b17cf3427bd6f6255f8670067d9aa529e409 (patch) | |
tree | 3c534a8644f344121e6e56b3322ea7ebcf62d51c /tests | |
parent | 4453e8b45aaaaea568da35f8144177bdc8d2e171 (diff) |
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
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ImageFilterTest.cpp | 7 | ||||
-rw-r--r-- | tests/PictureTest.cpp | 10 | ||||
-rw-r--r-- | tests/TileGridTest.cpp | 4 |
3 files changed, 12 insertions, 9 deletions
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<SkPictureFactory> factory(SkNEW(SkRTreePictureFactory)); + SkPictureRecorder recorder(factory); + SkCanvas* recordingCanvas = recorder.beginRecording(100, 100); SkPaint paint; SkAutoTUnref<MatrixTestImageFilter> 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<SkPictureFactory> factory(SkNEW_ARGS(SkTileGridPictureFactory, (gridInfo))); SkPictureRecorder recorder(factory); - recorder.beginRecording(1, 1, SkPicture::kOptimizeForClippedPlayback_RecordingFlag); + recorder.beginRecording(1, 1); SkAutoTUnref<SkPicture> 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<SkPictureFactory> factory(SkNEW(SkRTreePictureFactory)); + SkPictureRecorder recorder(factory); + recorder.beginRecording(1, 1); SkAutoTUnref<SkPicture> picture(recorder.endRecording()); canvas.drawPicture(*picture); @@ -936,7 +938,7 @@ static void test_draw_empty(skiatest::Reporter* reporter) { // quad tree SkAutoTUnref<SkPictureFactory> factory(SkNEW(SkQuadTreePictureFactory)); SkPictureRecorder recorder(factory); - recorder.beginRecording(1, 1, SkPicture::kOptimizeForClippedPlayback_RecordingFlag); + recorder.beginRecording(1, 1); SkAutoTUnref<SkPicture> 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<SkPictureFactory> 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<SkPictureFactory> 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); |