blob: 83518d836765cd274217ecdc61da357b3b68ac33 [file] [log] [blame]
Hal Canary87515122019-03-15 14:22:51 -04001// 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 Kleinc0bd9f92019-04-23 12:05:21 -05003#include "tools/fiddle/examples.h"
Hal Canary87515122019-03-15 14:22:51 -04004// HASH=c73f5e2644d949b859f05bd367883454
Hal Canarya7181e7c2019-03-18 16:06:34 -04005REG_FIDDLE(RRect_dumpHex, 256, 256, true, 0) {
Hal Canary87515122019-03-15 14:22:51 -04006void 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