OLD | NEW |
---|---|
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #ifndef SkTileGrid_DEFINED | 9 #ifndef SkTileGrid_DEFINED |
10 #define SkTileGrid_DEFINED | 10 #define SkTileGrid_DEFINED |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 * @param defer Ignored, TileArray does not defer insertions | 47 * @param defer Ignored, TileArray does not defer insertions |
48 */ | 48 */ |
49 virtual void insert(void* data, const SkIRect& bounds, bool) SK_OVERRIDE; | 49 virtual void insert(void* data, const SkIRect& bounds, bool) SK_OVERRIDE; |
50 | 50 |
51 virtual void flushDeferredInserts() SK_OVERRIDE {}; | 51 virtual void flushDeferredInserts() SK_OVERRIDE {}; |
52 | 52 |
53 /** | 53 /** |
54 * Populate 'results' with data pointers corresponding to bounding boxes tha t intersect 'query' | 54 * Populate 'results' with data pointers corresponding to bounding boxes tha t intersect 'query' |
55 * The query argument is expected to be an exact match to a tile of the grid | 55 * The query argument is expected to be an exact match to a tile of the grid |
56 */ | 56 */ |
57 virtual void search(const SkIRect& query, SkTDArray<void*>* results) SK_OVER RIDE; | 57 virtual void search(const SkIRect& query, SkTDArray<void*>* results) const S K_OVERRIDE; |
58 | 58 |
59 virtual void clear() SK_OVERRIDE; | 59 virtual void clear() SK_OVERRIDE; |
60 | 60 |
61 /** | 61 /** |
62 * Gets the number of insertions | 62 * Gets the number of insertions |
63 */ | 63 */ |
64 virtual int getCount() const SK_OVERRIDE; | 64 virtual int getCount() const SK_OVERRIDE; |
65 | 65 |
66 virtual int getDepth() const SK_OVERRIDE { return -1; } | 66 virtual int getDepth() const SK_OVERRIDE { return -1; } |
67 | 67 |
68 virtual void rewindInserts() SK_OVERRIDE; | 68 virtual void rewindInserts() SK_OVERRIDE; |
69 | 69 |
70 // Used by search() and in SkTileGridHelper implementations | 70 // Used by search() and in SkTileGridHelper implementations |
71 enum { | 71 enum { |
72 kTileFinished = -1, | 72 kTileFinished = -1, |
73 }; | 73 }; |
74 | 74 |
75 int tileCount(int x, int y); // For testing only. | 75 int tileCount(int x, int y); // For testing only. |
76 | 76 |
77 private: | 77 private: |
robertphillips
2014/08/08 18:24:23
can this return "const SkTDArray<void>&" ?
mtklein
2014/08/08 18:38:50
Looks like yes, though it's a little more involved
| |
78 SkTDArray<void*>& tile(int x, int y); | 78 SkTDArray<void*>& tile(int x, int y) const; |
79 | 79 |
80 int fXTileCount, fYTileCount, fTileCount; | 80 int fXTileCount, fYTileCount, fTileCount; |
81 SkTileGridFactory::TileGridInfo fInfo; | 81 SkTileGridFactory::TileGridInfo fInfo; |
82 SkTDArray<void*>* fTileData; | 82 SkTDArray<void*>* fTileData; |
83 int fInsertionCount; | 83 int fInsertionCount; |
84 SkIRect fGridBounds; | 84 SkIRect fGridBounds; |
85 SkTileGridNextDatumFunctionPtr fNextDatumFunction; | 85 SkTileGridNextDatumFunctionPtr fNextDatumFunction; |
86 | 86 |
87 typedef SkBBoxHierarchy INHERITED; | 87 typedef SkBBoxHierarchy INHERITED; |
88 }; | 88 }; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
133 tileIndices[tile] = SkTileGrid::kTileFinished; | 133 tileIndices[tile] = SkTileGrid::kTileFinished; |
134 } | 134 } |
135 } | 135 } |
136 } | 136 } |
137 return minVal; | 137 return minVal; |
138 } | 138 } |
139 return NULL; | 139 return NULL; |
140 } | 140 } |
141 | 141 |
142 #endif | 142 #endif |
OLD | NEW |