@@ -25,30 +25,12 @@ void BackdropFilterLayer::Diff(DiffContext* context, const Layer* old_layer) {
2525 context->AddLayerBounds (paint_bounds);
2626
2727 if (filter_) {
28- // convert paint bounds and filter to screen coordinates
29- auto filter = filter_->makeWithLocalMatrix (context->GetTransform ());
30- if (filter) {
31- context->GetTransform ().mapRect (&paint_bounds);
32- auto input_filter_bounds = paint_bounds.roundOut ();
33- auto filter_bounds = // in screen coordinates
34- filter->filterBounds (input_filter_bounds, SkMatrix::I (),
35- SkImageFilter::kReverse_MapDirection );
36-
37- context->AddReadbackRegion (filter_bounds);
38- } else {
39- // Slightly less precise alternative that works even if filter can not be
40- // transformed. It might cover larger area than the branch before, because
41- // filterBounds() first rounds out to integer and and then we transform
42- // the bounds, as opposed to transforming first and rounding second.
43- // See https://github.com/flutter/flutter/issues/95211
44- auto input_filter_bounds = paint_bounds.roundOut ();
45- auto filter_bounds = // in local coordinates
46- filter_->filterBounds (input_filter_bounds, SkMatrix::I (),
47- SkImageFilter::kReverse_MapDirection );
48- auto screen_bounds = SkRect::Make (filter_bounds);
49- context->GetTransform ().mapRect (&screen_bounds);
50- context->AddReadbackRegion (screen_bounds.roundOut ());
51- }
28+ context->GetTransform ().mapRect (&paint_bounds);
29+ auto input_filter_bounds = paint_bounds.roundOut ();
30+ auto filter_bounds = // in screen coordinates
31+ filter_->filterBounds (input_filter_bounds, context->GetTransform (),
32+ SkImageFilter::kReverse_MapDirection );
33+ context->AddReadbackRegion (filter_bounds);
5234 }
5335
5436 DiffChildren (context, prev);
0 commit comments