26constexpr SkScalar kSweeps[] = {1.f, 45.f, 90.f, 130.f, 180.f, 184.f, 300.f, 355.f};
29constexpr int kW = 1000;
30constexpr int kH = 1000;
35 auto drawGrid = [canvas, &configureStyle] (
SkScalar x,
SkScalar y,
bool useCenter,
bool aa) {
67 drawGrid(0.f , 0.f ,
false,
false);
68 drawGrid(kGridW, 0.f ,
true ,
false);
69 drawGrid(0.f , kGridH,
false,
true );
70 drawGrid(kGridW, kGridH,
true ,
true );
79#define DEF_ARC_GM(name) DEF_SIMPLE_GM(circular_arcs_##name, canvas, kW, kH)
82 auto setFill = [] (
SkPaint*
p) {
p->setStroke(
false); };
89 p->setStrokeWidth(0.f);
125 const Arc noDrawArcs[] = {
166 constexpr SkScalar kDashIntervals[] = {
kS / 15, 2 *
kS / 15};
172 for (
auto arc : noDrawArcs) {
173 for (
auto paint : paints) {
174 paint.setAntiAlias(
true);
175 canvas->
drawArc(arc.fOval, arc.fStart, arc.fSweep,
false,
paint);
176 canvas->
drawArc(arc.fOval, arc.fStart, arc.fSweep,
true,
paint);
187 for (
auto paint : paints) {
188 paint.setAntiAlias(
true);
190 for (
auto arc : arcs) {
191 canvas->
drawArc(arc.fOval, arc.fStart, arc.fSweep,
false,
paint);
194 for (
auto arc : arcs) {
195 canvas->
drawArc(arc.fOval, arc.fStart, arc.fSweep,
true,
paint);
234 stroke.setStrokeWidth(2.0f);
236 int y0 = 25, y1 = 75, y2 = 125;
237 for (
int r = 2; r <= 20; ++r) {
248 static constexpr SkScalar kStart = 89.f;
275 int baseMatrixCnt = matrices.
size();
280 for (
int i = 0;
i < baseMatrixCnt; ++
i) {
285 for (
int i = 0;
i < baseMatrixCnt; ++
i) {
290 for (
int i = 0;
i < baseMatrixCnt; ++
i) {
300 for (
const auto&
m : matrices) {
302 paint.setStrokeCap(cap);
303 paint.setAntiAlias(
true);
304 paint.setStroke(
true);
310 paint.setAlpha(0x80);
313 paint.setAlpha(0x80);
317 if (
x == baseMatrixCnt) {
326 auto addCanvas2dCircleArcTo = [](
float cx,
float cy,
float radius,
SkPath*
path) {
329 path->arcTo(
oval, 0.f, -180.f,
false);
330 path->arcTo(
oval, -180.f, -180.f,
false);
336 static constexpr float kRadius = 31000.f;
338 addCanvas2dCircleArcTo(0.f,
kRadius + 10.f,
kRadius, &strokedCircle);
339 addCanvas2dCircleArcTo(0.f,
kRadius + 10.f,
kRadius + 5.f, &strokedCircle);
344 canvas->
drawPath(strokedCircle, fill);
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorBLACK
static float SkBits2Float(uint32_t bits)
DEF_SIMPLE_GM(circular_arcs_weird, canvas, 1000, 400)
void draw_arcs(SkCanvas *canvas, std::function< void(SkPaint *)> configureStyle)
constexpr SkScalar kSweeps[]
constexpr SkScalar kDiameter
constexpr SkScalar kStarts[]
void translate(SkScalar dx, SkScalar dy)
void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint &paint)
void drawArc(const SkRect &oval, SkScalar startAngle, SkScalar sweepAngle, bool useCenter, const SkPaint &paint)
void drawPath(const SkPath &path, const SkPaint &paint)
void concat(const SkMatrix &matrix)
static sk_sp< SkPathEffect > Make(const SkScalar intervals[], int count, SkScalar phase)
SkMatrix & setAll(SkScalar scaleX, SkScalar skewX, SkScalar transX, SkScalar skewY, SkScalar scaleY, SkScalar transY, SkScalar persp0, SkScalar persp1, SkScalar persp2)
SkMatrix & setRotate(SkScalar degrees, SkScalar px, SkScalar py)
static const SkMatrix & I()
SkMatrix & setConcat(const SkMatrix &a, const SkMatrix &b)
@ kButt_Cap
no stroke extension
void setStyle(Style style)
void setColor(SkColor color)
void setAntiAlias(bool aa)
@ kStrokeAndFill_Style
sets to stroke and fill geometry
void setPathEffect(sk_sp< SkPathEffect > pathEffect)
void setStrokeWidth(SkScalar width)
void setFillType(SkPathFillType ft)
Dart_NativeFunction function
Optional< SkRect > bounds
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
constexpr SkScalar kStrokeWidth
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
constexpr float height() const
constexpr float width() const
static constexpr SkRect MakeWH(float w, float h)
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)