OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright 2014 Google Inc. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license that can be | |
5 * found in the LICENSE file. | |
6 */ | |
7 | |
8 #ifndef SkQuadTreePicture_DEFINED | |
9 #define SkQuadTreePicture_DEFINED | |
10 | |
11 #ifdef SK_SUPPORT_LEGACY_PICTURE_HEADERS | |
12 #include "SkBBHFactory.h" | |
13 #endif | |
14 | |
15 #ifdef SK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES | |
16 | |
17 #include "SkPicture.h" | |
18 #include "SkRect.h" | |
19 | |
20 /** | |
21 * Subclass of SkPicture that creates an SkQuadGrid | |
22 * structure. The quad tree has generally faster | |
23 * tree creation time, but slightly slower query times, as compared to | |
24 * R-Tree, so some cases may be faster and some cases slower. | |
25 */ | |
26 class SK_API SkQuadTreePicture : public SkPicture { | |
27 public: | |
28 SkQuadTreePicture(const SkIRect& bounds) : fBounds(bounds) {} | |
29 virtual SkBBoxHierarchy* createBBoxHierarchy() const SK_OVERRIDE; | |
30 private: | |
31 SkIRect fBounds; | |
32 | |
33 typedef SkPicture INHERITED; | |
34 }; | |
35 | |
36 class SkQuadTreePictureFactory : public SkPictureFactory { | |
37 public: | |
38 SkQuadTreePictureFactory() {} | |
39 | |
40 virtual SkPicture* create(int width, int height) SK_OVERRIDE { | |
41 return SkNEW_ARGS(SkQuadTreePicture, (SkIRect::MakeWH(width, height))); | |
42 } | |
43 | |
44 private: | |
45 typedef SkPictureFactory INHERITED; | |
46 }; | |
47 | |
48 #endif | |
49 | |
50 #endif | |
OLD | NEW |