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

Unified Diff: src/core/SkRTree.h

Issue 23480002: R-Tree -- Don't sort draw commands unless specified. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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/SkPicture.cpp ('k') | src/core/SkRTree.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/core/SkPicture.cpp ('k') | src/core/SkRTree.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698