Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Unified Diff: include/core/SkTileGridPicture.h

Issue 238273012: Staged removal of SkPicture-derived classes (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: have SkPicture only friend SkPictureRecorder once Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkRTreePicture.h ('k') | samplecode/SampleAll.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkTileGridPicture.h
===================================================================
--- include/core/SkTileGridPicture.h (revision 14237)
+++ include/core/SkTileGridPicture.h (working copy)
@@ -12,13 +12,7 @@
#include "SkPoint.h"
#include "SkSize.h"
-/**
- * Subclass of SkPicture that creates an SkTileGrid. The tile grid has lower recording
- * and playback costs then rTree, but is less effective at eliminating extraneous
- * primitives for arbitrary query rectangles. It is most effective for
- * tiled playback when the tile structure is known at record time.
- */
-class SK_API SkTileGridPicture : public SkPicture {
+class SkTileGridFactory : public SkBBHFactory {
public:
struct TileGridInfo {
/** Tile placement interval */
@@ -36,36 +30,60 @@
*/
SkIPoint fOffset;
};
+
+ SkTileGridFactory(const TileGridInfo& info) : fInfo(info) { }
+
+ virtual SkBBoxHierarchy* operator()(int width, int height) const SK_OVERRIDE;
+
+private:
+ TileGridInfo fInfo;
+
+ typedef SkBBHFactory INHERITED;
+};
+
+#ifdef SK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES
+
+/**
+ * Subclass of SkPicture that creates an SkTileGrid. The tile grid has lower recording
+ * and playback costs then rTree, but is less effective at eliminating extraneous
+ * primitives for arbitrary query rectangles. It is most effective for
+ * tiled playback when the tile structure is known at record time.
+ */
+class SK_API SkTileGridPicture : public SkPicture {
+public:
+ typedef SkTileGridFactory::TileGridInfo TileGridInfo;
+
/**
* Constructor
* @param width recording canvas width in device pixels
* @param height recording canvas height in device pixels
* @param info description of the tiling layout
*/
- SkTileGridPicture(int width, int height, const TileGridInfo& info);
+ SkTileGridPicture(int width, int height, const SkTileGridFactory::TileGridInfo& info);
virtual SkBBoxHierarchy* createBBoxHierarchy() const SK_OVERRIDE;
private:
int fXTileCount, fYTileCount;
- TileGridInfo fInfo;
+ SkTileGridFactory::TileGridInfo fInfo;
typedef SkPicture INHERITED;
};
class SkTileGridPictureFactory : public SkPictureFactory {
public:
- SkTileGridPictureFactory(const SkTileGridPicture::TileGridInfo& info) : fInfo(info) { }
+ SkTileGridPictureFactory(const SkTileGridFactory::TileGridInfo& info) : fInfo(info) { }
virtual SkPicture* create(int width, int height) SK_OVERRIDE {
return SkNEW_ARGS(SkTileGridPicture, (width, height, fInfo));
}
protected:
- SkTileGridPicture::TileGridInfo fInfo;
+ SkTileGridFactory::TileGridInfo fInfo;
private:
typedef SkPictureFactory INHERITED;
};
+#endif
#endif
« no previous file with comments | « include/core/SkRTreePicture.h ('k') | samplecode/SampleAll.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698