-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Set paint transform to zero when opacity or offstage do not draw anything #103638
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
Conversation
|
(Or if we gave a decorated matrix that override |
|
Tests aren't happy because we're now trying to hit test things that are invisible.... |
|
Instead of re-using paintTransform and clip, we could add a new property that describes the accumulated opacity? |
|
I talked with @goderbauer about that. We'd like to try to avoid adding a new method to the interface if possible, since it's already a difficult interface to implement correctly. But maybe that doesn't matter if you have to do some magic around clipping or transforming... |
|
So at least one failure is trying to tap a button that is invisible. That seems like a bogus test to me. |
|
I started going through and looking at tests. In general, the problem is that tests are asserting that ROs that are not visible have certain paint bounds (usually via doing a hit test on them). Very often, it's enough to add a Sometimes it's harder - a duration has to be modified or a pumpAndSettle added, and that will slightly change some hard coded value. In some cases, it also seems like the test was just relying on the ability to get paint bounds for something that has a zero valued opacity. Rather than fix up all these callsites, I'm adding a flag so that tests are still allowed to hit test/get paint bounds for things that are transparent. |
|
In particular, some callsites are concerning because they explicitly say "I don't want the animation to finish", but finding the exact point where the opacity is no longer zero but the animation isn't finished is hard. |
|
I'm going to conver this to a debug flag. |
239e6cc to
0f8ec62
Compare
|
Ok. the cupertino context menu failure seems like a real break. I'm going to close this until I figure out how to either fix that or a better approach for this entirely. An internal global presubmit is suggesting ~200 test failures. |
|
This doesn't work because Offstage needs to be able to measure where offstage things would paint if they were visible - this is used in several places in the framework, and is documented behavior:
It deals with semantics for this by returning early if you try to visit its children for semantics. I think the only way forward for this is to have a separate method on RO called something like |
This helps make the planned refactor of visibility_detector work, and is just more correct.
We use this technique elsewhere, e.g. in
RenderSliverMultiBoxAdaptor, where there's explicit comments stating that in a case where nothing is drawn we set the transform to zero.If Matrix4 had a fast memoization for whether it's the zero matrix, we could bail out of some algorithms more quickly in this case.
There's a carve out for if you say to always include semantics. This is kind of a weird case, but in this case the "paint" isn't visible but your child still is providing visible information into the semantics tree. This would mean that something that's visually invisible would not get marked as invisible if it's semantically visible. That seems like an acceptable compromise to me.