| OLD | NEW |
| 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> |
| 11 #include <vector> | |
| 12 | 11 |
| 13 static const int kSplitThreshold = 8; | 12 static const int kSplitThreshold = 8; |
| 14 | 13 |
| 15 enum { | 14 enum { |
| 16 kTopLeft, | 15 kTopLeft, |
| 17 kTopRight, | 16 kTopRight, |
| 18 kBottomLeft, | 17 kBottomLeft, |
| 19 kBottomRight, | 18 kBottomRight, |
| 20 }; | 19 }; |
| 21 enum { | 20 enum { |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 | 208 |
| 210 void SkQuadTree::flushDeferredInserts() { | 209 void SkQuadTree::flushDeferredInserts() { |
| 211 if (NULL == fRoot) { | 210 if (NULL == fRoot) { |
| 212 fRoot = fNodePool.acquire(); | 211 fRoot = fNodePool.acquire(); |
| 213 fRoot->fBounds = fRootBounds; | 212 fRoot->fBounds = fRootBounds; |
| 214 } | 213 } |
| 215 while(!fDeferred.isEmpty()) { | 214 while(!fDeferred.isEmpty()) { |
| 216 this->insert(fRoot, fDeferred.pop()); | 215 this->insert(fRoot, fDeferred.pop()); |
| 217 } | 216 } |
| 218 } | 217 } |
| OLD | NEW |