Flutter Engine
The Flutter Engine
Functions
bug530095.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "include/core/SkPathEffect.h"
#include "include/core/SkScalar.h"
#include "include/core/SkTypes.h"
#include "include/effects/SkDashPathEffect.h"

Go to the source code of this file.

Functions

 DEF_SIMPLE_GM (bug530095, canvas, 900, 1200)
 
 DEF_SIMPLE_GM (bug591993, canvas, 40, 140)
 

Function Documentation

◆ DEF_SIMPLE_GM() [1/2]

DEF_SIMPLE_GM ( bug530095  ,
canvas  ,
900  ,
1200   
)

Definition at line 18 of file bug530095.cpp.

18 {
19 SkPath path1 = SkPath::Circle(200, 200, 124),
20 path2 = SkPath::Circle(2, 2, 1.24f);
21
23 paint.setAntiAlias(true);
25 paint.setStrokeWidth(26);
26 SkScalar intervals[] = {700, 700 };
27 int intervalCount = (int) std::size(intervals);
28 paint.setPathEffect(SkDashPathEffect::Make(intervals, intervalCount, -40));
29 canvas->drawPath(path1, paint);
30
31 paint.setStrokeWidth(0.26f);
32 SkScalar smIntervals[] = {7, 7 };
33 int smIntervalCount = (int) std::size(smIntervals);
34 paint.setPathEffect(SkDashPathEffect::Make(smIntervals, smIntervalCount, -0.40f));
35 canvas->save();
36 canvas->scale(100, 100);
37 canvas->translate(4, 0);
38 canvas->drawPath(path2, paint);
39 canvas->restore();
40
41 paint.setStrokeWidth(26);
42 paint.setPathEffect(SkDashPathEffect::Make(intervals, intervalCount, 0));
43 canvas->save();
44 canvas->translate(0, 400);
45 canvas->drawPath(path1, paint);
46 canvas->restore();
47
48 paint.setStrokeWidth(0.26f);
49 paint.setPathEffect(SkDashPathEffect::Make(smIntervals, smIntervalCount, 0));
50 canvas->scale(100, 100);
51 canvas->translate(4, 4);
52 canvas->drawPath(path2, paint);
53}
static SkPath path1()
static SkPath path2()
static sk_sp< SkPathEffect > Make(const SkScalar intervals[], int count, SkScalar phase)
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194
Definition: SkPath.h:59
static SkPath Circle(SkScalar center_x, SkScalar center_y, SkScalar radius, SkPathDirection dir=SkPathDirection::kCW)
Definition: SkPath.cpp:3598
const Paint & paint
Definition: color_source.cc:38
float SkScalar
Definition: extension.cpp:12
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259

◆ DEF_SIMPLE_GM() [2/2]

DEF_SIMPLE_GM ( bug591993  ,
canvas  ,
40  ,
140   
)

Definition at line 55 of file bug530095.cpp.

55 {
56 SkPaint p;
57 p.setColor(SK_ColorRED);
58 p.setAntiAlias(true);
59 p.setStyle(SkPaint::kStroke_Style);
60 p.setStrokeCap(SkPaint::kRound_Cap);
61 p.setStrokeWidth(10);
62 const SkScalar intervals[] = { 100, 100 };
63 p.setPathEffect(SkDashPathEffect::Make(intervals, std::size(intervals), 100));
64 canvas->drawLine(20, 20, 120, 20, p);
65}
constexpr SkColor SK_ColorRED
Definition: SkColor.h:126
@ kRound_Cap
adds circle
Definition: SkPaint.h:335