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

Go to the source code of this file.

Functions

 REG_FIDDLE (convex_overstroke_quad, 256, 256, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( convex_overstroke_quad  ,
256  ,
256  ,
false  ,
 
)

Definition at line 4 of file convex_overstroke_quad.cpp.

4 {
5void draw(SkCanvas* canvas) {
6 const float SCALE = 1;
7 const int WIDTH = 100;
8
9 canvas->scale(SCALE, SCALE);
10 canvas->translate(30, 30);
11
12 SkPoint p1 = SkPoint::Make(50, 50);
13 SkPoint p2 = SkPoint::Make(80, 50);
14
15 SkPoint p3 = SkPoint::Make(65, 30);
16
18 path.moveTo(p1);
19 path.lineTo(p2);
20 path.quadTo(p3, p1);
21 // path.close();
22
23 SkPaint p;
24 p.setColor(SK_ColorRED);
25 p.setAntiAlias(true);
26 p.setStyle(SkPaint::kStroke_Style);
27 p.setStrokeWidth(WIDTH);
28
29 SkPath fillpath;
30 skpathutils::FillPathWithPaint(path, p, &fillpath);
31
32 SkPaint fillp;
34 fillp.setAntiAlias(true);
36
37 canvas->drawPath(path, p);
38 canvas->drawPath(fillpath, fillp);
39}
40} // END FIDDLE
constexpr SkColor SK_ColorRED
Definition SkColor.h:126
constexpr SkColor SK_ColorBLACK
Definition SkColor.h:103
#define WIDTH
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
#define SCALE
void translate(SkScalar dx, SkScalar dy)
void drawPath(const SkPath &path, const SkPaint &paint)
void scale(SkScalar sx, SkScalar sy)
void setStyle(Style style)
Definition SkPaint.cpp:105
void setColor(SkColor color)
Definition SkPaint.cpp:119
void setAntiAlias(bool aa)
Definition SkPaint.h:170
@ kStroke_Style
set to stroke geometry
Definition SkPaint.h:194
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
SK_API bool FillPathWithPaint(const SkPath &src, const SkPaint &paint, SkPath *dst, const SkRect *cullRect, SkScalar resScale=1)
static constexpr SkPoint Make(float x, float y)