42 bool doClip =
false) {
69 paint.setAntiAlias(
false);
89 for (
int i = 0;
i <
N; ++
i) {
109 if (!
path.isLine(pts) || pts[0].
fY != pts[1].
fY) {
114 rect.fTop = pts[0].
fY -
paint.getStrokeWidth() / 2;
120 p.setPathEffect(
nullptr);
125 for (
int i = 0;
i <
N*10; ++
i) {
127 for (
int j = 0; j <
count; ++j) {
144 for (
int i = 1;
i < n;
i++) {
160 path->moveTo(x0, y0);
168 path->moveTo(x0, y0);
190 return fName.c_str();
195 for (
int i = 0;
i < loops; ++
i) {
218 fName.printf(
"dashline_%g_%s",
width, isRound ?
"circle" :
"square");
219 fStrokeWidth =
width;
228 return fName.c_str();
234 paint.setStrokeWidth(fStrokeWidth);
236 paint.setPathEffect(fPE);
237 for (
int i = 0;
i < loops; ++
i) {
257 fName.printf(
"drawpointsdash_%d_%d%s", dashLength,
strokeWidth, doAA ?
"_aa" :
"_bw");
267 return fName.c_str();
276 p.setPathEffect(fPathEffect);
277 p.setAntiAlias(fDoAA);
284 for (
int i = 0;
i < loops; ++
i) {
310 static const char* gNames[] = {
"hori",
"vert",
"diag" };
317 fStrokeWidth =
width;
321 const SkScalar intervals[] = { 20, 10, 10, 10 };
333 matrix.setRotate(90, cx, cy);
336 matrix.setRotate(45, cx, cy);
343 const SkScalar overshoot = 100*1000;
345 { -overshoot, cy }, { 640 + overshoot, cy }
352 return fName.c_str();
359 p.setStrokeWidth(fStrokeWidth);
360 p.setPathEffect(fPathEffect);
362 for (
int i = 0;
i < loops;
i++) {
382 fName.printf(
"dashgrid_%d_%d%s", dashLength,
strokeWidth, doAA ?
"_aa" :
"_bw");
392 return fName.c_str();
401 p.setPathEffect(fPathEffect);
402 p.setAntiAlias(fDoAA);
411 for (
int i = 0;
i < loops; ++
i) {
412 for (
int j = 0; j < 10; ++j) {
413 for (
int k = 0; k < 10; ++k) {
416 horPts[0].
fX = pts[0].
fX + k * 22.f;
417 horPts[0].
fY = pts[0].
fY + j * 22.f;
418 horPts[1].
fX = pts[1].
fX + k * 22.f;
419 horPts[1].
fY = pts[1].
fY + j * 22.f;
424 vertPts[0].
fX = pts[2].
fX + k * 22.f;
425 vertPts[0].
fY = pts[2].
fY + j * 22.f;
426 vertPts[1].
fX = pts[3].
fX + k * 22.f;
427 vertPts[1].
fY = pts[3].
fY + j * 22.f;
442#define PARAM(array) array, std::size(array)
468#ifndef SK_BUILD_FOR_ANDROID
static const int strokeWidth
static const SkScalar gDots[]
static void path_hline(SkPath *path)
static void make_cubic(SkPath *path)
static void make_quad(SkPath *path)
DEF_BENCH(return new DashBench(PARAM(gDots), 0);) DEF_BENCH(return new DashBench(PARAM(gDots)
static void make_unit_star(SkPath *path, int n)
static void make_poly(SkPath *path)
constexpr SkColor SK_ColorBLACK
#define SkScalarSin(radians)
#define SkScalarRoundToInt(x)
#define SkScalarCos(radians)
virtual void setupPaint(SkPaint *paint)
DashBench(const SkScalar intervals[], int count, int width, bool doClip=false)
const char * onGetName() override
virtual void makePath(SkPath *path)
SkTDArray< SkScalar > fIntervals
virtual void handlePath(SkCanvas *canvas, const SkPath &path, const SkPaint &paint, int N)
void onDraw(int loops, SkCanvas *canvas) override
void onDraw(int loops, SkCanvas *canvas) override
DashGridBench(int dashLength, int strokeWidth, bool doAA)
const char * onGetName() override
const char * onGetName() override
void onDraw(int loops, SkCanvas *canvas) override
DashLineBench(SkScalar width, bool isRound)
void onDraw(int loops, SkCanvas *canvas) override
const char * onGetName() override
DrawPointsDashingBench(int dashLength, int strokeWidth, bool doAA)
static const char * LineTypeName(LineType lt)
void onDraw(int loops, SkCanvas *canvas) override
const char * onGetName() override
GiantDashBench(LineType lt, SkScalar width)
const char * onGetName() override
void onDraw(int loops, SkCanvas *) override
MakeDashBench(void(*proc)(SkPath *), const char name[])
void handlePath(SkCanvas *canvas, const SkPath &path, const SkPaint &paint, int N) override
RectDashBench(const SkScalar intervals[], int count, int width)
void drawRect(const SkRect &rect, const SkPaint &paint)
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint &paint)
void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint &paint)
void drawPath(const SkPath &path, const SkPaint &paint)
@ kLines_PointMode
draw each pair of points as a line segment
static sk_sp< SkPathEffect > Make(const SkScalar intervals[], int count, SkScalar phase)
static SkMatrix Scale(SkScalar sx, SkScalar sy)
@ kStroke_Style
set to stroke geometry
@ kFill_Style
set to fill geometry
bool filterPath(SkPath *dst, const SkPath &src, SkStrokeRec *, const SkRect *cullR) const
void printf(const char format[],...) SK_PRINTF_LIKE(2
void append(const char text[])
const char * c_str() const
unsigned useCenter Optional< SkMatrix > matrix
sk_sp< SkBlender > blender SkRect rect
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
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
DEF_SWITCHES_START aot vmservice shared library name
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
void set(float x, float y)
void inset(float dx, float dy)
void offset(float dx, float dy)
constexpr float height() const