Commit c953c83
authored
[Impeller] switch Rect fields to LTRB implementation (flutter#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 flutter#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.1 parent ebee709 commit c953c83
File tree
12 files changed
+4072
-771
lines changed- ci/licenses_golden
- impeller
- entity/geometry
- geometry
- playground/imgui
12 files changed
+4072
-771
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
164 | 165 | | |
165 | 166 | | |
166 | 167 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5292 | 5292 | | |
5293 | 5293 | | |
5294 | 5294 | | |
| 5295 | + | |
5295 | 5296 | | |
5296 | 5297 | | |
5297 | 5298 | | |
| |||
8129 | 8130 | | |
8130 | 8131 | | |
8131 | 8132 | | |
| 8133 | + | |
8132 | 8134 | | |
8133 | 8135 | | |
8134 | 8136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
508 | 508 | | |
509 | 509 | | |
510 | 510 | | |
511 | | - | |
512 | 511 | | |
513 | 512 | | |
514 | 513 | | |
| |||
522 | 521 | | |
523 | 522 | | |
524 | 523 | | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
| 524 | + | |
| 525 | + | |
531 | 526 | | |
532 | 527 | | |
533 | 528 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| 70 | + | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
0 commit comments