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 #ifdef SK_SUPPORT_LEGACY_PICTURE_HEADERS |
| 12 #include "SkBBHFactory.h" |
| 13 #endif |
| 14 |
| 15 #ifdef SK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES |
| 16 |
11 #include "SkPicture.h" | 17 #include "SkPicture.h" |
12 | 18 |
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 | |
21 /** | 19 /** |
22 * Subclass of SkPicture that creates an RTree acceleration structure. | 20 * Subclass of SkPicture that creates an RTree acceleration structure. |
23 */ | 21 */ |
24 class SkRTreePicture : public SkPicture { | 22 class SkRTreePicture : public SkPicture { |
25 public: | 23 public: |
26 virtual SkBBoxHierarchy* createBBoxHierarchy() const SK_OVERRIDE; | 24 virtual SkBBoxHierarchy* createBBoxHierarchy() const SK_OVERRIDE; |
27 | 25 |
28 private: | 26 private: |
29 typedef SkPicture INHERITED; | 27 typedef SkPicture INHERITED; |
30 }; | 28 }; |
31 | 29 |
32 class SkRTreePictureFactory : public SkPictureFactory { | 30 class SkRTreePictureFactory : public SkPictureFactory { |
33 public: | 31 public: |
34 SkRTreePictureFactory() {} | 32 SkRTreePictureFactory() {} |
35 | 33 |
36 virtual SkPicture* create(int width, int height) SK_OVERRIDE { | 34 virtual SkPicture* create(int width, int height) SK_OVERRIDE { |
37 return SkNEW(SkRTreePicture); | 35 return SkNEW(SkRTreePicture); |
38 } | 36 } |
39 | 37 |
40 private: | 38 private: |
41 typedef SkPictureFactory INHERITED; | 39 typedef SkPictureFactory INHERITED; |
42 }; | 40 }; |
43 #endif | 41 #endif |
44 | 42 |
45 #endif | 43 #endif |
OLD | NEW |