Home | History | Annotate | Download | only in utils

Lines Matching refs:state

141 static void setup_MC_state(SkMCState* state, const SkMatrix& matrix, const SkRegion& clip) {
143 state->clipRectCount = 0;
147 state->matrix[i] = matrix.get(i);
169 state->clipRectCount++;
174 state->clipRects = (ClipRect*) sk_malloc_throw(clipWriter.bytesWritten());
175 clipWriter.flatten(state->clipRects);
257 static void setup_canvas_from_MC_state(const SkMCState& state, SkCanvas* canvas) {
261 matrix.set(i, state.matrix[i]);
266 for (int i = 0; i < state.clipRectCount; ++i) {
267 clip.op(SkIRect::MakeLTRB(state.clipRects[i].left,
268 state.clipRects[i].top,
269 state.clipRects[i].right,
270 state.clipRects[i].bottom),
308 SkCanvas* SkCanvasStateUtils::CreateFromCanvasState(const SkCanvasState* state) {
309 SkASSERT(state);
312 if (CANVAS_STATE_VERSION != state->version) {
317 if (state->layerCount < 1) {
321 SkAutoTUnref<SkCanvasStack> canvas(SkNEW_ARGS(SkCanvasStack, (state->width, state->height)));
324 setup_canvas_from_MC_state(state->mcState, canvas);
327 for (int i = state->layerCount - 1; i >= 0; --i) {
328 SkAutoTUnref<SkCanvas> canvasLayer(create_canvas_from_canvas_layer(state->layers[i]));
332 canvas->pushCanvas(canvasLayer.get(), SkIPoint::Make(state->layers[i].x,
333 state->layers[i].y));
341 void SkCanvasStateUtils::ReleaseCanvasState(SkCanvasState* state) {
342 SkDELETE(state);