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 SkQuadTreePicture_DEFINED | 8 #ifndef SkQuadTreePicture_DEFINED |
9 #define SkQuadTreePicture_DEFINED | 9 #define SkQuadTreePicture_DEFINED |
10 | 10 |
11 #include "SkPicture.h" | 11 #include "SkPicture.h" |
| 12 |
| 13 class SkQuadTreeFactory : 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 |
12 #include "SkRect.h" | 22 #include "SkRect.h" |
13 | 23 |
14 /** | 24 /** |
15 * Subclass of SkPicture that creates an SkQuadGrid | 25 * Subclass of SkPicture that creates an SkQuadGrid |
16 * structure. The quad tree has generally faster | 26 * structure. The quad tree has generally faster |
17 * tree creation time, but slightly slower query times, as compared to | 27 * tree creation time, but slightly slower query times, as compared to |
18 * R-Tree, so some cases may be faster and some cases slower. | 28 * R-Tree, so some cases may be faster and some cases slower. |
19 */ | 29 */ |
20 class SK_API SkQuadTreePicture : public SkPicture { | 30 class SK_API SkQuadTreePicture : public SkPicture { |
21 public: | 31 public: |
(...skipping 11 matching lines...) Expand all Loading... |
33 | 43 |
34 virtual SkPicture* create(int width, int height) SK_OVERRIDE { | 44 virtual SkPicture* create(int width, int height) SK_OVERRIDE { |
35 return SkNEW_ARGS(SkQuadTreePicture, (SkIRect::MakeWH(width, height))); | 45 return SkNEW_ARGS(SkQuadTreePicture, (SkIRect::MakeWH(width, height))); |
36 } | 46 } |
37 | 47 |
38 private: | 48 private: |
39 typedef SkPictureFactory INHERITED; | 49 typedef SkPictureFactory INHERITED; |
40 }; | 50 }; |
41 | 51 |
42 #endif | 52 #endif |
| 53 |
| 54 #endif |
OLD | NEW |