28#include <initializer_list>
42 canvas->
drawLine(startX, startY, finalX, finalY,
p);
58 paint.setStroke(
true);
67 SkISize getISize()
override {
return {640, 340}; }
69 void onDraw(
SkCanvas* canvas)
override {
76 paint.setStroke(
true);
81 for (
const Intervals&
data : {Intervals{1, 1},
83 for (
bool aa : {
false,
true}) {
85 paint.setAntiAlias(aa);
115 for (
int i = 1;
i < n;
i++) {
119 return b.close().detach();
145 SkISize getISize()
override {
return {640, 480}; }
147 void onDraw(
SkCanvas* canvas)
override {
148 constexpr int gIntervals[] = {
160 paint.setAntiAlias(
true);
161 paint.setStroke(
true);
169 const int* intervals = &gIntervals[1];
170 for (
int y = 0;
y < gIntervals[0]; ++
y) {
172 int count = *intervals++;
195 SkISize getISize()
override {
return {640, 480}; }
199 void drawDashedLines(
SkCanvas* canvas,
214 SkScalar intervals[2] = { dashLength, dashLength };
227 p.setAntiAlias(
true);
237 void onDraw(
SkCanvas* canvas)
override {
241 this->drawDashedLines(canvas, 100, 0,
SK_Scalar1, 1,
false);
265 this->drawDashedLines(canvas, 100, 0,
SkIntToScalar(255), 1,
false);
271 this->drawDashedLines(canvas, 100, 0,
SkIntToScalar(3), 3,
false);
277 this->drawDashedLines(canvas, 100, 1.5f,
SkIntToScalar(3), 3,
false);
289 this->drawDashedLines(canvas, 100, 0,
SkIntToScalar(3), 3,
true);
302 for (
int phase = 0; phase <= 3; ++phase) {
318 SkISize getISize()
override {
return {640, 1100}; }
320 void onDraw(
SkCanvas* canvas)
override {
327 paint.setStroke(
true);
333 for (
const Intervals&
data : {Intervals{1, 1},
338 for (
bool aa : {
false,
true}) {
341 paint.setAntiAlias(aa);
343 paint.setStrokeCap(cap);
355 for (
int aa = 0; aa <= 1; ++aa) {
357 paint.setStrokeWidth(8.f);
383 paint.setAntiAlias(
true);
385 paint.setColor(0x44000000);
386 paint.setStrokeWidth(40);
396 paint.setColor(0xFF000000);
397 paint.setStrokeWidth(11);
412 bool runAsBench()
const override {
return true; }
414 SkString getName()
const override {
return SkString(fDoAA ?
"dashing5_aa" :
"dashing5_bw"); }
416 SkISize getISize()
override {
return {400, 200}; }
418 void onDraw(
SkCanvas* canvas)
override {
419 constexpr int kOn = 4;
420 constexpr int kOff = 4;
421 constexpr int kIntervalLength =
kOn +
kOff;
435 paint.setStroke(
true);
437 paint.setAntiAlias(fDoAA);
448 for (
int x = 0;
x < 200;
x += 10) {
451 sign = (
x % 20) ? 1 : -1;
456 phase = (phase + 1) % kIntervalLength;
459 for (
int y = -400;
y < 0;
y += 10) {
462 sign = (
y % 20) ? 1 : -1;
467 phase = (phase + 1) % kIntervalLength;
477 for (
int x = 32;
x < 256;
x += 16) {
478 for (
SkScalar a = 0;
a < 3.141592f * 2;
a += 0.03141592f) {
482 { 256 + (
float) sin(
a + 3.141592 / 3) * (
x + 64),
483 256 + (
float) cos(
a + 3.141592 / 3) * (
x + 64) }
485 lines.moveTo(pts[0]);
487 lines.lineTo(pts[0].fX * (1 -
i) + pts[1].
fX *
i,
488 pts[0].
fY * (1 -
i) + pts[1].fY *
i);
493 p.setAntiAlias(
true);
496 const SkScalar intervals[] = { 1, 1 };
505 p.setAntiAlias(
true);
507 p.setStrokeWidth(80);
509 const SkScalar intervals[] = { 2, 2 };
517 constexpr int kHalfStrokeWidth = 8;
518 constexpr int kOnOffInterval = 2*kHalfStrokeWidth;
523 p.setAntiAlias(
true);
525 p.setStrokeWidth(2*kHalfStrokeWidth);
528 constexpr SkScalar intervals[] = { kOnOffInterval, kOnOffInterval };
531 constexpr float gWidthHeights[] = {
532 1000000000.0f * kOnOffInterval + kOnOffInterval/2.0f,
533 1000000.0f * kOnOffInterval + kOnOffInterval/2.0f,
534 1000.0f * kOnOffInterval + kOnOffInterval/2.0f,
535 100.0f * kOnOffInterval + kOnOffInterval/2.0f,
536 10.0f * kOnOffInterval + kOnOffInterval/2.0f,
537 9.0f * kOnOffInterval + kOnOffInterval/2.0f,
538 8.0f * kOnOffInterval + kOnOffInterval/2.0f,
539 7.0f * kOnOffInterval + kOnOffInterval/2.0f,
540 6.0f * kOnOffInterval + kOnOffInterval/2.0f,
541 5.0f * kOnOffInterval + kOnOffInterval/2.0f,
542 4.0f * kOnOffInterval + kOnOffInterval/2.0f,
548 int offset = 2 *
i * kHalfStrokeWidth + kHalfStrokeWidth;
555 p.setAntiAlias(
true);
562 wavy.
quadTo(
i + 5, 95,
i + 10, 100);
563 wavy.
quadTo(
i + 15, 105,
i + 20, 100);
570 p.setAntiAlias(
true);
572 p.setStrokeWidth(10);
575 p.setARGB(0xff, 0xbb, 0x00, 0x00);
579 const SkScalar intervals[] = { 12, 12 };
586 static constexpr SkScalar kIntervals[] = {5.f, 0.f, 2.f, 0.f};
592 static constexpr struct {
594 }
kLines[] = {{{0.5f, 0.5f}, {30.5f, 0.5f}},
595 {{0.5f, 0.5f}, {0.5f, 30.5f}},
596 {{0.5f, 0.5f}, {0.5f, 0.5f}},
597 {{0.5f, 0.5f}, {25.5f, 25.5f}}};
609 for (
auto aa : {
false,
true}) {
626 paint.setAntiAlias(
true);
631 static constexpr SkScalar kStep = kIntervals[0] + kIntervals[1];
633 canvas->
translate(kIntervals[1], kIntervals[1]);
635 paint.setStrokeCap(c);
660 float dashes[] = {2.f, 2.f};
static const int strokeWidth
static const SkColor gColors[]
constexpr SkColor SK_ColorYELLOW
constexpr SkColor SK_ColorMAGENTA
constexpr SkColor SK_ColorCYAN
constexpr SkColor SK_ColorGRAY
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorGREEN
constexpr SkColor SK_ColorDKGRAY
static int sign(SkScalar x)
#define SkScalarSin(radians)
#define SkScalarCos(radians)
#define SK_ScalarRoot2Over2
static constexpr bool SkToBool(const T &x)
static const SlideProc gProc[]
void drawRect(const SkRect &rect, const SkPaint &paint)
void drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint &paint)
void clear(SkColor color)
void rotate(SkScalar degrees)
void drawPath(const SkPath &path, const SkPaint &paint)
void scale(SkScalar sx, SkScalar sy)
void concat(const SkMatrix &matrix)
void drawString(const char str[], SkScalar x, SkScalar y, const SkFont &font, 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 RectToRect(const SkRect &src, const SkRect &dst, ScaleToFit mode=kFill_ScaleToFit)
@ kCenter_ScaleToFit
scales and aligns to center
bool rectStaysRect() const
SkMatrix & setRotate(SkScalar degrees, SkScalar px, SkScalar py)
@ kButt_Cap
no stroke extension
SkPathEffect * getPathEffect() const
void setAntiAlias(bool aa)
void setStrokeCap(Cap cap)
void setPathEffect(sk_sp< SkPathEffect > pathEffect)
SkScalar getStrokeWidth() const
void setStrokeWidth(SkScalar width)
SkPathBuilder & lineTo(SkPoint pt)
SkPathBuilder & moveTo(SkPoint pt)
static SkPath Rect(const SkRect &, SkPathDirection=SkPathDirection::kCW, unsigned startIndex=0)
SkPath & moveTo(SkScalar x, SkScalar y)
SkPath & quadTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2)
static SkPath Oval(const SkRect &, SkPathDirection=SkPathDirection::kCW)
static SkPath make_path_rect(const SkRect &bounds)
static SkPath make_unit_star(int n)
static SkPath make_path_line(const SkRect &bounds)
DEF_SIMPLE_GM(longpathdash, canvas, 612, 612)
static SkPath make_path_star(const SkRect &bounds)
static void show_zero_len_dash(SkCanvas *canvas)
static void drawline(SkCanvas *canvas, int on, int off, const SkPaint &paint, SkScalar finalX=SkIntToScalar(600), SkScalar finalY=SkIntToScalar(0), SkScalar phase=SkIntToScalar(0), SkScalar startX=SkIntToScalar(0), SkScalar startY=SkIntToScalar(0))
static void show_giant_dash(SkCanvas *canvas)
static SkPath make_path_oval(const SkRect &bounds)
static float max(float r, float g, float b)
constexpr SkColor4f kBlack
unsigned useCenter Optional< SkMatrix > matrix
Optional< SkRect > bounds
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
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
font
Font Metadata and Metrics.
void set(float x, float y)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
void offset(float dx, float dy)
static constexpr SkRect MakeWH(float w, float h)
std::shared_ptr< const fml::Mapping > data