Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
DashBench.cpp File Reference
#include "bench/Benchmark.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "include/core/SkPathEffect.h"
#include "include/core/SkString.h"
#include "include/core/SkStrokeRec.h"
#include "include/effects/SkDashPathEffect.h"
#include "include/private/base/SkTDArray.h"
#include "src/base/SkRandom.h"

Go to the source code of this file.

Classes

class  DashBench
 
class  RectDashBench
 
class  MakeDashBench
 
class  DashLineBench
 
class  DrawPointsDashingBench
 
class  GiantDashBench
 
class  DashGridBench
 

Macros

#define PARAM(array)   array, std::size(array)
 

Functions

static void path_hline (SkPath *path)
 
static void make_unit_star (SkPath *path, int n)
 
static void make_poly (SkPath *path)
 
static void make_quad (SkPath *path)
 
static void make_cubic (SkPath *path)
 
 DEF_BENCH (return new DashBench(PARAM(gDots), 0);) DEF_BENCH(return new DashBench(PARAM(gDots)
 
 DEF_BENCH (return new DashBench(PARAM(gDots), 1, true);) DEF_BENCH(return new DashBench(PARAM(gDots)
 

Variables

static const SkScalar gDots [] = { SK_Scalar1, SK_Scalar1 }
 

Macro Definition Documentation

◆ PARAM

#define PARAM (   array)    array, std::size(array)

Definition at line 442 of file DashBench.cpp.

Function Documentation

◆ DEF_BENCH() [1/2]

DEF_BENCH ( return new DashBench(PARAM(gDots), 0);   )
new

◆ DEF_BENCH() [2/2]

DEF_BENCH ( return new DashBench(PARAM(gDots), 1, true);   )
new

◆ make_cubic()

static void make_cubic ( SkPath path)
static

Definition at line 165 of file DashBench.cpp.

165 {
166 SkScalar x0 = SkIntToScalar(10);
167 SkScalar y0 = SkIntToScalar(10);
168 path->moveTo(x0, y0);
169 path->cubicTo(x0, y0 + 400 * SK_Scalar1,
170 x0 + 600 * SK_Scalar1, y0 + 400 * SK_Scalar1,
171 x0 + 600 * SK_Scalar1, y0);
172}
#define SK_Scalar1
Definition SkScalar.h:18
#define SkIntToScalar(x)
Definition SkScalar.h:57
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

◆ make_poly()

static void make_poly ( SkPath path)
static

Definition at line 151 of file DashBench.cpp.

151 {
152 make_unit_star(path, 9);
153 const SkMatrix matrix = SkMatrix::Scale(100, 100);
154 path->transform(matrix);
155}
static void make_unit_star(SkPath *path, int n)
static SkMatrix Scale(SkScalar sx, SkScalar sy)
Definition SkMatrix.h:75
unsigned useCenter Optional< SkMatrix > matrix
Definition SkRecords.h:258

◆ make_quad()

static void make_quad ( SkPath path)
static

Definition at line 157 of file DashBench.cpp.

157 {
158 SkScalar x0 = SkIntToScalar(10);
159 SkScalar y0 = SkIntToScalar(10);
160 path->moveTo(x0, y0);
161 path->quadTo(x0, y0 + 400 * SK_Scalar1,
162 x0 + 600 * SK_Scalar1, y0 + 400 * SK_Scalar1);
163}

◆ make_unit_star()

static void make_unit_star ( SkPath path,
int  n 
)
static

Definition at line 139 of file DashBench.cpp.

139 {
140 SkScalar rad = -SK_ScalarPI / 2;
141 const SkScalar drad = (n >> 1) * SK_ScalarPI * 2 / n;
142
143 path->moveTo(0, -SK_Scalar1);
144 for (int i = 1; i < n; i++) {
145 rad += drad;
146 path->lineTo(SkScalarCos(rad), SkScalarSin(rad));
147 }
148 path->close();
149}
#define SkScalarSin(radians)
Definition SkScalar.h:45
#define SkScalarCos(radians)
Definition SkScalar.h:46
#define SK_ScalarPI
Definition SkScalar.h:21

◆ path_hline()

static void path_hline ( SkPath path)
static

Definition at line 27 of file DashBench.cpp.

27 {
28 path->moveTo(SkIntToScalar(10), SkIntToScalar(10));
29 path->lineTo(SkIntToScalar(600), SkIntToScalar(10));
30}

Variable Documentation

◆ gDots

const SkScalar gDots[] = { SK_Scalar1, SK_Scalar1 }
static

Definition at line 440 of file DashBench.cpp.