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

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

Issue 490253003: Implement SkPicture::bytesUsed() for SkRecord backend (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Move to SkPictureUtils, start unit test Created 6 years, 3 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)
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 } 157 }
158 158
159 void SkTileGrid::rewindInserts() { 159 void SkTileGrid::rewindInserts() {
160 SkASSERT(fClient); 160 SkASSERT(fClient);
161 for (int i = 0; i < fXTiles * fYTiles; i++) { 161 for (int i = 0; i < fXTiles * fYTiles; i++) {
162 while (!fTiles[i].isEmpty() && fClient->shouldRewind(fTiles[i].top().dat a)) { 162 while (!fTiles[i].isEmpty() && fClient->shouldRewind(fTiles[i].top().dat a)) {
163 fTiles[i].pop(); 163 fTiles[i].pop();
164 } 164 }
165 } 165 }
166 } 166 }
167
168 size_t SkTileGrid::bytesUsed() const {
169 size_t byteCount = sizeof(SkTileGrid);
170
171 for (size_t i = 0; i < fCount; i++) {
172 byteCount = fTiles[i].reserved() * sizeof(Entry);
mtklein 2014/11/17 20:19:32 This is going to need an update too.
173 }
174
175 return byteCount;
176 }
177
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698