Index: src/core/SkRTree.h |
diff --git a/src/core/SkRTree.h b/src/core/SkRTree.h |
index 2d11f28a5739a21c69da94c999db80562196ced9..74073be072562b22bf19c0782ff5184956461c5a 100644 |
--- a/src/core/SkRTree.h |
+++ b/src/core/SkRTree.h |
@@ -54,8 +54,13 @@ public: |
* If you have some prior information about the distribution of bounds you're expecting, you |
* can provide an optional aspect ratio parameter. This allows the bulk-load algorithm to create |
* better proportioned tiles of rectangles. |
+ * You can make the build loading algorithm avoid the sorting step by setting |
+ * orderWhenBulkLoading to false. It will have a small impact on playback performance for |
+ * inputs where consecutive boxes are close to each other. It will do much worse if the inputs |
+ * are positioned randomly. |
*/ |
- static SkRTree* Create(int minChildren, int maxChildren, SkScalar aspectRatio = 1); |
+ static SkRTree* Create(int minChildren, int maxChildren, SkScalar aspectRatio = 1, |
+ bool orderWhenBulkLoading = true); |
virtual ~SkRTree(); |
/** |
@@ -144,7 +149,7 @@ private: |
} |
}; |
- SkRTree(int minChildren, int maxChildren, SkScalar aspectRatio); |
+ SkRTree(int minChildren, int maxChildren, SkScalar aspectRatio, bool orderWhenBulkLoading); |
/** |
* Recursively descend the tree to find an insertion position for 'branch', updates |
@@ -184,6 +189,7 @@ private: |
SkChunkAlloc fNodes; |
SkTDArray<Branch> fDeferredInserts; |
SkScalar fAspectRatio; |
+ bool fSortWhenBulkLoading; |
Node* allocateNode(uint16_t level); |