Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Unified Diff: src/core/SkTileGrid.h

Issue 452233002: Make BBH::search() const. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: More const for tile() Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkRTree.cpp ('k') | src/core/SkTileGrid.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkTileGrid.h
diff --git a/src/core/SkTileGrid.h b/src/core/SkTileGrid.h
index 0ec5c2c3932187472d4f284f441b6c8c017d04d1..ea473fb6d0cf85aba67cf0567027a6a8ee5fc82d 100644
--- a/src/core/SkTileGrid.h
+++ b/src/core/SkTileGrid.h
@@ -33,7 +33,9 @@ public:
kStackAllocationTileCount = 1024
};
- typedef void* (*SkTileGridNextDatumFunctionPtr)(SkTDArray<void*>** tileData, SkAutoSTArray<kStackAllocationTileCount, int>& tileIndices);
+ typedef void* (*SkTileGridNextDatumFunctionPtr)(
+ const SkTDArray<void*>** tileData,
+ SkAutoSTArray<kStackAllocationTileCount, int>& tileIndices);
SkTileGrid(int xTileCount, int yTileCount, const SkTileGridFactory::TileGridInfo& info,
SkTileGridNextDatumFunctionPtr nextDatumFunction);
@@ -54,7 +56,7 @@ public:
* Populate 'results' with data pointers corresponding to bounding boxes that intersect 'query'
* The query argument is expected to be an exact match to a tile of the grid
*/
- virtual void search(const SkIRect& query, SkTDArray<void*>* results) SK_OVERRIDE;
+ virtual void search(const SkIRect& query, SkTDArray<void*>* results) const SK_OVERRIDE;
virtual void clear() SK_OVERRIDE;
@@ -75,6 +77,7 @@ public:
int tileCount(int x, int y); // For testing only.
private:
+ const SkTDArray<void*>& tile(int x, int y) const;
SkTDArray<void*>& tile(int x, int y);
int fXTileCount, fYTileCount, fTileCount;
@@ -103,7 +106,8 @@ private:
* such that 'a < b' is true if 'a' was inserted into the tile grid before 'b'.
*/
template <typename T>
-void* SkTileGridNextDatum(SkTDArray<void*>** tileData, SkAutoSTArray<SkTileGrid::kStackAllocationTileCount, int>& tileIndices) {
+void* SkTileGridNextDatum(const SkTDArray<void*>** tileData,
+ SkAutoSTArray<SkTileGrid::kStackAllocationTileCount, int>& tileIndices) {
T* minVal = NULL;
int tileCount = tileIndices.count();
int minIndex = tileCount;
« no previous file with comments | « src/core/SkRTree.cpp ('k') | src/core/SkTileGrid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698