-
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
Use DisplayListMatrixClipTracker in DisplayListBuilder #38349
Conversation
This reverts commit b201dad.
@flar After the modification, the clip-related test in Should we modify those tests to make them pass? Or should we make DisplayListMatrixClipTracker ignore is_aa? Please let me know what you do you think. thanks! |
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 looks great! Minor changes noted and fix or file an issue against Data4x4 if it is doing the inverse wrong (I didn't go through the math to see if it matters).
@@ -323,7 +336,9 @@ SkRect Data3x3::local_cull_rect() const { | |||
// cull rect. | |||
return DisplayListBuilder::kMaxCullRect; | |||
} | |||
return inverse.mapRect(cull_rect_); | |||
SkRect expended_rect; |
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.
What about the version in Data4x4?
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 dubious, btw, because we could be computing local bounds for something that won't yet have its final transform, so the roundOut may be too much or not enough depending on a scale that happens outside the picture recording...
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 is roundOut logic in DLBuilder. If it is not change here, some tests in display_list_unittests.cc and canvas_test.dart will fail.
So we should change the tests instead of add roundOut here, right?
This is all about whether to do a roundOut when setting an AA clip. Ugh, I can see some arguments both ways. Let me think about it some more. |
One issue with roundOut is that it is assuming that it is working in device pixels. But, these measurements are relative to the environment in which the recorded DL will be displayed. In most cases that will involve a DPI adjustment that we don't see and so the roundOut is larger than it should be. But, we could just as well be compiling a huge picture that will be shown at a fractional scale - in which case roundOut won't be as large as it should be. |
I think we should proceed with clip(AA) doing a roundout (ignoring the fact that we aren't really talking about pixels in the builder/recorder) and DL bounds doing a roundout for AA primitives. And not doing those things on non-AA clips/primitives. The test should be changed to specify non-AA for the clip that it executes. |
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.
Should we duplicate the clip bounds tests and have a version that tests AA and another that tests non-AA?
Good idea. Tests has been added now. |
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 - just a nit
…117421) * 2dd2afb49 Roll Skia from e8c3fa6d7d2f to c42beb57e108 (2 revisions) (flutter/engine#38416) * 333741df5 Roll Fuchsia Mac SDK from NS4fVXM2KhKcZ1uyD... to ev2n-_c3kgBw1h4RG... (flutter/engine#38418) * 73801d376 Roll Skia from c42beb57e108 to 557183808708 (2 revisions) (flutter/engine#38419) * 6b7ed7802 Use DisplayListMatrixClipTracker in DisplayListBuilder (flutter/engine#38349) * e3e288be8 Roll Skia from 557183808708 to 68dbdbdc2e49 (1 revision) (flutter/engine#38420) * 8e8d7b5d2 Roll Fuchsia Linux SDK from uKNwsaf92uZcX_QiY... to iQT5jpUhipvetxSiH... (flutter/engine#38421) * c08907c38 Roll Skia from 68dbdbdc2e49 to a8378cd12673 (1 revision) (flutter/engine#38422) * cf69289fb Roll Skia from a8378cd12673 to eca2fed907ac (3 revisions) (flutter/engine#38423) * bd4a60454 [Impeller] RRect blur improvements (flutter/engine#38417) * d4929a7a7 Roll Fuchsia Mac SDK from ev2n-_c3kgBw1h4RG... to nJJfWIwH5zElheIX8... (flutter/engine#38424) * 91dc9645f Roll Skia from eca2fed907ac to 34fb45763ef7 (3 revisions) (flutter/engine#38425) * 75d75575d Roll Skia from 34fb45763ef7 to 09d796c0a728 (8 revisions) (flutter/engine#38428)
Something about this change causes the DisplayList.FlutterSvgIssue661BoundsWereEmpty test to fail now on my development MBP with an M1 chip. The bounds computed and compared here are very slightly off. It looks like the new code performs computations that are sensitive to the FP differences on Apple Silicon? See also the PR now linked here: #38435 |
…lutter#117421) * 2dd2afb49 Roll Skia from e8c3fa6d7d2f to c42beb57e108 (2 revisions) (flutter/engine#38416) * 333741df5 Roll Fuchsia Mac SDK from NS4fVXM2KhKcZ1uyD... to ev2n-_c3kgBw1h4RG... (flutter/engine#38418) * 73801d376 Roll Skia from c42beb57e108 to 557183808708 (2 revisions) (flutter/engine#38419) * 6b7ed7802 Use DisplayListMatrixClipTracker in DisplayListBuilder (flutter/engine#38349) * e3e288be8 Roll Skia from 557183808708 to 68dbdbdc2e49 (1 revision) (flutter/engine#38420) * 8e8d7b5d2 Roll Fuchsia Linux SDK from uKNwsaf92uZcX_QiY... to iQT5jpUhipvetxSiH... (flutter/engine#38421) * c08907c38 Roll Skia from 68dbdbdc2e49 to a8378cd12673 (1 revision) (flutter/engine#38422) * cf69289fb Roll Skia from a8378cd12673 to eca2fed907ac (3 revisions) (flutter/engine#38423) * bd4a60454 [Impeller] RRect blur improvements (flutter/engine#38417) * d4929a7a7 Roll Fuchsia Mac SDK from ev2n-_c3kgBw1h4RG... to nJJfWIwH5zElheIX8... (flutter/engine#38424) * 91dc9645f Roll Skia from eca2fed907ac to 34fb45763ef7 (3 revisions) (flutter/engine#38425) * 75d75575d Roll Skia from 34fb45763ef7 to 09d796c0a728 (8 revisions) (flutter/engine#38428)
* Use DisplayListMatrixClipTracker in DisplayListBuilder * Ignore is_aa * Revert "Ignore is_aa" This reverts commit b201dad. * Tweak code * Use content_culled * getLocalClipBounds without device clip bounds roundsOut * Tweak code and add more tests * remove virtual
…lutter#117421) * 2dd2afb49 Roll Skia from e8c3fa6d7d2f to c42beb57e108 (2 revisions) (flutter/engine#38416) * 333741df5 Roll Fuchsia Mac SDK from NS4fVXM2KhKcZ1uyD... to ev2n-_c3kgBw1h4RG... (flutter/engine#38418) * 73801d376 Roll Skia from c42beb57e108 to 557183808708 (2 revisions) (flutter/engine#38419) * 6b7ed7802 Use DisplayListMatrixClipTracker in DisplayListBuilder (flutter/engine#38349) * e3e288be8 Roll Skia from 557183808708 to 68dbdbdc2e49 (1 revision) (flutter/engine#38420) * 8e8d7b5d2 Roll Fuchsia Linux SDK from uKNwsaf92uZcX_QiY... to iQT5jpUhipvetxSiH... (flutter/engine#38421) * c08907c38 Roll Skia from 68dbdbdc2e49 to a8378cd12673 (1 revision) (flutter/engine#38422) * cf69289fb Roll Skia from a8378cd12673 to eca2fed907ac (3 revisions) (flutter/engine#38423) * bd4a60454 [Impeller] RRect blur improvements (flutter/engine#38417) * d4929a7a7 Roll Fuchsia Mac SDK from ev2n-_c3kgBw1h4RG... to nJJfWIwH5zElheIX8... (flutter/engine#38424) * 91dc9645f Roll Skia from eca2fed907ac to 34fb45763ef7 (3 revisions) (flutter/engine#38425) * 75d75575d Roll Skia from 34fb45763ef7 to 09d796c0a728 (8 revisions) (flutter/engine#38428)
fix flutter/flutter#117096
Pre-launch Checklist
///
).