aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkRTreePicture.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/core/SkRTreePicture.h')
-rw-r--r--include/core/SkRTreePicture.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/include/core/SkRTreePicture.h b/include/core/SkRTreePicture.h
new file mode 100644
index 0000000000..d691111019
--- /dev/null
+++ b/include/core/SkRTreePicture.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkRTreePicture_DEFINED
+#define SkRTreePicture_DEFINED
+
+#include "SkPicture.h"
+
+/**
+ * Subclass of SkPicture that creates an RTree acceleration structure.
+ */
+class SkRTreePicture : public SkPicture {
+public:
+ virtual SkBBoxHierarchy* createBBoxHierarchy() const SK_OVERRIDE;
+
+private:
+ typedef SkPicture INHERITED;
+};
+
+class SkRTreePictureFactory : public SkPictureFactory {
+public:
+ SkRTreePictureFactory() {}
+
+ virtual SkPicture* create(int width, int height) SK_OVERRIDE {
+ return SkNEW(SkRTreePicture);
+ }
+
+private:
+ typedef SkPictureFactory INHERITED;
+};
+
+#endif