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

Unified Diff: src/core/SkTileGrid.h

Issue 463593003: More SkTileGrid refactoring. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: formatting 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 | « no previous file | 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 163efa5571c813f5a4c10c3b897dfaa8daa4cb34..c02235a12327aa6911a24f353f465a41abb7d22a 100644
--- a/src/core/SkTileGrid.h
+++ b/src/core/SkTileGrid.h
@@ -25,31 +25,23 @@
*/
class SkTileGrid : public SkBBoxHierarchy {
public:
- enum {
- // Number of tiles for which data is allocated on the stack in
- // SkTileGrid::search. If malloc becomes a bottleneck, we may consider
- // increasing this number. Typical large web page, say 2k x 16k, would
- // require 512 tiles of size 256 x 256 pixels.
- kStackAllocationTileCount = 1024
- };
-
SkTileGrid(int xTileCount, int yTileCount, const SkTileGridFactory::TileGridInfo& info);
virtual ~SkTileGrid();
/**
* Insert a data pointer and corresponding bounding box
- * @param data The data pointer, may be NULL
- * @param bounds The bounding box, should not be empty
- * @param defer Ignored, TileArray does not defer insertions
+ * @param data The data pointer, may _NOT_ be NULL.
+ * @param bounds The bounding box, should not be empty.
+ * @param defer Ignored; SkTileGrid does not defer insertions.
*/
virtual void insert(void* data, const SkIRect& bounds, bool) SK_OVERRIDE;
virtual void flushDeferredInserts() SK_OVERRIDE {};
/**
- * 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
+ * Populate 'results' with data pointers corresponding to bounding boxes that intersect 'query'.
+ * This will be fastest if the query is an exact match to a single grid tile.
*/
virtual void search(const SkIRect& query, SkTDArray<void*>* results) const SK_OVERRIDE;
@@ -64,11 +56,6 @@ public:
virtual void rewindInserts() SK_OVERRIDE;
- // Used by search() and in SkTileGridHelper implementations
- enum {
- kTileFinished = -1,
- };
-
int tileCount(int x, int y); // For testing only.
private:
« no previous file with comments | « no previous file | src/core/SkTileGrid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698