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

Unified Diff: src/core/SkBBoxHierarchy.h

Issue 617393004: BBHs: void* data -> unsigned data (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: The rest 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 | « gyp/tests.gypi ('k') | src/core/SkRTree.h » ('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 fd9680c6aaa91431003f11730dff10b1abe9b45b..53eabc8b884d3199597fafe65059bb25075f05d7 100644
--- a/src/core/SkBBoxHierarchy.h
+++ b/src/core/SkBBoxHierarchy.h
@@ -14,42 +14,25 @@
#include "SkRefCnt.h"
/**
- * Interface for a client class that implements utility methods needed
- * by SkBBoxHierarchy that require intrinsic knowledge of the data
- * object type that is stored in the bounding box hierarchy.
- */
-class SkBBoxHierarchyClient {
-public:
- virtual ~SkBBoxHierarchyClient() {}
-
- /**
- * Implements a rewind stop condition used by rewindInserts
- * Must returns true if 'data' points to an object that should be re-wound
- * by rewinfInserts.
- */
- virtual bool shouldRewind(void* data) = 0;
-};
-
-/**
- * Interface for a spatial data structure that associates user data pointers with axis-aligned
+ * Interface for a spatial data structure that associates user data with axis-aligned
* bounding boxes, and allows efficient retrieval of intersections with query rectangles.
*/
class SkBBoxHierarchy : public SkRefCnt {
public:
SK_DECLARE_INST_COUNT(SkBBoxHierarchy)
- SkBBoxHierarchy() : fClient(NULL) {}
+ SkBBoxHierarchy() {}
/**
- * Insert a data pointer and corresponding bounding box
- * @param data The data pointer, may be NULL
+ * 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 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
* search.
*/
- virtual void insert(void* data, const SkRect& bounds, bool defer = false) = 0;
+ virtual void insert(unsigned opIndex, const SkRect& bounds, bool defer = false) = 0;
/**
* If any insertions have been deferred, this forces them to be inserted
@@ -57,9 +40,9 @@ public:
virtual void flushDeferredInserts() = 0;
/**
- * Populate 'results' with data pointers corresponding to bounding boxes that intersect 'query'
+ * Populate results with sorted opIndex corresponding to bounding boxes that intersect query.
*/
- virtual void search(const SkRect& query, SkTDArray<void*>* results) const = 0;
+ virtual void search(const SkRect& query, SkTDArray<unsigned>* results) const = 0;
virtual void clear() = 0;
@@ -78,19 +61,6 @@ public:
*/
virtual int getDepth() const = 0;
- /**
- * Rewinds all the most recently inserted data elements until an element
- * is encountered for which client->shouldRewind(data) returns false. May
- * not rewind elements that were inserted prior to the last call to
- * flushDeferredInserts.
- */
- virtual void rewindInserts() = 0;
-
- void setClient(SkBBoxHierarchyClient* client) { fClient = client; }
-
-protected:
- SkBBoxHierarchyClient* fClient;
-
private:
typedef SkRefCnt INHERITED;
};
« no previous file with comments | « gyp/tests.gypi ('k') | src/core/SkRTree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698