Flutter Engine
The Flutter Engine
Functions
bug9331.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPathEffect.h"
#include "include/effects/SkDashPathEffect.h"

Go to the source code of this file.

Functions

 DEF_SIMPLE_GM (bug9331, canvas, 256, 256)
 

Function Documentation

◆ DEF_SIMPLE_GM()

DEF_SIMPLE_GM ( bug9331  ,
canvas  ,
256  ,
256   
)

Definition at line 14 of file bug9331.cpp.

14 {
15 SkRect clip = {0, 0, 200, 150};
16 {
18 paint.setColor(0x44FF0000);
19 canvas->drawRect(clip, paint);
20 }
21
22 auto draw = [&](SkColor color, SkRect clip) {
23 SkScalar intervals[] = { 13, 17 };
24 SkScalar phase = 9;
25
27 paint.setColor(color);
29 paint.setStrokeWidth(10);
30 paint.setPathEffect(SkDashPathEffect::Make(intervals, std::size(intervals), phase));
31
32 canvas->save();
33 canvas->clipRect(clip);
34 canvas->drawRect({50,50, 150,150}, paint);
35 canvas->restore();
36 };
37
38 draw(0xFF000000, clip);
39 draw(0xFF0000FF, clip.makeOffset(0,150));
40}
uint32_t SkColor
Definition: SkColor.h:37
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition: SkPath.cpp:3892
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
static sk_sp< SkPathEffect > Make(const SkScalar intervals[], int count, SkScalar phase)
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194
const Paint & paint
Definition: color_source.cc:38
DlColor color
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