34class FillStrokeAdapter final :
public DiscardableAdapterBase<FillStrokeAdapter, sksg::PaintNode> {
39 const AnimationBuilder& abuilder,
46 this->attachDiscardableAdapter(std::move(gradient_adapter));
48 this->bind(abuilder, jpaint[
"o"], fOpacity);
50 this->node()->setAntiAlias(
true);
52 if (
type == Type::kStroke) {
53 this->bind(abuilder, jpaint[
"w"], fStrokeWidth);
56 this->node()->setStrokeMiter(ParseDefault<SkScalar>(jpaint[
"ml"], 4.0f));
63 this->node()->setStrokeJoin(
64 gJoins[std::min<size_t>(ParseDefault<size_t>(jpaint[
"lj"], 1) - 1,
72 this->node()->setStrokeCap(
73 gCaps[std::min<size_t>(ParseDefault<size_t>(jpaint[
"lc"], 1) - 1,
78 this->bind(abuilder, jpaint[
"c"], fColor);
83 void onSync()
override {
84 this->node()->setOpacity(fOpacity * 0.01f);
85 this->node()->setStrokeWidth(fStrokeWidth);
88 auto* color_node =
static_cast<sksg::Color*
>(this->node().get());
89 color_node->setColor(fColor);
101 using INHERITED = DiscardableAdapterBase<FillStrokeAdapter, sksg::PaintNode>;
104class DashAdapter final :
public DiscardableAdapterBase<DashAdapter, sksg::DashEffect> {
107 const AnimationBuilder& abuilder,
114 const auto interval_count = jdash.
size() - 1;
117 for (
size_t i = 0;
i < jdash.
size(); ++
i) {
119 auto*
target =
i < interval_count
122 this->bind(abuilder, (*jint)[
"v"],
target);
128 void onSync()
override {
129 this->node()->setPhase(fOffset);
136 using INHERITED = DiscardableAdapterBase<DashAdapter, sksg::DashEffect>;
142 const AnimationBuilder* abuilder,
145 return abuilder->attachDiscardableAdapter<FillStrokeAdapter>
148 std::move(paint_node),
150 FillStrokeAdapter::Type::kFill);
154 const AnimationBuilder* abuilder,
157 return abuilder->attachDiscardableAdapter<FillStrokeAdapter>
160 std::move(paint_node),
162 FillStrokeAdapter::Type::kStroke);
168 auto color_paint = AttachFill(jpaint, abuilder, color_node);
176 auto color_paint = AttachStroke(jpaint, abuilder, color_node);
187 if (jdash && jdash->
size() > 1) {
188 for (
size_t i = 0;
i < geos.size(); ++
i) {
190 *jdash, *abuilder, std::move(geos[
i]));
194 return std::move(geos);
static constexpr SkColor kColor
constexpr SkColor SK_ColorBLACK
#define INHERITED(method,...)
@ kButt_Cap
no stroke extension
@ kStroke_Style
set to stroke geometry
@ kMiter_Join
extends to miter limit
@ kBevel_Join
connects outside edges
bool dispatchColorProperty(const sk_sp< sksg::Color > &) const
void attachDiscardableAdapter(sk_sp< T > adapter) const
static sk_sp< sksg::PaintNode > AttachColorStroke(const skjson::ObjectValue &, const AnimationBuilder *)
static sk_sp< sksg::PaintNode > AttachColorFill(const skjson::ObjectValue &, const AnimationBuilder *)
static std::vector< sk_sp< sksg::GeometryNode > > AdjustStrokeGeometry(const skjson::ObjectValue &, const AnimationBuilder *, std::vector< sk_sp< sksg::GeometryNode > > &&)
static sk_sp< Color > Make(SkColor c)
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
@ kStroke
strokes boundary of shapes
@ kFill
fills interior of shapes
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
@ kColor
hue and saturation of source with luminosity of destination