Make a moveTo after an SkPath::addRRect invalidate the rrect-ness of the path
For posterity:
Prior to this CL, after we added a round rect to a path, the subsequent addition of moveTos didn't invalidate the 'round-rect-ness' of that path.
This caused trouble later when we tried to extract the RRect from the path.
The addition of the moveTos altered the bounds of the path (so the rect portion of the returned RRect was incorrect) and, bc the bounds were used to determine which corner each conic represented (to extract the radii), the extracted radii were incorrect.
To make this more concrete, here is the rrect that went in:
fLeft 7.49565078e-27 float
fTop 5.01922015e+33 float
fRight 5.13968144e+36 float
fBottom 5.02191391e+33 float
- fRadii
+ [0] {fX=0.000000000 fY=0.000000000 } SkPoint
+ [1] {fX=0.000000000 fY=0.000000000 } SkPoint
+ [2] {fX=1.92122573e+10 fY=10069.3330 } SkPoint
+ [3] {fX=0.000000000 fY=0.000000000 } SkPoint
and here is the rrect that came out:
fLeft 0.000000000 float
fTop 0.000000000 float
fRight 5.13968144e+36 float
fBottom 5.02191391e+33 float
- fRadii
+ [0] {fX=0.000000000 fY=0.000000000 } SkPoint
+ [1] {fX=0.000000000 fY=0.000000000 } SkPoint
+ [2] {fX=0.000000000 fY=0.000000000 } SkPoint
+ [3] {fX=0.000000000 fY=0.000000000 } SkPoint
where the additional moveTos all moved to (0.0f, 0.0f)
Change-Id: I8c98d83f8a483d14104f80ac4e22963949f19fe4
Reviewed-on: https://skia-review.googlesource.com/154629
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
1 file changed