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

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

Issue 622773003: Demote getCount, getDepth, and clear to RTree-only methods. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 "SkTileGrid.h" 8 #include "SkTileGrid.h"
9 9
10 SkTileGrid::SkTileGrid(int xTiles, int yTiles, const SkTileGridFactory::TileGrid Info& info) 10 SkTileGrid::SkTileGrid(int xTiles, int yTiles, const SkTileGridFactory::TileGrid Info& info)
11 : fXTiles(xTiles) 11 : fXTiles(xTiles)
12 , fYTiles(yTiles) 12 , fYTiles(yTiles)
13 , fInfo(info) 13 , fInfo(info)
14 , fCount(0)
15 , fTiles(SkNEW_ARRAY(SkTDArray<unsigned>, xTiles * yTiles)) { 14 , fTiles(SkNEW_ARRAY(SkTDArray<unsigned>, xTiles * yTiles)) {
16 // Margin is offset by 1 as a provision for AA and 15 // Margin is offset by 1 as a provision for AA and
17 // to cancel-out the outset applied by getClipDeviceBounds. 16 // to cancel-out the outset applied by getClipDeviceBounds.
18 fInfo.fMargin.fHeight++; 17 fInfo.fMargin.fHeight++;
19 fInfo.fMargin.fWidth++; 18 fInfo.fMargin.fWidth++;
20 } 19 }
21 20
22 SkTileGrid::~SkTileGrid() { 21 SkTileGrid::~SkTileGrid() {
23 SkDELETE_ARRAY(fTiles); 22 SkDELETE_ARRAY(fTiles);
24 } 23 }
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 // We did find an earliest entry. Output it, and step forward every tile that contains it. 140 // We did find an earliest entry. Output it, and step forward every tile that contains it.
142 results->push(*earliest); 141 results->push(*earliest);
143 for (int i = 0; i < starts.count(); i++) { 142 for (int i = 0; i < starts.count(); i++) {
144 if (starts[i] < ends[i] && *starts[i] == *earliest) { 143 if (starts[i] < ends[i] && *starts[i] == *earliest) {
145 starts[i]++; 144 starts[i]++;
146 } 145 }
147 } 146 }
148 } 147 }
149 } 148 }
150 149
151 void SkTileGrid::clear() {
152 for (int i = 0; i < fXTiles * fYTiles; i++) {
153 fTiles[i].reset();
154 }
155 }
156
OLDNEW
« src/core/SkRTree.h ('K') | « src/core/SkTileGrid.h ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698