18 this->setX(SkSVGAttributeParser::parse<SkSVGLength>(
"x", n, v)) ||
19 this->setY(SkSVGAttributeParser::parse<SkSVGLength>(
"y", n, v)) ||
20 this->setWidth(SkSVGAttributeParser::parse<SkSVGLength>(
"width", n, v)) ||
21 this->setHeight(SkSVGAttributeParser::parse<SkSVGLength>(
"height", n, v)) ||
22 this->setHref(SkSVGAttributeParser::parse<SkSVGIRI>(
"xlink:href", n, v)) ||
23 this->setPreserveAspectRatio(SkSVGAttributeParser::parse<SkSVGPreserveAspectRatio>(
24 "preserveAspectRatio", n, v));
30 return !fHref.iri().isEmpty() && fWidth.value() > 0 && fHeight.value() > 0 &&
39 switch (href.
type()) {
50 SkDebugf(
"error loading image: unhandled iri type %d\n", (
int)href.
type());
85 if (!imgInfo.fImage) {
86 SkDebugf(
"can't render image: load image failed\n");
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static sk_sp< SkImage > LoadImage(const sk_sp< skresources::ResourceProvider > &rp, const SkSVGIRI &href)
void drawImageRect(const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
static SkString Basename(const char *fullPath)
static SkString Dirname(const char *fullPath)
const SkSVGStringType & iri() const
void onRender(const SkSVGRenderContext &) const override
bool parseAndSetAttribute(const char *, const char *) override
bool onPrepareToRender(SkSVGRenderContext *) const override
SkPath onAsPath(const SkSVGRenderContext &) const override
static ImageInfo LoadImage(const sk_sp< skresources::ResourceProvider > &, const SkSVGIRI &, const SkRect &, SkSVGPreserveAspectRatio)
SkRect onObjectBoundingBox(const SkSVGRenderContext &) const override
SkRect resolveRect(const SkSVGLength &x, const SkSVGLength &y, const SkSVGLength &w, const SkSVGLength &h) const
virtual bool parseAndSetAttribute(const char *name, const char *value)
static SkMatrix ComputeViewboxMatrix(const SkRect &, const SkRect &, SkSVGPreserveAspectRatio)
SkCanvas * canvas() const
const SkSVGLengthContext & lengthContext() const
const sk_sp< skresources::ResourceProvider > & resourceProvider() const
const char * c_str() const
virtual FrameData getFrameData(float t)
virtual sk_sp< ImageAsset > loadImageAsset(const char[], const char[], const char[]) const
sk_sp< const SkImage > image
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
DEF_SWITCHES_START aot vmservice shared library name
static SkRect Make(const SkISize &size)
SkScalar fLeft
smaller x-axis bounds
SkScalar fTop
smaller y-axis bounds