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

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: dox 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
« no previous file with comments | « src/core/SkTileGrid.h ('k') | tests/PictureTest.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 * 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 // We did find an earliest op. Output it, and step forward every tile th at contains it. 138 // We did find an earliest op. Output it, and step forward every tile th at contains it.
140 results->push(earliest); 139 results->push(earliest);
141 for (int i = 0; i < starts.count(); i++) { 140 for (int i = 0; i < starts.count(); i++) {
142 if (starts[i] < ends[i] && *starts[i] == earliest) { 141 if (starts[i] < ends[i] && *starts[i] == earliest) {
143 starts[i]++; 142 starts[i]++;
144 } 143 }
145 } 144 }
146 } 145 }
147 } 146 }
148 147
149 void SkTileGrid::clear() {
150 for (int i = 0; i < fXTiles * fYTiles; i++) {
151 fTiles[i].reset();
152 }
153 }
154
OLDNEW
« no previous file with comments | « src/core/SkTileGrid.h ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698