Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
RRect_setRectRadii.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

 REG_FIDDLE (RRect_setRectRadii, 256, 128, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( RRect_setRectRadii  ,
256  ,
128  ,
false  ,
 
)

Definition at line 5 of file RRect_setRectRadii.cpp.

5 {
6void draw(SkCanvas* canvas) {
8 paint.setStrokeWidth(15);
9 paint.setStrokeCap(SkPaint::kSquare_Cap);
10 paint.setAntiAlias(true);
11 float intervals[] = { 5, 21.75f };
13 paint.setPathEffect(SkDashPathEffect::Make(intervals, std::size(intervals), 0));
16 SkVector corners[] = {{15, 17}, {17, 19}, {19, 15}, {15, 15}};
17 rrect.setRectRadii({20, 20, 100, 100}, corners);
18 path.addRRect(rrect, SkPathDirection::kCW);
19 canvas->drawPath(path, paint);
20 path.rewind();
21 path.addRRect(rrect, SkPathDirection::kCCW, 1);
22 canvas->translate(120, 0);
23 canvas->drawPath(path, paint);
24}
25} // END FIDDLE
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
void translate(SkScalar dx, SkScalar dy)
void drawPath(const SkPath &path, const SkPaint &paint)
static sk_sp< SkPathEffect > Make(const SkScalar intervals[], int count, SkScalar phase)
@ kSquare_Cap
adds square
Definition SkPaint.h:336
@ kStroke_Style
set to stroke geometry
Definition SkPaint.h:194
void setRectRadii(const SkRect &rect, const SkVector radii[4])
Definition SkRRect.cpp:189
const Paint & paint
SkRRect rrect
Definition SkRecords.h:232
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition switches.h:57