50 if (
const auto* clipPath = localContext.
clipPath()) {
70 const auto display = fPresentationAttributes.
fDisplay;
81 if (
value.type() != T::Type::kInherit) {
86 presentation_attribute.
reset();
91#define PARSE_AND_SET(svgName, attrName) \
92 this->set##attrName( \
93 SkSVGAttributeParser::parseProperty<decltype(fPresentationAttributes.f##attrName)>( \
100 ||
PARSE_AND_SET(
"color-interpolation-filters", ColorInterpolationFilters)
139 auto compute_scale = [&]() ->
SkV2 {
140 const auto sx = viewPort.
width() / viewBox.
width(),
156 static constexpr float gAlignCoeffs[] = {
162 const size_t x_coeff = par.
fAlign >> 0 & 0x03,
163 y_coeff = par.
fAlign >> 2 & 0x03;
165 SkASSERT(x_coeff < std::size(gAlignCoeffs) &&
166 y_coeff < std::size(gAlignCoeffs));
168 const auto tx = -viewBox.
x() *
scale.x,
169 ty = -viewBox.
y() *
scale.y,
174 tx + dx * gAlignCoeffs[x_coeff],
175 ty + dy * gAlignCoeffs[y_coeff]
179 const auto s = compute_scale(),
180 t = compute_trans(
s);
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorWHITE
@ kIntersect_SkPathOp
intersect the two paths
void SetInheritedByDefault(SkTLazy< T > &presentation_attribute, const T &value)
#define PARSE_AND_SET(svgName, attrName)
static SkMatrix Scale(SkScalar sx, SkScalar sy)
static SkMatrix Translate(SkScalar dx, SkScalar dy)
SkRect objectBoundingBox(const SkSVGRenderContext &) const
void render(const SkSVGRenderContext &) const
virtual bool parseAndSetAttribute(const char *name, const char *value)
virtual SkRect onObjectBoundingBox(const SkSVGRenderContext &) const
void setAttribute(SkSVGAttribute, const SkSVGValue &)
bool asPaint(const SkSVGRenderContext &, SkPaint *) const
virtual void onRender(const SkSVGRenderContext &) const =0
virtual bool onAsPaint(const SkSVGRenderContext &, SkPaint *) const
SkPath asPath(const SkSVGRenderContext &) const
static SkMatrix ComputeViewboxMatrix(const SkRect &, const SkRect &, SkSVGPreserveAspectRatio)
virtual void onSetAttribute(SkSVGAttribute, const SkSVGValue &)
virtual bool onPrepareToRender(SkSVGRenderContext *) const
virtual bool hasChildren() const
virtual SkPath onAsPath(const SkSVGRenderContext &) const =0
void set(SkSVGPropertyState state)
const SkSVGPresentationContext & presentationContext() const
const SkPath * clipPath() const
void applyPresentationAttributes(const SkSVGPresentationAttributes &, uint32_t flags)
constexpr float x() const
constexpr float y() const
constexpr float height() const
constexpr float width() const
SkSVGProperty< SkSVGColor, false > fLightingColor
SkSVGProperty< SkSVGColor, false > fStopColor
SkSVGProperty< SkSVGDisplay, false > fDisplay
SkSVGProperty< SkSVGVisibility, true > fVisibility
SkSVGProperty< SkSVGNumberType, false > fFloodOpacity
SkSVGProperty< SkSVGColor, false > fFloodColor
SkSVGProperty< SkSVGNumberType, false > fStopOpacity
SkSVGPresentationAttributes fInherited