36 int width = kNumPolygons * kCellSize + 40;
37 int height = (kNumJoins * kNumStrokeWidths + kNumExtraStyles) *
kCellSize + 40;
43 SkPoint p0[] = {{0, 0}, {60, 0}, {90, 40}};
44 SkPoint p1[] = {{0, 0}, {0, 40}, {60, 40}, {40, 0}};
45 SkPoint p2[] = {{0, 0}, {40, 40}, {80, 40}, {40, 0}};
46 SkPoint p3[] = {{10, 0}, {50, 0}, {60, 10}, {60, 30}, {50, 40},
47 {10, 40}, {0, 30}, {0, 10}};
49 SkPoint p5[] = {{0, 0}, {20, 20}, {0, 40}, {60, 20}};
50 SkPoint p6[] = {{0, 40}, {0, 30}, {15, 30}, {15, 20}, {30, 20},
51 {30, 10}, {45, 10}, {45, 0}, {60, 0}, {60, 40}};
52 SkPoint p7[] = {{0, 20}, {20, 20}, {30, 0}, {40, 20}, {60, 20},
53 {45, 30}, {55, 50}, {30, 40}, {5, 50}, {15, 30}};
75 for (
size_t pgIndex = 0; pgIndex <
std::size(pgs); ++pgIndex) {
77 b.moveTo(pgs[pgIndex].fPoints[0].fX,
78 pgs[pgIndex].fPoints[0].fY);
79 for (
size_t ptIndex = 1; ptIndex < pgs[pgIndex].fPointNum; ++ptIndex) {
80 b.lineTo(pgs[pgIndex].fPoints[ptIndex].fX,
81 pgs[pgIndex].fPoints[ptIndex].fY);
99 if (40 ==
paint->getStrokeWidth()) {
100 paint->setAlpha(0xA0);
108 constexpr int kStrokeWidths[] = {0, 10, 40};
118 paint.setAntiAlias(
true);
125 for (
int i = 0;
i < fPolygons.
size(); ++
i) {
148 for (
int style = 0; style < kNumExtraStyles; ++style) {
149 paint.setStyle(kStyles[style]);
150 for (
int i = 0;
i < fPolygons.
size(); ++
i) {
162 inline static constexpr int kNumPolygons = 8;
163 inline static constexpr int kCellSize = 100;
164 inline static constexpr int kNumExtraStyles = 2;
165 inline static constexpr int kNumStrokeWidths = 3;
166 inline static constexpr int kNumJoins = 3;
169 using INHERITED =
GM;
174DEF_GM(
return new PolygonsGM;)
179 b.moveTo(0.f, 120.f);
181 b.lineTo(50.f, 330.f);
183 b.lineTo(340.f, 0.f);
184 b.lineTo(90.f, 330.f);
185 b.lineTo(50.f, 330.f);
189 paint.setAntiAlias(
true);
190 canvas->drawPath(
b.detach(),
paint);
#define SkScalarSin(radians)
#define SkScalarCos(radians)
void translate(SkScalar dx, SkScalar dy)
void drawPath(const SkPath &path, const SkPaint &paint)
@ kStroke_Style
set to stroke geometry
@ kFill_Style
set to fill geometry
@ kStrokeAndFill_Style
sets to stroke and fill geometry
@ kMiter_Join
extends to miter limit
@ kBevel_Join
connects outside edges
GM(SkColor backgroundColor=SK_ColorWHITE)
SkISize getISize() override
void onOnceBeforeDraw() override
static void SetColorAndAlpha(SkPaint *paint, SkRandom *rand)
static void SetLocation(SkCanvas *canvas, int counter, int lineNum)
void onDraw(SkCanvas *canvas) override
SkString getName() const override
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
DEF_GM(return F(C(clipbox), 0.0f, 0.0f, {})) DEF_GM(return F(C(clipbox)
DEF_SIMPLE_GM(hugebitmapshader, canvas, 100, 100)
static SkString join(const CommandLineFlags::StringArray &)
static constexpr SkISize Make(int32_t w, int32_t h)
void set(float x, float y)