OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkRTreePicture_DEFINED | 8 #ifndef SkRTreePicture_DEFINED |
9 #define SkRTreePicture_DEFINED | 9 #define SkRTreePicture_DEFINED |
10 | 10 |
11 #include "SkPicture.h" | 11 #include "SkPicture.h" |
12 | 12 |
| 13 class SkRTreeFactory : public SkBBHFactory { |
| 14 public: |
| 15 virtual SkBBoxHierarchy* operator()(int width, int height) const SK_OVERRIDE
; |
| 16 private: |
| 17 typedef SkBBHFactory INHERITED; |
| 18 }; |
| 19 |
| 20 #ifdef SK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES |
13 /** | 21 /** |
14 * Subclass of SkPicture that creates an RTree acceleration structure. | 22 * Subclass of SkPicture that creates an RTree acceleration structure. |
15 */ | 23 */ |
16 class SkRTreePicture : public SkPicture { | 24 class SkRTreePicture : public SkPicture { |
17 public: | 25 public: |
18 virtual SkBBoxHierarchy* createBBoxHierarchy() const SK_OVERRIDE; | 26 virtual SkBBoxHierarchy* createBBoxHierarchy() const SK_OVERRIDE; |
19 | 27 |
20 private: | 28 private: |
21 typedef SkPicture INHERITED; | 29 typedef SkPicture INHERITED; |
22 }; | 30 }; |
23 | 31 |
24 class SkRTreePictureFactory : public SkPictureFactory { | 32 class SkRTreePictureFactory : public SkPictureFactory { |
25 public: | 33 public: |
26 SkRTreePictureFactory() {} | 34 SkRTreePictureFactory() {} |
27 | 35 |
28 virtual SkPicture* create(int width, int height) SK_OVERRIDE { | 36 virtual SkPicture* create(int width, int height) SK_OVERRIDE { |
29 return SkNEW(SkRTreePicture); | 37 return SkNEW(SkRTreePicture); |
30 } | 38 } |
31 | 39 |
32 private: | 40 private: |
33 typedef SkPictureFactory INHERITED; | 41 typedef SkPictureFactory INHERITED; |
34 }; | 42 }; |
| 43 #endif |
35 | 44 |
36 #endif | 45 #endif |
OLD | NEW |