ctx);
default:
throw new Error(); // can't be reached
}
} else { // SVGPaint
SVGPaint p = (SVGPaint)paintDef;
Paint paint = null;
switch (p.getPaintType()) {
case SVGPaint.SVG_PAINTTYPE_NONE:
return null; // 'none'
case SVGPaint.SVG_PAINTTYPE_RGBCOLOR:
return convertColor(p.getRGBColor(), opacity);
/* -- The one which is missing in our current SVG DOM bindings --
case SVGPaint.SVG_PAINTTYPE_URI:
return convertURIPaint(paintedElement,
paintedNode,
p,
opacity,
ctx);
*/
case SVGPaint.SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR:
return convertRGBICCColor(paintedElement,
(SVGColor)paintDef,
opacity,
ctx);
case SVGPaint.SVG_PAINTTYPE_URI_NONE:
return silentConvertURIPaint(paintedElement,
paintedNode,
(SVGPaint)paintDef,
opacity,
ctx);
case SVGPaint.SVG_PAINTTYPE_URI_CURRENTCOLOR:
paint = silentConvertURIPaint(paintedElement,
paintedNode,
(SVGPaint)paintDef,
opacity,
ctx);
if (paint == null) { // no paint found
CSSOMReadOnlyStyleDeclaration decl =
CSSUtilities.getComputedStyle(paintedElement);
CSSValue v
= decl.getPropertyCSSValueInternal(CSS_COLOR_PROPERTY);
paint = convertColor
(((CSSPrimitiveValue)v).getRGBColorValue(), opacity);
}
return paint;
case SVGPaint.SVG_PAINTTYPE_URI_RGBCOLOR:
paint = silentConvertURIPaint(paintedElement,
paintedNode,
(SVGPaint)paintDef,
opacity,
ctx);
if (paint == null) { // no paint found
paint = convertColor(p.getRGBColor(), opacity);
}
return paint;
case SVGPaint.SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR:
paint = silentConvertURIPaint(paintedElement,
paintedNode,