Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Functions | Variables
dashcircle.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPathBuilder.h"
#include "include/core/SkPathEffect.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkScalar.h"
#include "include/core/SkSize.h"
#include "include/core/SkString.h"
#include "include/core/SkTypes.h"
#include "include/effects/SkDashPathEffect.h"
#include "tools/timer/TimeUtils.h"

Go to the source code of this file.

Classes

struct  DashExample
 
class  DashCircleGM
 
class  DashCircle2GM
 

Functions

 DEF_SIMPLE_GM (maddash, canvas, 1600, 1600)
 

Variables

int dash1 [] = { 1, 1 }
 
int dash2 [] = { 1, 3 }
 
int dash3 [] = { 1, 1, 3, 3 }
 
int dash4 [] = { 1, 3, 2, 4 }
 
struct DashExample dashExamples []
 

Function Documentation

◆ DEF_SIMPLE_GM()

DEF_SIMPLE_GM ( maddash  ,
canvas  ,
1600  ,
1600   
)

Definition at line 239 of file dashcircle.cpp.

239 {
240 canvas->drawRect({0, 0, 1600, 1600}, SkPaint());
241 SkPaint p;
242 p.setColor(SK_ColorRED);
243 p.setAntiAlias(true);
244 p.setStroke(true);
245 p.setStrokeWidth(380);
246
247 SkScalar intvls[] = { 2.5, 10 /* 1200 */ };
248 p.setPathEffect(SkDashPathEffect::Make(intvls, 2, 0));
249
250 canvas->drawCircle(400, 400, 200, p);
251
253 path.moveTo(800, 400);
254 path.quadTo(1000, 400, 1000, 600);
255 path.quadTo(1000, 800, 800, 800);
256 path.quadTo(600, 800, 600, 600);
257 path.quadTo(600, 400, 800, 400);
258 path.close();
259 canvas->translate(350, 150);
260 p.setStrokeWidth(320);
261 canvas->drawPath(path.detach(), p);
262
263 path.moveTo(800, 400);
264 path.cubicTo(900, 400, 1000, 500, 1000, 600);
265 path.cubicTo(1000, 700, 900, 800, 800, 800);
266 path.cubicTo(700, 800, 600, 700, 600, 600);
267 path.cubicTo(600, 500, 700, 400, 800, 400);
268 path.close();
269 canvas->translate(-550, 500);
270 p.setStrokeWidth(300);
271 canvas->drawPath(path.detach(), p);
272}
constexpr SkColor SK_ColorRED
Definition SkColor.h:126
static sk_sp< SkPathEffect > Make(const SkScalar intervals[], int count, SkScalar phase)
float SkScalar
Definition extension.cpp:12
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

Variable Documentation

◆ dash1

int dash1[] = { 1, 1 }

Definition at line 24 of file dashcircle.cpp.

24{ 1, 1 };

◆ dash2

int dash2[] = { 1, 3 }

Definition at line 25 of file dashcircle.cpp.

25{ 1, 3 };

◆ dash3

int dash3[] = { 1, 1, 3, 3 }

Definition at line 26 of file dashcircle.cpp.

26{ 1, 1, 3, 3 };

◆ dash4

int dash4[] = { 1, 3, 2, 4 }

Definition at line 27 of file dashcircle.cpp.

27{ 1, 3, 2, 4 };

◆ dashExamples

struct DashExample dashExamples[]
Initial value:
= {
{ dash1, std::size(dash1) },
{ dash2, std::size(dash2) },
{ dash3, std::size(dash3) },
{ dash4, std::size(dash4) }
}
int dash2[]
int dash3[]
int dash1[]
int dash4[]