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

Unified Diff: src/core/SkBBoxHierarchy.h

Issue 639933003: Add SkBBoxHierarchy::reserve() as an optional size hint. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 2 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/SkRecordDraw.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBBoxHierarchy.h
diff --git a/src/core/SkBBoxHierarchy.h b/src/core/SkBBoxHierarchy.h
index 3382ac154e25f5a26970bdabe031d7a82358183f..7246787de87e2b70339273429d63275fee712b97 100644
--- a/src/core/SkBBoxHierarchy.h
+++ b/src/core/SkBBoxHierarchy.h
@@ -24,9 +24,14 @@ public:
SkBBoxHierarchy() {}
/**
- * Insert opIndex and corresponding bounding box
+ * Hint that <= opCount calls to insert() will be made.
+ */
+ virtual void reserve(unsigned opCount) {}
+
+ /**
+ * Insert opIndex and corresponding bounding box.
* @param opIndex Any value, will be returned in order.
- * @param bounds The bounding box, should not be empty
+ * @param bounds The bounding box, should not be empty.
* @param defer Whether or not it is acceptable to delay insertion of this element (building up
* an entire spatial data structure at once is often faster and produces better
* structures than repeated inserts) until flushDeferredInserts is called or the first
@@ -35,9 +40,9 @@ public:
virtual void insert(unsigned opIndex, const SkRect& bounds, bool defer = false) = 0;
/**
- * If any insertions have been deferred, this forces them to be inserted
+ * If any insertions have been deferred, force them to be inserted.
*/
- virtual void flushDeferredInserts() = 0;
+ virtual void flushDeferredInserts() {}
/**
* Populate results with sorted opIndex corresponding to bounding boxes that intersect query.
« no previous file with comments | « no previous file | src/core/SkRecordDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698