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

Go to the source code of this file.

Functions

 REG_FIDDLE (skpaint_corner_path_effects, 256, 256, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( skpaint_corner_path_effects  ,
256  ,
256  ,
false  ,
 
)

Definition at line 4 of file skpaint_corner_path_effects.cpp.

4 {
5SkPath star() {
6 const SkScalar R = 115.2f, C = 128.0f;
8 path.moveTo(C + R, C);
9 for (int i = 1; i < 7; ++i) {
10 SkScalar a = 2.6927937f * i;
11 path.lineTo(C + R * cos(a), C + R * sin(a));
12 }
13 path.close();
14 return path;
15}
16void draw(SkCanvas* canvas) {
18 paint.setPathEffect(SkCornerPathEffect::Make(32.0f));
20 paint.setAntiAlias(true);
21 canvas->clear(SK_ColorWHITE);
22 SkPath path(star());
23 canvas->drawPath(path, paint);
24}
25} // 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 clear(SkColor color)
Definition SkCanvas.h:1199
void drawPath(const SkPath &path, const SkPaint &paint)
static sk_sp< SkPathEffect > Make(SkScalar radius)
@ kStroke_Style
set to stroke geometry
Definition SkPaint.h:194
const Paint & paint
float SkScalar
Definition extension.cpp:12
struct MyStruct a[10]
#define R(r)
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