mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
The original PR caused some golden test failures down the line, likely due to bad analysis of when the combined BlendMode and color would result in a NOP situation. This PR adds tests that go through every BlandMode and pair it with a variety of colors and Color/ImageFilters to verify that the operations are only omitted when they actually produce no change in the output. It also checks the validity of the "modifies_transparent_black" property of DisplayLists which can be used in place of the current CanvasSpy/DlOpSpy classes. The description from the [previous PR](https://github.com/flutter/engine/pull/41463) updated with the new name of the DL property: --------------------------------- This optimization avoids recording unnecessary render operations that will not affect the output and also eliminates the need for "draw detection" mechanisms like `DlOpSpy` and `CanvasSpy` by remembering if any non-transparent operations were included. The `DlOpSpy` unit tests were updated to check if the results from that object match the new `DisplayList::modifies_transparent_black()` method. Fixes https://github.com/flutter/flutter/issues/125338 In addition, this change will unblock some other Issues: - https://github.com/flutter/flutter/issues/125318 - https://github.com/flutter/flutter/issues/125403