-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Impeller] Add golden for clipped+transformed blur. #48886
Conversation
@@ -4368,5 +4368,28 @@ TEST_P(AiksTest, GaussianBlurAtPeripheryHorizontal) { | |||
ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture())); | |||
} | |||
|
|||
TEST_P(AiksTest, GaussianBlurRotatedAndClipped) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make this test be more obvious while testing the same thing? For example, rotate the picture of boston 90 degrees and clip off the left and right sides equally so that we get the square just in the middle? That way it is easier to validate that it is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to be a good smoke test for the coverage hint:
- the image should be drawn with a non-aligned basis (weird rotation or skew),
- the clip should unevenly clip the surface (some sides should be clipped more than the others),
- both the blurred source rectangle and the coverage hint should be non-square rectangles of different size.
I think if the before/after comparison shows obvious differences from the current golden, that'd be enough to be suitably useful and spark investigation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's good when we talk about making sure current behavior is maintained. The problem is that it's hard to know if this is correct behavior. I can't read the test and look at the image and pretty confidently know that is the correct rendering.
I think this would be a bit easier to follow if you rotated around the center of the texture. Rotating around an anchor that isn't the centroid or one of the corners is already hard to calculate in your head.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what I had in mind. I think this tests everything you want and is imo way more simple. I can easily communicate what it should look like:
TEST_P(AiksTest, GaussianBlurRotatedAndClipped) {
Canvas canvas;
std::shared_ptr<Texture> boston = CreateTextureForFixture("boston.jpg");
Rect bounds =
Rect::MakeXYWH(0, 0, boston->GetSize().width, boston->GetSize().height);
Vector2 image_center = Vector2(bounds.GetSize() / 2);
Paint paint = {.image_filter =
ImageFilter::MakeBlur(Sigma(20.0), Sigma(20.0),
FilterContents::BlurStyle::kNormal,
Entity::TileMode::kDecal)};
Vector2 clip_size = {200, 100};
canvas.Scale(GetContentScale());
canvas.ClipRect(Rect::MakeLTRB(512, 384, 512, 384).Expand(clip_size));
canvas.Translate({512, 384, 0});
canvas.Scale({0.5, 0.5, 1});
canvas.Rotate(Degrees(25));
canvas.DrawImageRect(std::make_shared<Image>(boston), /*source=*/bounds,
/*dest=*/bounds.Shift(-image_center), paint);
ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sgtm, I went with this and adjusted the clip slightly to make it cover a smaller area of the image.
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. |
40434c5
to
a178d2a
Compare
Golden file changes are available for triage from new commit, Click here to view. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! thanks
47d608e
to
3467a9f
Compare
Golden file changes are available for triage from new commit, Click here to view. |
…140130) flutter/engine@9f7004e...923f9e2 2023-12-14 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[Windows] Move to `FlutterCompositor` for rendering" (flutter/engine#49015) 2023-12-14 magder@google.com Add xcprivacy privacy manifest to iOS framework (flutter/engine#48951) 2023-12-14 30870216+gaaclarke@users.noreply.github.com [Impeller] Made the new blur support 1D blurs (flutter/engine#49001) 2023-12-14 skia-flutter-autoroll@skia.org Roll Skia from 69c02c9d56b2 to 188515347032 (1 revision) (flutter/engine#49005) 2023-12-14 bdero@google.com [Impeller] Add golden for clipped+transformed blur. (flutter/engine#48886) 2023-12-14 bdero@google.com [Flutter GPU] Runtime shader import. (flutter/engine#48875) 2023-12-13 737941+loic-sharma@users.noreply.github.com [Windows] Move to `FlutterCompositor` for rendering (flutter/engine#48849) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC jsimmons@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
This is a simple golden intended to smoketest potential issues when applying the coverage hint in the blur. Expected results: