Jim Graham 64e292e6e1 [Impeller] switch Rect fields to LTRB implementation (flutter/engine#49816)
Switches the Rect class implementation to an LTRB (Left, Top, Right, Bottom) set of fields for efficiency in performing rectangle operations. Additionally, the methods have been somewhat hardened to the following issues:

- NaN values should always act as if the rect is empty
  - Helps with https://github.com/flutter/flutter/issues/132770
- Saturated math methods are added to avoid overflow for integer rects
- Normalized treatment of empty rectangles in rect/rect operations
  - empty.Union(anything) == anything
  - empty.Intersection(anything) == empty
  - empty.IntersectsWith(anything) == false
  - empty.Contains(anything) == false
  - non-empty.Contains(empty) == true
- MakeMaximum now returns finite rectangles which should produce non-nan values from all getters
- A lot more testing of all of these behaviors within the unit tests

In addition, the new rectangle is closer to what DisplayList and the Skia backend have been using all along so we might be able to switch to using Impeller geometry inside DisplayList to reduce overhead for both backends.
2024-01-19 18:27:04 +00:00
Description
No description provided
BSD-3-Clause 323 MiB
Languages
Dart 75.4%
C++ 16.4%
Objective-C++ 2.7%
Java 2.7%
Objective-C 0.6%
Other 1.8%