Hal Canary | 8751512 | 2019-03-15 14:22:51 -0400 | [diff] [blame] | 1 | // Copyright 2019 Google LLC. |
| 2 | // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 3 | #include "tools/fiddle/examples.h" |
Hal Canary | 8751512 | 2019-03-15 14:22:51 -0400 | [diff] [blame] | 4 | // HASH=c73f5e2644d949b859f05bd367883454 |
Hal Canary | a7181e7c | 2019-03-18 16:06:34 -0400 | [diff] [blame] | 5 | REG_FIDDLE(RRect_dumpHex, 256, 256, true, 0) { |
Hal Canary | 8751512 | 2019-03-15 14:22:51 -0400 | [diff] [blame] | 6 | void draw(SkCanvas* canvas) { |
| 7 | SkRRect rrect = SkRRect::MakeRect({6.f / 7, 2.f / 3, 6.f / 7, 2.f / 3}); |
| 8 | rrect.dumpHex(); |
| 9 | SkRect bounds = SkRect::MakeLTRB(SkBits2Float(0x3f5b6db7), /* 0.857143 */ |
| 10 | SkBits2Float(0x3f2aaaab), /* 0.666667 */ |
| 11 | SkBits2Float(0x3f5b6db7), /* 0.857143 */ |
| 12 | SkBits2Float(0x3f2aaaab) /* 0.666667 */); |
| 13 | const SkPoint corners[] = { |
| 14 | { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */ |
| 15 | { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */ |
| 16 | { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */ |
| 17 | { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */ |
| 18 | }; |
| 19 | SkRRect copy; |
| 20 | copy.setRectRadii(bounds, corners); |
| 21 | SkDebugf("rrect is " "%s" "equal to copy\n", rrect == copy ? "" : "not "); |
| 22 | } |
| 23 | } // END FIDDLE |