| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "SkTileGrid.h" | 9 #include "SkTileGrid.h" |
| 10 | 10 |
| 11 SkTileGrid::SkTileGrid(int xTileCount, int yTileCount, const SkTileGridPicture::
TileGridInfo& info, | 11 SkTileGrid::SkTileGrid(int xTileCount, int yTileCount, const SkTileGridFactory::
TileGridInfo& info, |
| 12 SkTileGridNextDatumFunctionPtr nextDatumFunction) | 12 SkTileGridNextDatumFunctionPtr nextDatumFunction) { |
| 13 { | |
| 14 fXTileCount = xTileCount; | 13 fXTileCount = xTileCount; |
| 15 fYTileCount = yTileCount; | 14 fYTileCount = yTileCount; |
| 16 fInfo = info; | 15 fInfo = info; |
| 17 // Margin is offset by 1 as a provision for AA and | 16 // Margin is offset by 1 as a provision for AA and |
| 18 // to cancel-out the outset applied by getClipDeviceBounds. | 17 // to cancel-out the outset applied by getClipDeviceBounds. |
| 19 fInfo.fMargin.fHeight++; | 18 fInfo.fMargin.fHeight++; |
| 20 fInfo.fMargin.fWidth++; | 19 fInfo.fMargin.fWidth++; |
| 21 fTileCount = fXTileCount * fYTileCount; | 20 fTileCount = fXTileCount * fYTileCount; |
| 22 fInsertionCount = 0; | 21 fInsertionCount = 0; |
| 23 fGridBounds = SkIRect::MakeXYWH(0, 0, fInfo.fTileInterval.width() * fXTileCo
unt, | 22 fGridBounds = SkIRect::MakeXYWH(0, 0, fInfo.fTileInterval.width() * fXTileCo
unt, |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 } | 123 } |
| 125 | 124 |
| 126 void SkTileGrid::rewindInserts() { | 125 void SkTileGrid::rewindInserts() { |
| 127 SkASSERT(fClient); | 126 SkASSERT(fClient); |
| 128 for (int i = 0; i < fTileCount; ++i) { | 127 for (int i = 0; i < fTileCount; ++i) { |
| 129 while (!fTileData[i].isEmpty() && fClient->shouldRewind(fTileData[i].top
())) { | 128 while (!fTileData[i].isEmpty() && fClient->shouldRewind(fTileData[i].top
())) { |
| 130 fTileData[i].pop(); | 129 fTileData[i].pop(); |
| 131 } | 130 } |
| 132 } | 131 } |
| 133 } | 132 } |
| OLD | NEW |