OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkCanvasStateUtils.h" | 8 #include "SkCanvasStateUtils.h" |
9 | 9 |
10 #include "SkBitmapDevice.h" | 10 #include "SkBitmapDevice.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 canvas->replayClips(&validator); | 187 canvas->replayClips(&validator); |
188 if (validator.failed()) { | 188 if (validator.failed()) { |
189 SkErrorInternals::SetError(kInvalidOperation_SkError, | 189 SkErrorInternals::SetError(kInvalidOperation_SkError, |
190 "CaptureCanvasState does not support canvases with antialiased c
lips.\n"); | 190 "CaptureCanvasState does not support canvases with antialiased c
lips.\n"); |
191 return NULL; | 191 return NULL; |
192 } | 192 } |
193 | 193 |
194 SkAutoTDelete<SkCanvasState> canvasState(SkNEW_ARGS(SkCanvasState, (canvas))
); | 194 SkAutoTDelete<SkCanvasState> canvasState(SkNEW_ARGS(SkCanvasState, (canvas))
); |
195 | 195 |
196 // decompose the total matrix and clip | 196 // decompose the total matrix and clip |
197 setup_MC_state(&canvasState->mcState, canvas->getTotalMatrix(), canvas->getT
otalClip()); | 197 setup_MC_state(&canvasState->mcState, canvas->getTotalMatrix(), |
| 198 canvas->internal_private_getTotalClip()); |
198 | 199 |
199 /* | 200 /* |
200 * decompose the layers | 201 * decompose the layers |
201 * | 202 * |
202 * storage is allocated on the stack for the first 3 layers. It is common in | 203 * storage is allocated on the stack for the first 3 layers. It is common in |
203 * some view systems (e.g. Android) that a few non-clipped layers are presen
t | 204 * some view systems (e.g. Android) that a few non-clipped layers are presen
t |
204 * and we will not need to malloc any additional memory in those cases. | 205 * and we will not need to malloc any additional memory in those cases. |
205 */ | 206 */ |
206 SkSWriter32<3*sizeof(SkCanvasLayerState)> layerWriter; | 207 SkSWriter32<3*sizeof(SkCanvasLayerState)> layerWriter; |
207 int layerCount = 0; | 208 int layerCount = 0; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 } | 334 } |
334 | 335 |
335 return canvas.detach(); | 336 return canvas.detach(); |
336 } | 337 } |
337 | 338 |
338 //////////////////////////////////////////////////////////////////////////////// | 339 //////////////////////////////////////////////////////////////////////////////// |
339 | 340 |
340 void SkCanvasStateUtils::ReleaseCanvasState(SkCanvasState* state) { | 341 void SkCanvasStateUtils::ReleaseCanvasState(SkCanvasState* state) { |
341 SkDELETE(state); | 342 SkDELETE(state); |
342 } | 343 } |
OLD | NEW |