38class PolystarGeometryAdapter final :
39 public DiscardableAdapterBase<PolystarGeometryAdapter, sksg::Path> {
46 const AnimationBuilder* abuilder,
Type t)
48 this->bind(*abuilder, jstar[
"pt"], fPointCount );
49 this->bind(*abuilder, jstar[
"p" ], fPosition );
50 this->bind(*abuilder, jstar[
"r" ], fRotation );
51 this->bind(*abuilder, jstar[
"ir"], fInnerRadius );
52 this->bind(*abuilder, jstar[
"or"], fOuterRadius );
53 this->bind(*abuilder, jstar[
"is"], fInnerRoundness);
54 this->bind(*abuilder, jstar[
"os"], fOuterRoundness);
58 void onSync()
override {
59 static constexpr int kMaxPointCount = 100000;
65 c.
y + r * std::sin(
a));
73 poly.
moveTo(pt_on_circle(fPosition, fOuterRadius, angle));
76 for (
unsigned i = 0;
i <
count; ++
i) {
77 if (fType == Type::kStar) {
78 poly.
lineTo(pt_on_circle(fPosition, fInnerRadius, angle + arc * 0.5f));
81 poly.
lineTo(pt_on_circle(fPosition, fOuterRadius, angle));
85 this->node()->setPath(poly.
detach());
103 static constexpr PolystarGeometryAdapter::Type gTypes[] = {
104 PolystarGeometryAdapter::Type::kStar,
105 PolystarGeometryAdapter::Type::kPoly,
108 const auto type = ParseDefault<size_t>(jstar[
"sy"], 0) - 1;
115 (jstar, abuilder, gTypes[
type]);
static constexpr float sk_ieee_float_divide(float numer, float denom)
#define SkDegreesToRadians(degrees)
#define SkScalarRoundToInt(x)
static constexpr const T & SkTPin(const T &x, const T &lo, const T &hi)
constexpr unsigned SkToUInt(S x)
SkPathBuilder & lineTo(SkPoint pt)
void incReserve(int extraPtCount, int extraVerbCount)
SkPathBuilder & moveTo(SkPoint pt)
void attachDiscardableAdapter(sk_sp< T > adapter) const
void log(Logger::Level, const skjson::Value *, const char fmt[],...) const SK_PRINTF_LIKE(4
static sk_sp< sksg::GeometryNode > AttachPolystarGeometry(const skjson::ObjectValue &, const AnimationBuilder *)
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 constexpr SkPoint Make(float x, float y)