This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] new blur: refactored math and fixed expanded padding size #49206
Merged
Merged
Changes from 12 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
f3d1bf5
[Impeller] made blur subpasses as big as the hint
gaaclarke f201e5c
++
gaaclarke 7c6e658
++
gaaclarke 9429eb6
++
gaaclarke 9acb2cd
++
gaaclarke 597879e
flipped the branch
gaaclarke af9c37c
removed downsample size hack
gaaclarke e7efc25
updated docstring
gaaclarke 9177933
fixed linter
gaaclarke c855424
updated todo
gaaclarke f17e00a
fixed tests and turned off hack
gaaclarke bb87029
added test
gaaclarke 8947a45
Removed the optimization, fixed local padding calculation
gaaclarke f265eb6
removed rect fix for now
gaaclarke c799e29
format
gaaclarke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
A couple of things come to mind while thinking about this:
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 don't think so, the
input_snapshot_coverageis incorporating the expanded coverage hint.This is basically saying: I requested an
expanded_coverage_hintand the snapshot you gave me for that doesn't contain all of the area of thecoverage_hint. Therefore, some part of the halo will be visible and we'll add padding.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.
Check out the test, that should make this clear. The
coverage_hintis saying we are going to render a small portion of the image, so there is no need to add the halo gutter.Uh oh!
There was an error while loading. Please reload this page.
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.
Ah, I actually missed the not operator in front of the
Containscheck here.I still think this isn't quite working for all cases. I made an interactive playground (will push a PR for it) to demonstrate an issue with Decal tiling:
Screen.Recording.2023-12-20.at.5.08.59.AM.mov
The color jumping is explained by flutter/flutter#140193 (comment) and isn't the focus of the video. The main problem is that the edge of the blurred image turns opaque when the clip becomes contained by the input snapshot coverage.
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.
(Made a PR for the interactive toy here: #49283)
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.
Ahh right, the coverage_hint has to be inside of the snapshot image coverage while accounting for the blur radius. I'll fix that although I wonder if that will make this optimization hardly applicable.
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 fixed the problem, but there is a jump in the rendering because of the downsampling issue. It also catches way less cases now because it isn't cutting off the padding when hitting the edge of the input. I'm going to keep all the refactors and land it as a refactor since I have PRs that depend on this. I can circle back.
I also ran into a fun Rect floating point bug =( flutter/flutter#140464