Flutter Engine
The Flutter Engine
Functions
RRect_Corner.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

 REG_FIDDLE (RRect_Corner, 256, 70, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( RRect_Corner  ,
256  ,
70  ,
false  ,
 
)

Definition at line 4 of file RRect_Corner.cpp.

4 {
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
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