460 {
462
465
466
468
469
470
471 float aaRadius =
params.transform().localAARadius(bounds);
472 float strokeInset = 0.f;
474
476
477
479
481 SkASSERT(shape.isRect() || shape.isLine() ||
params.strokeStyle().halfWidth() == 0.f ||
483
484 float strokeRadius =
params.strokeStyle().halfWidth();
485
488
490 if (
any(innerGap <= 0.f) && strokeRadius > 0.f) {
491
492 strokeInset = -strokeRadius;
493 } else {
494
496 strokeInset = strokeRadius;
497 }
498
500 if (strokeRadius > 0.f || shape.isLine()) {
501
502
503 float joinStyle =
params.strokeStyle().joinLimit();
504 float lineFlag = shape.isLine() ? 1.f : 0.f;
506
507
508
510
511
513 switch(
params.strokeStyle().cap()) {
517 }
518 }
else if (
params.strokeStyle().isMiterJoin()) {
519
520
521
523 joinStyle = 0.f;
524 } else {
525
526 joinStyle = 1.f;
527 }
528 }
529
530
531
532 vw << -2.f << lineFlag << strokeRadius << joinStyle << xRadii
533 << (shape.isLine() ? shape.line() :
bounds.ltrb());
534 } else {
535
536
537
539 vw << (-2.f - xRadii) << yRadii <<
bounds.ltrb();
540 }
541 } else {
542
544
545 if (
params.geometry().isEdgeAAQuad()) {
546
547
548 const EdgeAAQuad& quad =
params.geometry().edgeAAQuad();
549
550
551
552
554 aaRadius = 0.f;
555 }
556
557
558 auto edgeSigns =
skvx::float4{quad.edgeFlags() & AAFlags::kLeft ? -1.f : 0.f,
559 quad.edgeFlags() & AAFlags::kTop ? -1.f : 0.f,
560 quad.edgeFlags() & AAFlags::kRight ? -1.f : 0.f,
561 quad.edgeFlags() & AAFlags::kBottom ? -1.f : 0.f};
562
563
564
566 vw << edgeSigns << quad.xs() << quad.ys();
567 } else {
568 vw << skvx::shuffle<2,1,0,3>(edgeSigns)
569 << skvx::shuffle<1,0,3,2>(quad.xs())
570 << skvx::shuffle<1,0,3,2>(quad.ys());
571 }
572 } else {
574
576
577 if (shape.isRect() || (shape.isRRect() && shape.rrect().isRect())) {
578
579
582 << skvx::shuffle<0,2,2,0>(ltrb)
583 << skvx::shuffle<1,1,3,3>(ltrb);
584 } else {
585
586
588
590 }
591 }
592 }
593
598 }
599 }
600
601
605 vw <<
center << centerWeight << aaRadius
606 <<
params.order().depthAsFloat()
607 << ssboIndices
608 <<
m.rc(0,0) <<
m.rc(1,0) <<
m.rc(3,0)
609 <<
m.rc(0,1) <<
m.rc(1,1) <<
m.rc(3,1)
610 <<
m.rc(0,3) <<
m.rc(1,3) <<
m.rc(3,3);
611}
static SkScalar center(float pos0, float pos1)
@ kButt_Cap
no stroke extension
static bool AllCornersCircular(const SkRRect &rr, SkScalar tolerance=SK_ScalarNearlyZero)
const EmbeddedViewParams * params
EMSCRIPTEN_KEEPALIVE void empty()
Optional< SkRect > bounds
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
static bool opposite_insets_intersect(const SkRRect &rrect, float strokeRadius, float aaRadius)
static constexpr float kComplexAAInsets
static constexpr float kFilledStrokeInterior
static bool is_clockwise(const EdgeAAQuad &quad)
static skvx::float4 load_x_radii(const SkRRect &rrect)
static constexpr float kSolidInterior
static constexpr float kStrokeInterior
static skvx::float4 load_y_radii(const SkRRect &rrect)
static skvx::float2 quad_center(const EdgeAAQuad &quad)
SIT bool all(const Vec< 1, T > &x)
SIT bool any(const Vec< 1, T > &x)