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
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index defb2e9..81abd8b 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 @@
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 @@
{
// 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 @@
// 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);