Flutter Engine
The Flutter Engine
RRect_Corner.cpp
Go to the documentation of this file.
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.
4REG_FIDDLE(RRect_Corner, 256, 70, false, 0) {
5void draw(SkCanvas* canvas) {
7 paint.setAntiAlias(true);
9 SkVector corners[] = {{25, 17}, {17, 19}, {19, 15}, {15, 15}};
10 rrect.setRectRadii({30, 10, 100, 60}, corners);
11 canvas->drawRRect(rrect, paint);
12 paint.setColor(SK_ColorWHITE);
13 const SkRect r = rrect.getBounds();
22}
23} // END FIDDLE
REG_FIDDLE(RRect_Corner, 256, 70, false, 0)
Definition: RRect_Corner.cpp:4
constexpr SkColor SK_ColorWHITE
Definition: SkColor.h:122
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint &paint)
Definition: SkCanvas.cpp:2700
void drawRRect(const SkRRect &rrect, const SkPaint &paint)
Definition: SkCanvas.cpp:1705
SkVector radii(Corner corner) const
Definition: SkRRect.h:271
@ kUpperLeft_Corner
index of top-left corner radii
Definition: SkRRect.h:252
@ kLowerRight_Corner
index of bottom-right corner radii
Definition: SkRRect.h:254
@ kUpperRight_Corner
index of top-right corner radii
Definition: SkRRect.h:253
@ kLowerLeft_Corner
index of bottom-left corner radii
Definition: SkRRect.h:255
void setRectRadii(const SkRect &rect, const SkVector radii[4])
Definition: SkRRect.cpp:189
const SkRect & getBounds() const
Definition: SkRRect.h:279
const Paint & paint
Definition: color_source.cc:38
SkRRect rrect
Definition: SkRecords.h:232
float fX
x-axis value
Definition: SkPoint_impl.h:164
float fY
y-axis value
Definition: SkPoint_impl.h:165
SkScalar fBottom
larger y-axis bounds
Definition: extension.cpp:17
SkScalar fLeft
smaller x-axis bounds
Definition: extension.cpp:14
SkScalar fRight
larger x-axis bounds
Definition: extension.cpp:16
SkScalar fTop
smaller y-axis bounds
Definition: extension.cpp:15