Example #1
0
        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);
        }
Example #2
0
        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;
                }
            }
        }
Example #3
0
        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());
                }
            }
        }
Example #4
0
 void parseRadialGradient(Attributes pAttributes)
 {
     this.mCurrentSVGGradient = this.mSVGPaint.parseGradient(pAttributes, false);
 }
Example #5
0
 void parseLinearGradient(Attributes pAttributes)
 {
     this.mCurrentSVGGradient = this.mSVGPaint.parseGradient(pAttributes, true);
 }
Example #6
0
		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;
				}
			}
		}
Example #7
0
		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;
		}
Example #8
0
		void parseRadialGradient(Attributes pAttributes) {
			this.mCurrentSVGGradient = this.mSVGPaint.parseGradient(pAttributes, false);
		}
Example #9
0
		void parseLinearGradient(Attributes pAttributes) {
			this.mCurrentSVGGradient = this.mSVGPaint.parseGradient(pAttributes, true);
		}