[SVGDom] Fix href handling for radial gradients

Currently, the href logic only visits linear gradient nodes.  Update to
also visit radial gradients, per
https://www.w3.org/TR/SVG/pservers.html#RadialGradientElementHrefAttribute.
Change-Id: I8d33d9faa65dae776c13e134c497acccfb428abb
Reviewed-on: https://skia-review.googlesource.com/57480
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This commit is contained in:
Florin Malita 2017-10-09 22:11:50 -04:00 committed by Skia Commit-Bot
parent 874d8aef9a
commit 532a091626

View File

@ -67,7 +67,8 @@ void SkSVGGradient::collectColorStops(const SkSVGRenderContext& ctx,
if (pos->empty() && !fHref.value().isEmpty()) {
const auto* ref = ctx.findNodeById(fHref);
if (ref && ref->tag() == SkSVGTag::kLinearGradient) {
if (ref && (ref->tag() == SkSVGTag::kLinearGradient ||
ref->tag() == SkSVGTag::kRadialGradient)) {
static_cast<const SkSVGGradient*>(ref)->collectColorStops(ctx, pos, colors);
}
}