X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2Fskia%2Fsrc%2Fcore%2FSkRTree.h;h=00c6c8941da9e64d366bae18912183204c60b6cf;hb=1afa4dd80ef85af7c90efaea6959db1d92330844;hp=8e980246aca2fe2fb1bbbc679825b2e3ec7e5185;hpb=90762837333c13ccf56f2ad88e4481fc71e8d281;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/skia/src/core/SkRTree.h b/src/third_party/skia/src/core/SkRTree.h index 8e98024..00c6c89 100644 --- a/src/third_party/skia/src/core/SkRTree.h +++ b/src/third_party/skia/src/core/SkRTree.h @@ -59,44 +59,17 @@ public: bool orderWhenBulkLoading = true); virtual ~SkRTree(); - /** - * Insert a node, consisting of bounds and a data value into the tree, if we don't immediately - * need to use the tree; we may allow the insert to be deferred (this can allow us to bulk-load - * a large batch of nodes at once, which tends to be faster and produce a better tree). - * @param data The data value - * @param bounds The corresponding bounding box - * @param defer Can this insert be deferred? (this may be ignored) - */ - virtual void insert(void* data, const SkRect& bounds, bool defer = false) SK_OVERRIDE; - - /** - * If any inserts have been deferred, this will add them into the tree - */ - virtual void flushDeferredInserts() SK_OVERRIDE; - - /** - * Given a query rectangle, populates the passed-in array with the elements it intersects - */ - virtual void search(const SkRect& query, SkTDArray* results) const SK_OVERRIDE; - - virtual void clear() SK_OVERRIDE; - bool isEmpty() const { return 0 == fCount; } - - /** - * Gets the depth of the tree structure - */ - virtual int getDepth() const SK_OVERRIDE { - return this->isEmpty() ? 0 : fRoot.fChild.subtree->fLevel + 1; - } - - /** - * This gets the insertion count (rather than the node count) - */ - virtual int getCount() const SK_OVERRIDE { return fCount; } + virtual void insert(SkAutoTMalloc* boundsArray, int N) SK_OVERRIDE; + virtual void search(const SkRect& query, SkTDArray* results) const SK_OVERRIDE; - virtual void rewindInserts() SK_OVERRIDE; + void clear(); + // Return the depth of the tree structure. + int getDepth() const { return this->isEmpty() ? 0 : fRoot.fChild.subtree->fLevel + 1; } + // Insertion count (not overall node count, which may be greater). + int getCount() const { return fCount; } private: + bool isEmpty() const { return 0 == this->getCount(); } struct Node; @@ -106,7 +79,7 @@ private: struct Branch { union { Node* subtree; - void* data; + unsigned opIndex; } fChild; SkIRect fBounds; }; @@ -162,7 +135,7 @@ private: int chooseSubtree(Node* root, Branch* branch); SkIRect computeBounds(Node* n); int distributeChildren(Branch* children); - void search(Node* root, const SkIRect query, SkTDArray* results) const; + void search(Node* root, const SkIRect query, SkTDArray* results) const; /** * This performs a bottom-up bulk load using the STR (sort-tile-recursive) algorithm, this @@ -189,7 +162,6 @@ private: Branch fRoot; SkChunkAlloc fNodes; - SkTDArray fDeferredInserts; SkScalar fAspectRatio; bool fSortWhenBulkLoading;