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

Side by Side Diff: src/core/SkRTree.h

Issue 971803002: Update SkPicture cull rects with RTree information (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix extra line Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « src/core/SkPictureRecorder.cpp ('k') | src/core/SkRTree.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #ifndef SkRTree_DEFINED 9 #ifndef SkRTree_DEFINED
10 #define SkRTree_DEFINED 10 #define SkRTree_DEFINED
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 void search(const SkRect& query, SkTDArray<unsigned>* results) const SK_OVER RIDE; 45 void search(const SkRect& query, SkTDArray<unsigned>* results) const SK_OVER RIDE;
46 size_t bytesUsed() const SK_OVERRIDE; 46 size_t bytesUsed() const SK_OVERRIDE;
47 47
48 // Methods and constants below here are only public for tests. 48 // Methods and constants below here are only public for tests.
49 49
50 // Return the depth of the tree structure. 50 // Return the depth of the tree structure.
51 int getDepth() const { return fCount ? fRoot.fSubtree->fLevel + 1 : 0; } 51 int getDepth() const { return fCount ? fRoot.fSubtree->fLevel + 1 : 0; }
52 // Insertion count (not overall node count, which may be greater). 52 // Insertion count (not overall node count, which may be greater).
53 int getCount() const { return fCount; } 53 int getCount() const { return fCount; }
54 54
55 // Get the root bound.
56 SkRect getRootBound() const SK_OVERRIDE;
57
55 // These values were empirically determined to produce reasonable performanc e in most cases. 58 // These values were empirically determined to produce reasonable performanc e in most cases.
56 static const int kMinChildren = 6, 59 static const int kMinChildren = 6,
57 kMaxChildren = 11; 60 kMaxChildren = 11;
58 61
59 private: 62 private:
60 struct Node; 63 struct Node;
61 64
62 struct Branch { 65 struct Branch {
63 union { 66 union {
64 Node* fSubtree; 67 Node* fSubtree;
(...skipping 21 matching lines...) Expand all
86 // This is the count of data elements (rather than total nodes in the tree) 89 // This is the count of data elements (rather than total nodes in the tree)
87 int fCount; 90 int fCount;
88 SkScalar fAspectRatio; 91 SkScalar fAspectRatio;
89 Branch fRoot; 92 Branch fRoot;
90 SkTDArray<Node> fNodes; 93 SkTDArray<Node> fNodes;
91 94
92 typedef SkBBoxHierarchy INHERITED; 95 typedef SkBBoxHierarchy INHERITED;
93 }; 96 };
94 97
95 #endif 98 #endif
OLDNEW
« no previous file with comments | « src/core/SkPictureRecorder.cpp ('k') | src/core/SkRTree.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698