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

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

Issue 490253003: Implement SkPicture::bytesUsed() for SkRecord backend (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Unit test prevents bloat Created 6 years, 1 month 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
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 virtual void insert(SkAutoTMalloc<SkRect>* boundsArray, int N) SK_OVERRIDE; 62 virtual void insert(SkAutoTMalloc<SkRect>* boundsArray, int N) SK_OVERRIDE;
63 virtual void search(const SkRect& query, SkTDArray<unsigned>* results) const SK_OVERRIDE; 63 virtual void search(const SkRect& query, SkTDArray<unsigned>* results) const SK_OVERRIDE;
64 64
65 void clear(); 65 void clear();
66 // Return the depth of the tree structure. 66 // Return the depth of the tree structure.
67 int getDepth() const { return this->isEmpty() ? 0 : fRoot.fChild.subtree->fL evel + 1; } 67 int getDepth() const { return this->isEmpty() ? 0 : fRoot.fChild.subtree->fL evel + 1; }
68 // Insertion count (not overall node count, which may be greater). 68 // Insertion count (not overall node count, which may be greater).
69 int getCount() const { return fCount; } 69 int getCount() const { return fCount; }
70 70
71 virtual size_t bytesUsed() const SK_OVERRIDE;
72
71 private: 73 private:
72 bool isEmpty() const { return 0 == this->getCount(); } 74 bool isEmpty() const { return 0 == this->getCount(); }
73 75
74 struct Node; 76 struct Node;
75 77
76 /** 78 /**
77 * A branch of the tree, this may contain a pointer to another interior node , or a data value 79 * A branch of the tree, this may contain a pointer to another interior node , or a data value
78 */ 80 */
79 struct Branch { 81 struct Branch {
80 union { 82 union {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 SkChunkAlloc fNodes; 166 SkChunkAlloc fNodes;
165 SkScalar fAspectRatio; 167 SkScalar fAspectRatio;
166 bool fSortWhenBulkLoading; 168 bool fSortWhenBulkLoading;
167 169
168 Node* allocateNode(uint16_t level); 170 Node* allocateNode(uint16_t level);
169 171
170 typedef SkBBoxHierarchy INHERITED; 172 typedef SkBBoxHierarchy INHERITED;
171 }; 173 };
172 174
173 #endif 175 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698