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

Side by Side Diff: src/core/SkQuadTree.cpp

Issue 153893004: Added root deletion code to fix valgrind error (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Trying again Created 6 years, 10 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 | « no previous file | no next file » | 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 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkQuadTree.h" 8 #include "SkQuadTree.h"
9 #include "SkTSort.h" 9 #include "SkTSort.h"
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 return new SkQuadTree(bounds); 184 return new SkQuadTree(bounds);
185 } 185 }
186 186
187 SkQuadTree::SkQuadTree(const SkIRect& bounds) 187 SkQuadTree::SkQuadTree(const SkIRect& bounds)
188 : fCount(0) 188 : fCount(0)
189 , fRoot(SkNEW_ARGS(QuadTreeNode, (bounds))) { 189 , fRoot(SkNEW_ARGS(QuadTreeNode, (bounds))) {
190 SkASSERT((bounds.width() * bounds.height()) > 0); 190 SkASSERT((bounds.width() * bounds.height()) > 0);
191 } 191 }
192 192
193 SkQuadTree::~SkQuadTree() { 193 SkQuadTree::~SkQuadTree() {
194 SkDELETE(fRoot);
194 } 195 }
195 196
196 void SkQuadTree::insert(void* data, const SkIRect& bounds, bool) { 197 void SkQuadTree::insert(void* data, const SkIRect& bounds, bool) {
197 if (bounds.isEmpty()) { 198 if (bounds.isEmpty()) {
198 SkASSERT(false); 199 SkASSERT(false);
199 return; 200 return;
200 } 201 }
201 202
202 QuadTreeNode::Data quadTreeData(bounds, data); 203 QuadTreeNode::Data quadTreeData(bounds, data);
203 fRoot->insert(quadTreeData); 204 fRoot->insert(quadTreeData);
(...skipping 11 matching lines...) Expand all
215 } 216 }
216 217
217 int SkQuadTree::getDepth() const { 218 int SkQuadTree::getDepth() const {
218 return fRoot->getDepth(); 219 return fRoot->getDepth();
219 } 220 }
220 221
221 void SkQuadTree::rewindInserts() { 222 void SkQuadTree::rewindInserts() {
222 SkASSERT(fClient); 223 SkASSERT(fClient);
223 fRoot->rewindInserts(fClient); 224 fRoot->rewindInserts(fClient);
224 } 225 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698