1cb93a386Sopenharmony_ci// Copyright 2019 Google LLC.
2cb93a386Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
3cb93a386Sopenharmony_ci#include "tools/fiddle/examples.h"
4cb93a386Sopenharmony_ci// HASH=9205393f30b156e1507e88aa27f1dd91
5cb93a386Sopenharmony_ciREG_FIDDLE(RRect_Corner, 256, 70, false, 0) {
6cb93a386Sopenharmony_civoid draw(SkCanvas* canvas) {
7cb93a386Sopenharmony_ci    SkPaint paint;
8cb93a386Sopenharmony_ci    paint.setAntiAlias(true);
9cb93a386Sopenharmony_ci    SkRRect rrect;
10cb93a386Sopenharmony_ci    SkVector corners[] = {{25, 17}, {17, 19}, {19, 15}, {15, 15}};
11cb93a386Sopenharmony_ci    rrect.setRectRadii({30, 10, 100, 60}, corners);
12cb93a386Sopenharmony_ci    canvas->drawRRect(rrect, paint);
13cb93a386Sopenharmony_ci    paint.setColor(SK_ColorWHITE);
14cb93a386Sopenharmony_ci    const SkRect r = rrect.getBounds();
15cb93a386Sopenharmony_ci    canvas->drawLine(r.fLeft, r.fTop + rrect.radii(SkRRect::kUpperLeft_Corner).fY,
16cb93a386Sopenharmony_ci                     r.fRight, r.fTop + rrect.radii(SkRRect::kUpperRight_Corner).fY, paint);
17cb93a386Sopenharmony_ci    canvas->drawLine(r.fLeft, r.fBottom - rrect.radii(SkRRect::kLowerLeft_Corner).fY,
18cb93a386Sopenharmony_ci                     r.fRight, r.fBottom - rrect.radii(SkRRect::kLowerRight_Corner).fY, paint);
19cb93a386Sopenharmony_ci    canvas->drawLine(r.fLeft + rrect.radii(SkRRect::kUpperLeft_Corner).fX, r.fTop,
20cb93a386Sopenharmony_ci                     r.fLeft + rrect.radii(SkRRect::kLowerLeft_Corner).fX, r.fBottom, paint);
21cb93a386Sopenharmony_ci    canvas->drawLine(r.fRight - rrect.radii(SkRRect::kUpperRight_Corner).fX, r.fTop,
22cb93a386Sopenharmony_ci                     r.fRight - rrect.radii(SkRRect::kLowerRight_Corner).fX, r.fBottom, paint);
23cb93a386Sopenharmony_ci}
24cb93a386Sopenharmony_ci}  // END FIDDLE
25