-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
The legacy behavior of drawRect, drawOval and clipRect has been established by the implementation of Skia which automatically sorts their rects before executing the operation. As we shift our implementations we should verify this behavior at the Flutter framework level.
The problem was initially observed in #128159 when the engine started using the DisplayList to record operations and fixed for drawRect and drawOval in flutter/engine#42556.
Writing a test case for more coverage of these instances of accepting unordered rects pointed out that we have problems with this in the latest engine as reported in #140490. The native platform code is being patched in flutter/engine#49309, but there is still a problem in the HTML renderer which stops rendering and outputs an exception:
══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════
The following DomException object was thrown during a scheduler callback:
IndexSizeError: Failed to execute 'ellipse' on 'CanvasRenderingContext2D': The major-axis radius
provided (-15) is negative.
The canvaskit renderer appears to pass just fine, but it should probably have a test to verify the behavior as well.