-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.
Description
auto input_bounds = SkIRect::MakeLTRB(20, 20, 80, 80);
auto sk_filter = SkImageFilters::Blur(5.0, 10.0, SkTileMode::kDecal, nullptr);
auto r = sk_filter->filterBounds(input_bounds, matrix, SkImageFilter::MapDirection::kForward_MapDirection);
SkIRect o;
filter.map_device_bounds(input_bounds, matrix, o);
ASSERT_EQ(r, o);The r is {fLeft:1, fTop:-52, fRight:99, fBottom:152}; The o is {fLeft:-36, fTop:-52, fRight:136, fBottom:152}
auto sk_filter1 =
SkImageFilters::Blur(5.0, 6.0, SkTileMode::kRepeat, nullptr);
auto dl_filter1 =
std::make_shared<DlBlurImageFilter>(5.0, 6.0, DlTileMode::kRepeat);
auto b = sk_filter1->filterBounds(inputBounds, rotate_translate, SkImageFilter::MapDirection::kForward_MapDirection);
auto rotate_translate = SkMatrix::RotateDeg(45).preTranslate(5.0, 5.0);
SkIRect dl_b;
dl_filter1->map_device_bounds(inputBounds, rotate_translate, dl_b);
ASSERT_EQ(b, dl_r);The b is {fLeft:17, fTop:-4, fRight:83, fBottom:104}; the dl_b is {fLeft:-4, fTop:-4, fRight:104, fBottom:104}
But we assert the bounds are equal;
I found in Skia of the SkBlurImageFilter should map the sigma value
https://skia.googlesource.com/skia/+/refs/heads/main/src/effects/imagefilters/SkBlurImageFilter.cpp#1031
And the bounds only make the outset
https://skia.googlesource.com/skia/+/refs/heads/main/src/effects/imagefilters/SkBlurImageFilter.cpp#1032
But in DlBlurImageFilter, I found some different of logic.
- we don't map the sigma value here
https://github.com/flutter/engine/blob/main/display_list/display_list_image_filter.h#L254 - why we map_vectors_affine here:
https://github.com/flutter/engine/blob/main/display_list/display_list_image_filter.h#L212
cc @flar
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.
Type
Projects
Status
✅ Done