underflow makes it hard to compute proper radii

Bug: skia:6209
Change-Id: I7c13d58db36c959f6add0638b72fa068ce0c2266
Reviewed-on: https://skia-review.googlesource.com/106740
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
This commit is contained in:
Mike Reed 2018-02-12 15:56:06 -05:00 committed by Skia Commit-Bot
parent 8684c71e66
commit d72d6c5f8a

View File

@ -470,3 +470,27 @@ DEF_TEST(RoundRectInPath, reporter) {
test_skbug_3239(reporter);
test_mix(reporter);
}
DEF_TEST(RRect_fragile, reporter) {
SkRect rect = {
SkBits2Float(0x1f800000), // 0x003F0000 was the starter value that also fails
SkBits2Float(0x1400001C),
SkBits2Float(0x3F000004),
SkBits2Float(0x3F000004),
};
SkPoint radii[] = {
{ SkBits2Float(0x00000001), SkBits2Float(0x00000001) },
{ SkBits2Float(0x00000020), SkBits2Float(0x00000001) },
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) },
{ SkBits2Float(0x3F000004), SkBits2Float(0x3F000004) },
};
SkRRect rr;
// please don't assert
if (false) { // disable until we fix this
SkDebugf("%g 0x%08X\n", rect.fLeft, SkFloat2Bits(rect.fLeft));
rr.setRectRadii(rect, radii);
}
}