diff --git a/flow/layers/clip_path_layer.cc b/flow/layers/clip_path_layer.cc index e1ab3112aec19..06dd30bd3630a 100644 --- a/flow/layers/clip_path_layer.cc +++ b/flow/layers/clip_path_layer.cc @@ -48,7 +48,7 @@ void ClipPathLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "ClipPathLayer::Paint"); FXL_DCHECK(needs_painting()); - Layer::AutoSaveLayer save(context, paint_bounds(), nullptr); + SkAutoCanvasRestore save(&context.canvas, true); context.canvas.clipPath(clip_path_, true); PaintChildren(context); } diff --git a/flow/layers/clip_rrect_layer.cc b/flow/layers/clip_rrect_layer.cc index e72590edb372b..cef687dfcfb8a 100644 --- a/flow/layers/clip_rrect_layer.cc +++ b/flow/layers/clip_rrect_layer.cc @@ -46,7 +46,7 @@ void ClipRRectLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "ClipRRectLayer::Paint"); FXL_DCHECK(needs_painting()); - Layer::AutoSaveLayer save(context, paint_bounds(), nullptr); + SkAutoCanvasRestore save(&context.canvas, true); context.canvas.clipRRect(clip_rrect_, true); PaintChildren(context); } diff --git a/flow/layers/physical_shape_layer.cc b/flow/layers/physical_shape_layer.cc index a730f9a8f96aa..b793132cc89e2 100644 --- a/flow/layers/physical_shape_layer.cc +++ b/flow/layers/physical_shape_layer.cc @@ -91,11 +91,7 @@ void PhysicalShapeLayer::Paint(PaintContext& context) const { context.canvas.drawPath(path_, paint); SkAutoCanvasRestore save(&context.canvas, false); - if (isRect_) { - context.canvas.save(); - } else { - context.canvas.saveLayer(path_.getBounds(), nullptr); - } + context.canvas.save(); context.canvas.clipPath(path_, true); PaintChildren(context); if (context.checkerboard_offscreen_layers && !isRect_)