| OLD | NEW |
| 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 Loading... |
| 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); |
| 173 } |
| 174 |
| 175 return byteCount; |
| 176 } |
| 177 |
| OLD | NEW |