public SVGGradient parseGradient(Attributes pAttributes, bool pLinear) { string id = pAttributes.GetStringAttribute(SVGConstants.ATTRIBUTE_ID); if (id == null) { return(null); } SVGGradient svgGradient = new SVGGradient(id, pLinear, pAttributes); this.mSVGGradientMap[id] = svgGradient; return(svgGradient); }
private void resolveHref(Dictionary <String, SVGGradient> pSVGGradientMap) { SVGGradient parent = pSVGGradientMap[this.mHref]; if (parent == null) { throw new SVGParseException("Could not resolve href: '" + this.mHref + "' of SVGGradient: '" + this.mID + "'."); } else { parent.ensureHrefResolved(pSVGGradientMap); this.mParent = parent; this.mSVGAttributes.setParentSVGAttributes(this.mParent.mSVGAttributes); if (this.mSVGGradientStops == null) { this.mSVGGradientStops = this.mParent.mSVGGradientStops; this.mSVGGradientStopsColors = this.mParent.mSVGGradientStopsColors; this.mSVGGradientStopsPositions = this.mParent.mSVGGradientStopsPositions; } } }
Shader getGradientShader(string pGradientShaderID) { SVGGradient svgGradient = this.mSVGGradientMap[pGradientShaderID]; if (svgGradient == null) { throw new SVGParseException("No SVGGradient found for id: '" + pGradientShaderID + "'."); } else { Shader gradientShader = svgGradient.getShader(); if (gradientShader != null) { return(gradientShader); } else { svgGradient.ensureHrefResolved(this.mSVGGradientMap); return(svgGradient.createShader()); } } }
void parseRadialGradient(Attributes pAttributes) { this.mCurrentSVGGradient = this.mSVGPaint.parseGradient(pAttributes, false); }
void parseLinearGradient(Attributes pAttributes) { this.mCurrentSVGGradient = this.mSVGPaint.parseGradient(pAttributes, true); }
private void resolveHref(Dictionary<String, SVGGradient> pSVGGradientMap) { SVGGradient parent = pSVGGradientMap[this.mHref]; if(parent == null) { throw new SVGParseException("Could not resolve href: '" + this.mHref + "' of SVGGradient: '" + this.mID + "'."); } else { parent.ensureHrefResolved(pSVGGradientMap); this.mParent = parent; this.mSVGAttributes.setParentSVGAttributes(this.mParent.mSVGAttributes); if(this.mSVGGradientStops == null) { this.mSVGGradientStops = this.mParent.mSVGGradientStops; this.mSVGGradientStopsColors = this.mParent.mSVGGradientStopsColors; this.mSVGGradientStopsPositions = this.mParent.mSVGGradientStopsPositions; } } }
public SVGGradient parseGradient(Attributes pAttributes, bool pLinear) { string id = pAttributes.GetStringAttribute(SVGConstants.ATTRIBUTE_ID); if(id == null) { return null; } SVGGradient svgGradient = new SVGGradient(id, pLinear, pAttributes); this.mSVGGradientMap[id] = svgGradient; return svgGradient; }