Commit 9c47104
Fix a CHECK-failure in
Even a valid brush can result in an infinitely-large tip state, due to float overflow, so we shouldn't crash if that happens. However, previously `CalculateCircleRadius` could potentially return NaN for an infinitely-large tip state, causing the `Circle` constructor to CHECK-fail, since it requires a non-negative radius. (This CL also clarifies `Circle`'s API a bit, but doesn't change it.)
This crash was found by temporarily re-enabling the stroke generation fuzz test in `strokes/stroke_test.cc`. Fixing this crash is one step toward re-enabling that fuzz test.
PiperOrigin-RevId: 827472736BrushTipShape constructor for infinitely-large brush tips1 parent aadbefc commit 9c47104
File tree
4 files changed
+59
-3
lines changed- ink
- geometry/internal
- strokes/internal
4 files changed
+59
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
128 | 135 | | |
129 | 136 | | |
130 | 137 | | |
| |||
405 | 412 | | |
406 | 413 | | |
407 | 414 | | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
408 | 419 | | |
409 | 420 | | |
410 | 421 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
57 | 72 | | |
58 | 73 | | |
| 74 | + | |
59 | 75 | | |
60 | | - | |
61 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
62 | 79 | | |
63 | 80 | | |
64 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| 36 | + | |
34 | 37 | | |
| 38 | + | |
| 39 | + | |
35 | 40 | | |
36 | 41 | | |
| 42 | + | |
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
| |||
460 | 466 | | |
461 | 467 | | |
462 | 468 | | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
463 | 488 | | |
464 | 489 | | |
465 | 490 | | |
| |||
0 commit comments