| 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 SkBBHFactory_DEFINED | 8 #ifndef SkBBHFactory_DEFINED |
| 9 #define SkBBHFactory_DEFINED | 9 #define SkBBHFactory_DEFINED |
| 10 | 10 |
| 11 #include "SkSize.h" | 11 #include "SkSize.h" |
| 12 #include "SkRect.h" | 12 #include "SkRect.h" |
| 13 | 13 |
| 14 class SkBBoxHierarchy; | 14 class SkBBoxHierarchy; |
| 15 | 15 |
| 16 class SK_API SkBBHFactory { | 16 class SK_API SkBBHFactory { |
| 17 public: | 17 public: |
| 18 /** | 18 /** |
| 19 * Allocate a new SkBBoxHierarchy. Return NULL on failure. | 19 * Allocate a new SkBBoxHierarchy. Return NULL on failure. |
| 20 */ | 20 */ |
| 21 virtual SkBBoxHierarchy* operator()(const SkRect& bounds) const = 0; | 21 virtual SkBBoxHierarchy* operator()(const SkRect& bounds) const = 0; |
| 22 virtual ~SkBBHFactory() {}; | 22 virtual ~SkBBHFactory() {}; |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 class SK_API SkRTreeFactory : public SkBBHFactory { | 25 class SK_API SkRTreeFactory : public SkBBHFactory { |
| 26 public: | 26 public: |
| 27 virtual SkBBoxHierarchy* operator()(const SkRect& bounds) const SK_OVERRIDE; | 27 SkBBoxHierarchy* operator()(const SkRect& bounds) const SK_OVERRIDE; |
| 28 private: | 28 private: |
| 29 typedef SkBBHFactory INHERITED; | 29 typedef SkBBHFactory INHERITED; |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 // TODO(mtklein): delete entirely when Chromium's clean for TileGridInfo | 32 // TODO(mtklein): delete entirely when Chromium's clean for TileGridInfo |
| 33 class SK_API SkTileGridFactory { | 33 class SK_API SkTileGridFactory { |
| 34 public: | 34 public: |
| 35 struct TileGridInfo { | 35 struct TileGridInfo { |
| 36 /** Tile placement interval */ | 36 /** Tile placement interval */ |
| 37 SkISize fTileInterval; | 37 SkISize fTileInterval; |
| 38 | 38 |
| 39 /** Pixel coverage overlap between adjacent tiles */ | 39 /** Pixel coverage overlap between adjacent tiles */ |
| 40 SkISize fMargin; | 40 SkISize fMargin; |
| 41 | 41 |
| 42 /** Offset added to device-space bounding box positions to convert | 42 /** Offset added to device-space bounding box positions to convert |
| 43 * them to tile-grid space. This can be used to adjust the "phase" | 43 * them to tile-grid space. This can be used to adjust the "phase" |
| 44 * of the tile grid to match probable query rectangles that will be | 44 * of the tile grid to match probable query rectangles that will be |
| 45 * used to search into the tile grid. As long as the offset is smaller | 45 * used to search into the tile grid. As long as the offset is smaller |
| 46 * or equal to the margin, there is no need to extend the domain of | 46 * or equal to the margin, there is no need to extend the domain of |
| 47 * the tile grid to prevent data loss. | 47 * the tile grid to prevent data loss. |
| 48 */ | 48 */ |
| 49 SkIPoint fOffset; | 49 SkIPoint fOffset; |
| 50 }; | 50 }; |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 #endif | 53 #endif |
| OLD | NEW |