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/tools/PictureRenderer.cpp b/tools/PictureRenderer.cpp
index 59e4948..b669e15 100644
--- a/tools/PictureRenderer.cpp
+++ b/tools/PictureRenderer.cpp
@@ -28,7 +28,7 @@
#include "SkPixelRef.h"
#include "SkQuadTree.h"
#include "SkQuadTreePicture.h"
-#include "SkRTree.h"
+#include "SkRTreePicture.h"
#include "SkScalar.h"
#include "SkStream.h"
#include "SkString.h"
@@ -319,9 +319,9 @@
}
uint32_t PictureRenderer::recordFlags() {
- return ((kNone_BBoxHierarchyType == fBBoxHierarchyType) ? 0 :
- SkPicture::kOptimizeForClippedPlayback_RecordingFlag) |
- SkPicture::kUsePathBoundsForClip_RecordingFlag;
+ return (kNone_BBoxHierarchyType == fBBoxHierarchyType)
+ ? 0
+ : SkPicture::kUsePathBoundsForClip_RecordingFlag;
}
/**
@@ -975,29 +975,6 @@
///////////////////////////////////////////////////////////////////////////////////////////////
// SkPicture variants for each BBoxHierarchy type
-class RTreePicture : public SkPicture {
-public:
- virtual SkBBoxHierarchy* createBBoxHierarchy() const SK_OVERRIDE {
- static const int kRTreeMinChildren = 6;
- static const int kRTreeMaxChildren = 11;
- SkScalar aspectRatio = SkScalarDiv(SkIntToScalar(fWidth),
- SkIntToScalar(fHeight));
- bool sortDraws = false;
- return SkRTree::Create(kRTreeMinChildren, kRTreeMaxChildren,
- aspectRatio, sortDraws);
- }
-};
-
-class SkRTreePictureFactory : public SkPictureFactory {
-private:
- virtual SkPicture* create(int width, int height) SK_OVERRIDE {
- return SkNEW(RTreePicture);
- }
-
-private:
- typedef SkPictureFactory INHERITED;
-};
-
SkPictureFactory* PictureRenderer::getFactory() {
switch (fBBoxHierarchyType) {
case kNone_BBoxHierarchyType: