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/samplecode/SamplePictFile.cpp b/samplecode/SamplePictFile.cpp
index ab45555..11bd1f0 100644
--- a/samplecode/SamplePictFile.cpp
+++ b/samplecode/SamplePictFile.cpp
@@ -18,6 +18,7 @@
#include "SkQuadTreePicture.h"
#include "SkRandom.h"
#include "SkRegion.h"
+#include "SkRTreePicture.h"
#include "SkShader.h"
#include "SkTileGridPicture.h"
#include "SkUtils.h"
@@ -166,6 +167,7 @@
// no bbox playback necessary
return pic.detach();
case kRTree_BBoxType:
+ factory.reset(SkNEW(SkRTreePictureFactory));
break;
case kQuadTree_BBoxType:
factory.reset(SkNEW(SkQuadTreePictureFactory));
@@ -184,8 +186,7 @@
}
SkPictureRecorder recorder(factory);
- pic->draw(recorder.beginRecording(pic->width(), pic->height(),
- SkPicture::kOptimizeForClippedPlayback_RecordingFlag));
+ pic->draw(recorder.beginRecording(pic->width(), pic->height()));
return recorder.endRecording();
}