From ffb58ce65d38cb06b073488113c59d69efd55a0b Mon Sep 17 00:00:00 2001 From: liyuqian Date: Mon, 18 Mar 2019 12:43:41 -0700 Subject: [PATCH] Clip to clip_rect instead of paint bounds (flutter/engine#8183) Otherwise, we'll have issues such as https://github.com/flutter/flutter/issues/29070 The engine roll that includes this PR needs a tiny golden image update. Will do a manual roll. --- engine/src/flutter/flow/layers/clip_rect_layer.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/src/flutter/flow/layers/clip_rect_layer.cc b/engine/src/flutter/flow/layers/clip_rect_layer.cc index 9e4d06df8b1..73c76bff331 100644 --- a/engine/src/flutter/flow/layers/clip_rect_layer.cc +++ b/engine/src/flutter/flow/layers/clip_rect_layer.cc @@ -48,10 +48,10 @@ void ClipRectLayer::Paint(PaintContext& context) const { FML_DCHECK(needs_painting()); SkAutoCanvasRestore save(context.internal_nodes_canvas, true); - context.internal_nodes_canvas->clipRect(paint_bounds(), + context.internal_nodes_canvas->clipRect(clip_rect_, clip_behavior_ != Clip::hardEdge); if (clip_behavior_ == Clip::antiAliasWithSaveLayer) { - context.internal_nodes_canvas->saveLayer(paint_bounds(), nullptr); + context.internal_nodes_canvas->saveLayer(clip_rect_, nullptr); } PaintChildren(context); if (clip_behavior_ == Clip::antiAliasWithSaveLayer) {