blob: 831e795a2efa6658a0b1b245118903e04f105ee2 [file] [log] [blame]
Hal Canary83c2f702019-03-07 14:53:03 -05001// 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.
3#include "fiddle/examples.h"
4// HASH=c73f5e2644d949b859f05bd367883454
5REG_FIDDLE(RRect_044, 256, 256, true, 0) {
6void 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