Flutter Engine
The Flutter Engine
Functions
pathmeasure.cpp File Reference
#include "include/core/SkCanvas.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPathBuilder.h"
#include "include/core/SkPathEffect.h"
#include "include/core/SkTypes.h"
#include "include/effects/SkDashPathEffect.h"

Go to the source code of this file.

Functions

static void path_measure_explosion (SkCanvas *canvas)
 

Function Documentation

◆ path_measure_explosion()

static void path_measure_explosion ( SkCanvas canvas)
static

Definition at line 19 of file pathmeasure.cpp.

19 {
20 SkPaint p;
21 p.setAntiAlias(false);
22 float intervals[] = { 0, 10e9f };
23 p.setStyle(SkPaint::kStroke_Style);
24 p.setPathEffect(SkDashPathEffect::Make(intervals, std::size(intervals), 0));
25
26 int quadratic_at[] = {
27 13, 68, 258, 1053, 1323, 2608, 10018, 15668, 59838, 557493, 696873, 871098, 4153813,
28 15845608, 48357008, 118059138, 288230353, 360287948, 562949933, 703687423, 1099511613, 0
29 };
30 int next_quadratic_at = 0;
31
33 path.moveTo(0, 0);
34
35 int i = 1;
36 for (int points = 1; points < 2147483647; ) {
37 if (points == quadratic_at[next_quadratic_at]) {
38 path.quadTo(i, 0, i, 0);
39 next_quadratic_at++;
40 points += 2;
41 } else {
42 path.lineTo(i, 0);
43 points += 1;
44 }
45
46 i++;
47
48 if (i == 1000000) {
49 path.moveTo(0, 0);
50 points += 1;
51 i = 1;
52 }
53 }
54 canvas->drawPath(path.detach(), p);
55}
static const int points[]
void drawPath(const SkPath &path, const SkPaint &paint)
Definition: SkCanvas.cpp:1747
static sk_sp< SkPathEffect > Make(const SkScalar intervals[], int count, SkScalar phase)
@ 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
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