Skip to content

Conversation

@liyuqian
Copy link
Contributor

@liyuqian liyuqian commented Feb 20, 2019

Fixes #29070

This will be a breaking change. Our old behavior may generate confusions
for a sample app like our added golden test: Skia will shrink the cull
rect (and thus the filtered area) to the text. The new behavior will
fill the BackdropFilter to its parent/ancestor clip. This is more
in line with our clip behaviors (no clip by default).

If this breaks your app, wrap the BackdropFilter with a ClipRect (or some other clip of your choice).

[wip] The golden images are not uploaded yet. I'll wait for the initial
round of review to approve the golden test before uploading them.

The correct golden image:
backdrop_filter_test cull_rect 1

The incorrect golden image before this PR:
backdrop_filter_test cull_rect 1 wrong

@goderbauer
Copy link
Member

Can you document on BackdropFilter that it may potentially need to be wrapped in a ClipRect?

@liyuqian
Copy link
Contributor Author

CC @Hixie for the breaking change. Since there's no user complaining yet, we may wait a while and send an ask/announcement to flutter-dev before landing this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't this be statically defined? Instead of instantiating a new closure on each paint call.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I make a static, I can no longer call super.paint which is non-static?

Don't worry, I'll remove this hacky callback soon. See my 3-step plan in #29070 (comment)

Copy link
Member

@xster xster Mar 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant make this function statically defined, not make this function static.

e.g.

void paintingCallback(PaintingContext context, Offset offset) {
  blah
}

void paint(PaintingContext context, Offset offset) {
  context.pushLayer(BackdropFilter(filter: _filter), paintingCallback, offset);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, great, that's a good idea. Thanks!

@xster
Copy link
Member

xster commented Feb 20, 2019

LGTM \o/

@Hixie
Copy link
Contributor

Hixie commented Feb 20, 2019

Since there's no user complaining yet, we may wait a while and send an ask/announcement to flutter-dev before landing this.

We should definitely do the breaking change policy if we land this, regardless of who is complaining.

@Hixie
Copy link
Contributor

Hixie commented Feb 20, 2019

This change should have a corresponding documentation change. Either fixing what we say now, or adding documentation to explain what's going on. We need examples of how to get the effect we want, ideally with actual diagrams (see the assets-for-api-docs repo for how to make diagrams) and sample code.

@zoechi zoechi added the framework flutter/packages/flutter repository. See also f: labels. label Feb 20, 2019
@spkersten
Copy link
Contributor

This took us a while to figure out initially and now we are adding a container with Color.transparant background around most of our BackdropFilters. Not a deal breaker of course, but slightly inconvenient.

@liyuqian liyuqian added the c: API break Backwards-incompatible API changes label Mar 8, 2019
@liyuqian liyuqian force-pushed the backdropfilter_no_shrink branch from 98a8c08 to c245265 Compare March 8, 2019 23:45
@liyuqian
Copy link
Contributor Author

liyuqian commented Mar 9, 2019

Doc updated. Added issue #29070 with the breaking change announcement. Please review the updated PR.

liyuqian added a commit to flutter/goldens that referenced this pull request Mar 9, 2019
Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove extra blank line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thanks!

@liyuqian
Copy link
Contributor Author

@dnfield after your PhysicalShapeLayer revert, my golden version is having a conflict since my golden patch is after your golden patch. Should I wait for your reland before merging this? (It seems that no new goldens can be updated unless you either reland the PR, or revert the golden commit that includes the PhysicalShapeLayer fix.)

@dnfield
Copy link
Contributor

dnfield commented Mar 14, 2019

If you can wait for the engine roll to land that would be idea.

@dnfield
Copy link
Contributor

dnfield commented Mar 14, 2019

Either that, or take the same goldens.version as the engine roll has here: #29363

@liyuqian
Copy link
Contributor Author

I'll wait for the manual roll :)

@liyuqian liyuqian force-pushed the backdropfilter_no_shrink branch from 53d1cab to be54bc3 Compare March 14, 2019 20:17
This will be a breaking change. Our old behavior may generate confusions
for a sample app like our added golden test: Skia will shrink the cull
rect (and thus the filtered area) to the text. The new behavior will
fill the BackdropFilter to its parent/ancestor clip. This is more
in align with our clip behaviors (no clip by default).

If this breaks your app, wrap the BackdropFilter with a ClipRect.

[wip] The golden images are not uploaded yet. I'll wait for the initial
round of review to approve the golden test before uploading them.
@liyuqian liyuqian force-pushed the backdropfilter_no_shrink branch from 7f836de to 5c5ff7a Compare March 14, 2019 22:48
@Piinks Piinks merged commit 0067efc into flutter:master Mar 15, 2019
@liyuqian liyuqian deleted the backdropfilter_no_shrink branch April 29, 2019 17:27
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

c: API break Backwards-incompatible API changes framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No shrinking for BackdropFilter's cull rect

10 participants