Eighth round of fixes for implicit 64-32 bit conversion errors.
<rdar://problem/
5292262>
- Convert SVG implementation files to use floats instead of doubles
to match the spec/IDLs.
* bindings/scripts/CodeGeneratorJS.pm:
* ksvg2/svg/SVGAngle.cpp:
* ksvg2/svg/SVGAnimatedTemplate.h:
* ksvg2/svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::getEndTime):
(WebCore::SVGAnimationElement::getStartTime):
(WebCore::SVGAnimationElement::getCurrentTime):
(WebCore::SVGAnimationElement::getSimpleDuration):
* ksvg2/svg/SVGAnimationElement.h:
* ksvg2/svg/SVGFitToViewBox.cpp:
(WebCore::SVGFitToViewBox::parseViewBox):
* ksvg2/svg/SVGLength.cpp:
(WebCore::SVGLength::setValueAsString):
* ksvg2/svg/SVGLinearGradientElement.cpp:
(WebCore::SVGLinearGradientElement::buildGradient):
* ksvg2/svg/SVGMatrix.idl:
* ksvg2/svg/SVGNumber.idl:
* ksvg2/svg/SVGParserUtilities.cpp:
(WebCore::SVGPathParser::parseSVG):
(WebCore::SVGPathParser::calculateArc):
(WebCore::SVGPathParser::svgLineToHorizontal):
(WebCore::SVGPathParser::svgLineToVertical):
(WebCore::SVGPathParser::svgCurveToCubicSmooth):
(WebCore::SVGPathParser::svgCurveToQuadratic):
(WebCore::SVGPathParser::svgCurveToQuadraticSmooth):
(WebCore::SVGPathParser::svgArcTo):
* ksvg2/svg/SVGParserUtilities.h:
* ksvg2/svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::SVGPathElement):
(WebCore::SVGPathElement::getTotalLength):
(WebCore::SVGPathElement::getPointAtLength):
(WebCore::SVGPathElement::getPathSegAtLength):
(WebCore::SVGPathElement::createSVGPathSegMovetoAbs):
(WebCore::SVGPathElement::createSVGPathSegMovetoRel):
(WebCore::SVGPathElement::createSVGPathSegLinetoAbs):
(WebCore::SVGPathElement::createSVGPathSegLinetoRel):
(WebCore::SVGPathElement::createSVGPathSegCurvetoCubicAbs):
(WebCore::SVGPathElement::createSVGPathSegCurvetoCubicRel):
(WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticAbs):
(WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticRel):
(WebCore::SVGPathElement::createSVGPathSegArcAbs):
(WebCore::SVGPathElement::createSVGPathSegArcRel):
(WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalAbs):
(WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalRel):
(WebCore::SVGPathElement::createSVGPathSegLinetoVerticalAbs):
(WebCore::SVGPathElement::createSVGPathSegLinetoVerticalRel):
(WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs):
(WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel):
(WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs):
(WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel):
(WebCore::SVGPathElement::svgMoveTo):
(WebCore::SVGPathElement::svgLineTo):
(WebCore::SVGPathElement::svgLineToHorizontal):
(WebCore::SVGPathElement::svgLineToVertical):
(WebCore::SVGPathElement::svgCurveToCubic):
(WebCore::SVGPathElement::svgCurveToCubicSmooth):
(WebCore::SVGPathElement::svgCurveToQuadratic):
(WebCore::SVGPathElement::svgCurveToQuadraticSmooth):
(WebCore::SVGPathElement::svgArcTo):
(WebCore::SVGPathElement::parseMappedAttribute):
* ksvg2/svg/SVGPathElement.h:
* ksvg2/svg/SVGPathSegArc.cpp:
(WebCore::SVGPathSegArcAbs::SVGPathSegArcAbs):
(WebCore::SVGPathSegArcAbs::setX):
(WebCore::SVGPathSegArcAbs::x):
(WebCore::SVGPathSegArcAbs::setY):
(WebCore::SVGPathSegArcAbs::y):
(WebCore::SVGPathSegArcAbs::setR1):
(WebCore::SVGPathSegArcAbs::r1):
(WebCore::SVGPathSegArcAbs::setR2):
(WebCore::SVGPathSegArcAbs::r2):
(WebCore::SVGPathSegArcAbs::setAngle):
(WebCore::SVGPathSegArcAbs::angle):
(WebCore::SVGPathSegArcRel::SVGPathSegArcRel):
(WebCore::SVGPathSegArcRel::setX):
(WebCore::SVGPathSegArcRel::x):
(WebCore::SVGPathSegArcRel::setY):
(WebCore::SVGPathSegArcRel::y):
(WebCore::SVGPathSegArcRel::setR1):
(WebCore::SVGPathSegArcRel::r1):
(WebCore::SVGPathSegArcRel::setR2):
(WebCore::SVGPathSegArcRel::r2):
(WebCore::SVGPathSegArcRel::setAngle):
(WebCore::SVGPathSegArcRel::angle):
* ksvg2/svg/SVGPathSegArc.h:
* ksvg2/svg/SVGPathSegCurvetoCubic.cpp:
(WebCore::SVGPathSegCurvetoCubicAbs::SVGPathSegCurvetoCubicAbs):
(WebCore::SVGPathSegCurvetoCubicAbs::setX):
(WebCore::SVGPathSegCurvetoCubicAbs::x):
(WebCore::SVGPathSegCurvetoCubicAbs::setY):
(WebCore::SVGPathSegCurvetoCubicAbs::y):
(WebCore::SVGPathSegCurvetoCubicAbs::setX1):
(WebCore::SVGPathSegCurvetoCubicAbs::x1):
(WebCore::SVGPathSegCurvetoCubicAbs::setY1):
(WebCore::SVGPathSegCurvetoCubicAbs::y1):
(WebCore::SVGPathSegCurvetoCubicAbs::setX2):
(WebCore::SVGPathSegCurvetoCubicAbs::x2):
(WebCore::SVGPathSegCurvetoCubicAbs::setY2):
(WebCore::SVGPathSegCurvetoCubicAbs::y2):
(WebCore::SVGPathSegCurvetoCubicRel::SVGPathSegCurvetoCubicRel):
(WebCore::SVGPathSegCurvetoCubicRel::setX):
(WebCore::SVGPathSegCurvetoCubicRel::x):
(WebCore::SVGPathSegCurvetoCubicRel::setY):
(WebCore::SVGPathSegCurvetoCubicRel::y):
(WebCore::SVGPathSegCurvetoCubicRel::setX1):
(WebCore::SVGPathSegCurvetoCubicRel::x1):
(WebCore::SVGPathSegCurvetoCubicRel::setY1):
(WebCore::SVGPathSegCurvetoCubicRel::y1):
(WebCore::SVGPathSegCurvetoCubicRel::setX2):
(WebCore::SVGPathSegCurvetoCubicRel::x2):
(WebCore::SVGPathSegCurvetoCubicRel::setY2):
(WebCore::SVGPathSegCurvetoCubicRel::y2):
* ksvg2/svg/SVGPathSegCurvetoCubic.h:
* ksvg2/svg/SVGPathSegCurvetoCubicSmooth.cpp:
(WebCore::SVGPathSegCurvetoCubicSmoothAbs::SVGPathSegCurvetoCubicSmoothAbs):
(WebCore::SVGPathSegCurvetoCubicSmoothAbs::setX):
(WebCore::SVGPathSegCurvetoCubicSmoothAbs::x):
(WebCore::SVGPathSegCurvetoCubicSmoothAbs::setY):
(WebCore::SVGPathSegCurvetoCubicSmoothAbs::y):
(WebCore::SVGPathSegCurvetoCubicSmoothAbs::setX2):
(WebCore::SVGPathSegCurvetoCubicSmoothAbs::x2):
(WebCore::SVGPathSegCurvetoCubicSmoothAbs::setY2):
(WebCore::SVGPathSegCurvetoCubicSmoothAbs::y2):
(WebCore::SVGPathSegCurvetoCubicSmoothRel::SVGPathSegCurvetoCubicSmoothRel):
(WebCore::SVGPathSegCurvetoCubicSmoothRel::setX):
(WebCore::SVGPathSegCurvetoCubicSmoothRel::x):
(WebCore::SVGPathSegCurvetoCubicSmoothRel::setY):
(WebCore::SVGPathSegCurvetoCubicSmoothRel::y):
(WebCore::SVGPathSegCurvetoCubicSmoothRel::setX2):
(WebCore::SVGPathSegCurvetoCubicSmoothRel::x2):
(WebCore::SVGPathSegCurvetoCubicSmoothRel::setY2):
(WebCore::SVGPathSegCurvetoCubicSmoothRel::y2):
* ksvg2/svg/SVGPathSegCurvetoCubicSmooth.h:
* ksvg2/svg/SVGPathSegCurvetoQuadratic.cpp:
(WebCore::SVGPathSegCurvetoQuadraticAbs::SVGPathSegCurvetoQuadraticAbs):
(WebCore::SVGPathSegCurvetoQuadraticAbs::setX):
(WebCore::SVGPathSegCurvetoQuadraticAbs::x):
(WebCore::SVGPathSegCurvetoQuadraticAbs::setY):
(WebCore::SVGPathSegCurvetoQuadraticAbs::y):
(WebCore::SVGPathSegCurvetoQuadraticAbs::setX1):
(WebCore::SVGPathSegCurvetoQuadraticAbs::x1):
(WebCore::SVGPathSegCurvetoQuadraticAbs::setY1):
(WebCore::SVGPathSegCurvetoQuadraticAbs::y1):
(WebCore::SVGPathSegCurvetoQuadraticRel::SVGPathSegCurvetoQuadraticRel):
(WebCore::SVGPathSegCurvetoQuadraticRel::setX):
(WebCore::SVGPathSegCurvetoQuadraticRel::x):
(WebCore::SVGPathSegCurvetoQuadraticRel::setY):
(WebCore::SVGPathSegCurvetoQuadraticRel::y):
(WebCore::SVGPathSegCurvetoQuadraticRel::setX1):
(WebCore::SVGPathSegCurvetoQuadraticRel::x1):
(WebCore::SVGPathSegCurvetoQuadraticRel::setY1):
(WebCore::SVGPathSegCurvetoQuadraticRel::y1):
* ksvg2/svg/SVGPathSegCurvetoQuadratic.h:
(WebCore::SVGPathSegCurvetoQuadraticRel::toString):
* ksvg2/svg/SVGPathSegCurvetoQuadraticSmooth.cpp:
(WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::SVGPathSegCurvetoQuadraticSmoothAbs):
(WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::setX):
(WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::x):
(WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::setY):
(WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::y):
(WebCore::SVGPathSegCurvetoQuadraticSmoothRel::SVGPathSegCurvetoQuadraticSmoothRel):
(WebCore::SVGPathSegCurvetoQuadraticSmoothRel::setX):
(WebCore::SVGPathSegCurvetoQuadraticSmoothRel::x):
(WebCore::SVGPathSegCurvetoQuadraticSmoothRel::setY):
(WebCore::SVGPathSegCurvetoQuadraticSmoothRel::y):
* ksvg2/svg/SVGPathSegCurvetoQuadraticSmooth.h:
* ksvg2/svg/SVGPathSegLineto.cpp:
(WebCore::SVGPathSegLinetoAbs::SVGPathSegLinetoAbs):
(WebCore::SVGPathSegLinetoAbs::setX):
(WebCore::SVGPathSegLinetoAbs::x):
(WebCore::SVGPathSegLinetoAbs::setY):
(WebCore::SVGPathSegLinetoAbs::y):
(WebCore::SVGPathSegLinetoRel::SVGPathSegLinetoRel):
(WebCore::SVGPathSegLinetoRel::setX):
(WebCore::SVGPathSegLinetoRel::x):
(WebCore::SVGPathSegLinetoRel::setY):
(WebCore::SVGPathSegLinetoRel::y):
* ksvg2/svg/SVGPathSegLineto.h:
* ksvg2/svg/SVGPathSegLinetoHorizontal.cpp:
(WebCore::SVGPathSegLinetoHorizontalAbs::SVGPathSegLinetoHorizontalAbs):
(WebCore::SVGPathSegLinetoHorizontalAbs::setX):
(WebCore::SVGPathSegLinetoHorizontalAbs::x):
(WebCore::SVGPathSegLinetoHorizontalRel::SVGPathSegLinetoHorizontalRel):
(WebCore::SVGPathSegLinetoHorizontalRel::setX):
(WebCore::SVGPathSegLinetoHorizontalRel::x):
* ksvg2/svg/SVGPathSegLinetoHorizontal.h:
* ksvg2/svg/SVGPathSegLinetoVertical.cpp:
(WebCore::SVGPathSegLinetoVerticalAbs::SVGPathSegLinetoVerticalAbs):
(WebCore::SVGPathSegLinetoVerticalAbs::setY):
(WebCore::SVGPathSegLinetoVerticalAbs::y):
(WebCore::SVGPathSegLinetoVerticalRel::SVGPathSegLinetoVerticalRel):
(WebCore::SVGPathSegLinetoVerticalRel::setY):
(WebCore::SVGPathSegLinetoVerticalRel::y):
* ksvg2/svg/SVGPathSegLinetoVertical.h:
* ksvg2/svg/SVGPathSegList.cpp:
(WebCore::SVGPathSegList::getPathSegAtLength):
* ksvg2/svg/SVGPathSegList.h:
* ksvg2/svg/SVGPathSegMoveto.cpp:
(WebCore::SVGPathSegMovetoAbs::SVGPathSegMovetoAbs):
(WebCore::SVGPathSegMovetoAbs::setX):
(WebCore::SVGPathSegMovetoAbs::x):
(WebCore::SVGPathSegMovetoAbs::setY):
(WebCore::SVGPathSegMovetoAbs::y):
(WebCore::SVGPathSegMovetoRel::SVGPathSegMovetoRel):
(WebCore::SVGPathSegMovetoRel::setX):
(WebCore::SVGPathSegMovetoRel::x):
(WebCore::SVGPathSegMovetoRel::setY):
(WebCore::SVGPathSegMovetoRel::y):
* ksvg2/svg/SVGPathSegMoveto.h:
* ksvg2/svg/SVGPolyElement.cpp:
(WebCore::SVGPolyElement::svgPolyTo):
* ksvg2/svg/SVGRadialGradientElement.cpp:
(WebCore::SVGRadialGradientElement::buildGradient):
* ksvg2/svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::viewport):
(WebCore::SVGSVGElement::getCurrentTime):
* ksvg2/svg/SVGStopElement.cpp:
(WebCore::SVGStopElement::SVGStopElement):
(WebCore::SVGStopElement::parseMappedAttribute):
* ksvg2/svg/SVGStopElement.h:
* ksvg2/svg/SVGTransform.cpp:
(SVGTransform::translate):
(SVGTransform::scale):
* ksvg2/svg/SVGTransformDistance.cpp:
(WebCore::SVGTransformDistance::addToSVGTransform):
(WebCore::SVGTransformDistance::distance):
* ksvg2/svg/SVGTransformable.cpp:
(WebCore::SVGTransformable::parseTransformAttribute):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@23951
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-07-03 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Oliver.
+
+ Eighth round of fixes for implicit 64-32 bit conversion errors.
+ <rdar://problem/5292262>
+
+ - Convert SVG implementation files to use floats instead of doubles
+ to match the spec/IDLs.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * ksvg2/svg/SVGAngle.cpp:
+ * ksvg2/svg/SVGAnimatedTemplate.h:
+ * ksvg2/svg/SVGAnimationElement.cpp:
+ (WebCore::SVGAnimationElement::getEndTime):
+ (WebCore::SVGAnimationElement::getStartTime):
+ (WebCore::SVGAnimationElement::getCurrentTime):
+ (WebCore::SVGAnimationElement::getSimpleDuration):
+ * ksvg2/svg/SVGAnimationElement.h:
+ * ksvg2/svg/SVGFitToViewBox.cpp:
+ (WebCore::SVGFitToViewBox::parseViewBox):
+ * ksvg2/svg/SVGLength.cpp:
+ (WebCore::SVGLength::setValueAsString):
+ * ksvg2/svg/SVGLinearGradientElement.cpp:
+ (WebCore::SVGLinearGradientElement::buildGradient):
+ * ksvg2/svg/SVGMatrix.idl:
+ * ksvg2/svg/SVGNumber.idl:
+ * ksvg2/svg/SVGParserUtilities.cpp:
+ (WebCore::SVGPathParser::parseSVG):
+ (WebCore::SVGPathParser::calculateArc):
+ (WebCore::SVGPathParser::svgLineToHorizontal):
+ (WebCore::SVGPathParser::svgLineToVertical):
+ (WebCore::SVGPathParser::svgCurveToCubicSmooth):
+ (WebCore::SVGPathParser::svgCurveToQuadratic):
+ (WebCore::SVGPathParser::svgCurveToQuadraticSmooth):
+ (WebCore::SVGPathParser::svgArcTo):
+ * ksvg2/svg/SVGParserUtilities.h:
+ * ksvg2/svg/SVGPathElement.cpp:
+ (WebCore::SVGPathElement::SVGPathElement):
+ (WebCore::SVGPathElement::getTotalLength):
+ (WebCore::SVGPathElement::getPointAtLength):
+ (WebCore::SVGPathElement::getPathSegAtLength):
+ (WebCore::SVGPathElement::createSVGPathSegMovetoAbs):
+ (WebCore::SVGPathElement::createSVGPathSegMovetoRel):
+ (WebCore::SVGPathElement::createSVGPathSegLinetoAbs):
+ (WebCore::SVGPathElement::createSVGPathSegLinetoRel):
+ (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicAbs):
+ (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicRel):
+ (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticAbs):
+ (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticRel):
+ (WebCore::SVGPathElement::createSVGPathSegArcAbs):
+ (WebCore::SVGPathElement::createSVGPathSegArcRel):
+ (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalAbs):
+ (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalRel):
+ (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalAbs):
+ (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalRel):
+ (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs):
+ (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel):
+ (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs):
+ (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel):
+ (WebCore::SVGPathElement::svgMoveTo):
+ (WebCore::SVGPathElement::svgLineTo):
+ (WebCore::SVGPathElement::svgLineToHorizontal):
+ (WebCore::SVGPathElement::svgLineToVertical):
+ (WebCore::SVGPathElement::svgCurveToCubic):
+ (WebCore::SVGPathElement::svgCurveToCubicSmooth):
+ (WebCore::SVGPathElement::svgCurveToQuadratic):
+ (WebCore::SVGPathElement::svgCurveToQuadraticSmooth):
+ (WebCore::SVGPathElement::svgArcTo):
+ (WebCore::SVGPathElement::parseMappedAttribute):
+ * ksvg2/svg/SVGPathElement.h:
+ * ksvg2/svg/SVGPathSegArc.cpp:
+ (WebCore::SVGPathSegArcAbs::SVGPathSegArcAbs):
+ (WebCore::SVGPathSegArcAbs::setX):
+ (WebCore::SVGPathSegArcAbs::x):
+ (WebCore::SVGPathSegArcAbs::setY):
+ (WebCore::SVGPathSegArcAbs::y):
+ (WebCore::SVGPathSegArcAbs::setR1):
+ (WebCore::SVGPathSegArcAbs::r1):
+ (WebCore::SVGPathSegArcAbs::setR2):
+ (WebCore::SVGPathSegArcAbs::r2):
+ (WebCore::SVGPathSegArcAbs::setAngle):
+ (WebCore::SVGPathSegArcAbs::angle):
+ (WebCore::SVGPathSegArcRel::SVGPathSegArcRel):
+ (WebCore::SVGPathSegArcRel::setX):
+ (WebCore::SVGPathSegArcRel::x):
+ (WebCore::SVGPathSegArcRel::setY):
+ (WebCore::SVGPathSegArcRel::y):
+ (WebCore::SVGPathSegArcRel::setR1):
+ (WebCore::SVGPathSegArcRel::r1):
+ (WebCore::SVGPathSegArcRel::setR2):
+ (WebCore::SVGPathSegArcRel::r2):
+ (WebCore::SVGPathSegArcRel::setAngle):
+ (WebCore::SVGPathSegArcRel::angle):
+ * ksvg2/svg/SVGPathSegArc.h:
+ * ksvg2/svg/SVGPathSegCurvetoCubic.cpp:
+ (WebCore::SVGPathSegCurvetoCubicAbs::SVGPathSegCurvetoCubicAbs):
+ (WebCore::SVGPathSegCurvetoCubicAbs::setX):
+ (WebCore::SVGPathSegCurvetoCubicAbs::x):
+ (WebCore::SVGPathSegCurvetoCubicAbs::setY):
+ (WebCore::SVGPathSegCurvetoCubicAbs::y):
+ (WebCore::SVGPathSegCurvetoCubicAbs::setX1):
+ (WebCore::SVGPathSegCurvetoCubicAbs::x1):
+ (WebCore::SVGPathSegCurvetoCubicAbs::setY1):
+ (WebCore::SVGPathSegCurvetoCubicAbs::y1):
+ (WebCore::SVGPathSegCurvetoCubicAbs::setX2):
+ (WebCore::SVGPathSegCurvetoCubicAbs::x2):
+ (WebCore::SVGPathSegCurvetoCubicAbs::setY2):
+ (WebCore::SVGPathSegCurvetoCubicAbs::y2):
+ (WebCore::SVGPathSegCurvetoCubicRel::SVGPathSegCurvetoCubicRel):
+ (WebCore::SVGPathSegCurvetoCubicRel::setX):
+ (WebCore::SVGPathSegCurvetoCubicRel::x):
+ (WebCore::SVGPathSegCurvetoCubicRel::setY):
+ (WebCore::SVGPathSegCurvetoCubicRel::y):
+ (WebCore::SVGPathSegCurvetoCubicRel::setX1):
+ (WebCore::SVGPathSegCurvetoCubicRel::x1):
+ (WebCore::SVGPathSegCurvetoCubicRel::setY1):
+ (WebCore::SVGPathSegCurvetoCubicRel::y1):
+ (WebCore::SVGPathSegCurvetoCubicRel::setX2):
+ (WebCore::SVGPathSegCurvetoCubicRel::x2):
+ (WebCore::SVGPathSegCurvetoCubicRel::setY2):
+ (WebCore::SVGPathSegCurvetoCubicRel::y2):
+ * ksvg2/svg/SVGPathSegCurvetoCubic.h:
+ * ksvg2/svg/SVGPathSegCurvetoCubicSmooth.cpp:
+ (WebCore::SVGPathSegCurvetoCubicSmoothAbs::SVGPathSegCurvetoCubicSmoothAbs):
+ (WebCore::SVGPathSegCurvetoCubicSmoothAbs::setX):
+ (WebCore::SVGPathSegCurvetoCubicSmoothAbs::x):
+ (WebCore::SVGPathSegCurvetoCubicSmoothAbs::setY):
+ (WebCore::SVGPathSegCurvetoCubicSmoothAbs::y):
+ (WebCore::SVGPathSegCurvetoCubicSmoothAbs::setX2):
+ (WebCore::SVGPathSegCurvetoCubicSmoothAbs::x2):
+ (WebCore::SVGPathSegCurvetoCubicSmoothAbs::setY2):
+ (WebCore::SVGPathSegCurvetoCubicSmoothAbs::y2):
+ (WebCore::SVGPathSegCurvetoCubicSmoothRel::SVGPathSegCurvetoCubicSmoothRel):
+ (WebCore::SVGPathSegCurvetoCubicSmoothRel::setX):
+ (WebCore::SVGPathSegCurvetoCubicSmoothRel::x):
+ (WebCore::SVGPathSegCurvetoCubicSmoothRel::setY):
+ (WebCore::SVGPathSegCurvetoCubicSmoothRel::y):
+ (WebCore::SVGPathSegCurvetoCubicSmoothRel::setX2):
+ (WebCore::SVGPathSegCurvetoCubicSmoothRel::x2):
+ (WebCore::SVGPathSegCurvetoCubicSmoothRel::setY2):
+ (WebCore::SVGPathSegCurvetoCubicSmoothRel::y2):
+ * ksvg2/svg/SVGPathSegCurvetoCubicSmooth.h:
+ * ksvg2/svg/SVGPathSegCurvetoQuadratic.cpp:
+ (WebCore::SVGPathSegCurvetoQuadraticAbs::SVGPathSegCurvetoQuadraticAbs):
+ (WebCore::SVGPathSegCurvetoQuadraticAbs::setX):
+ (WebCore::SVGPathSegCurvetoQuadraticAbs::x):
+ (WebCore::SVGPathSegCurvetoQuadraticAbs::setY):
+ (WebCore::SVGPathSegCurvetoQuadraticAbs::y):
+ (WebCore::SVGPathSegCurvetoQuadraticAbs::setX1):
+ (WebCore::SVGPathSegCurvetoQuadraticAbs::x1):
+ (WebCore::SVGPathSegCurvetoQuadraticAbs::setY1):
+ (WebCore::SVGPathSegCurvetoQuadraticAbs::y1):
+ (WebCore::SVGPathSegCurvetoQuadraticRel::SVGPathSegCurvetoQuadraticRel):
+ (WebCore::SVGPathSegCurvetoQuadraticRel::setX):
+ (WebCore::SVGPathSegCurvetoQuadraticRel::x):
+ (WebCore::SVGPathSegCurvetoQuadraticRel::setY):
+ (WebCore::SVGPathSegCurvetoQuadraticRel::y):
+ (WebCore::SVGPathSegCurvetoQuadraticRel::setX1):
+ (WebCore::SVGPathSegCurvetoQuadraticRel::x1):
+ (WebCore::SVGPathSegCurvetoQuadraticRel::setY1):
+ (WebCore::SVGPathSegCurvetoQuadraticRel::y1):
+ * ksvg2/svg/SVGPathSegCurvetoQuadratic.h:
+ (WebCore::SVGPathSegCurvetoQuadraticRel::toString):
+ * ksvg2/svg/SVGPathSegCurvetoQuadraticSmooth.cpp:
+ (WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::SVGPathSegCurvetoQuadraticSmoothAbs):
+ (WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::setX):
+ (WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::x):
+ (WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::setY):
+ (WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::y):
+ (WebCore::SVGPathSegCurvetoQuadraticSmoothRel::SVGPathSegCurvetoQuadraticSmoothRel):
+ (WebCore::SVGPathSegCurvetoQuadraticSmoothRel::setX):
+ (WebCore::SVGPathSegCurvetoQuadraticSmoothRel::x):
+ (WebCore::SVGPathSegCurvetoQuadraticSmoothRel::setY):
+ (WebCore::SVGPathSegCurvetoQuadraticSmoothRel::y):
+ * ksvg2/svg/SVGPathSegCurvetoQuadraticSmooth.h:
+ * ksvg2/svg/SVGPathSegLineto.cpp:
+ (WebCore::SVGPathSegLinetoAbs::SVGPathSegLinetoAbs):
+ (WebCore::SVGPathSegLinetoAbs::setX):
+ (WebCore::SVGPathSegLinetoAbs::x):
+ (WebCore::SVGPathSegLinetoAbs::setY):
+ (WebCore::SVGPathSegLinetoAbs::y):
+ (WebCore::SVGPathSegLinetoRel::SVGPathSegLinetoRel):
+ (WebCore::SVGPathSegLinetoRel::setX):
+ (WebCore::SVGPathSegLinetoRel::x):
+ (WebCore::SVGPathSegLinetoRel::setY):
+ (WebCore::SVGPathSegLinetoRel::y):
+ * ksvg2/svg/SVGPathSegLineto.h:
+ * ksvg2/svg/SVGPathSegLinetoHorizontal.cpp:
+ (WebCore::SVGPathSegLinetoHorizontalAbs::SVGPathSegLinetoHorizontalAbs):
+ (WebCore::SVGPathSegLinetoHorizontalAbs::setX):
+ (WebCore::SVGPathSegLinetoHorizontalAbs::x):
+ (WebCore::SVGPathSegLinetoHorizontalRel::SVGPathSegLinetoHorizontalRel):
+ (WebCore::SVGPathSegLinetoHorizontalRel::setX):
+ (WebCore::SVGPathSegLinetoHorizontalRel::x):
+ * ksvg2/svg/SVGPathSegLinetoHorizontal.h:
+ * ksvg2/svg/SVGPathSegLinetoVertical.cpp:
+ (WebCore::SVGPathSegLinetoVerticalAbs::SVGPathSegLinetoVerticalAbs):
+ (WebCore::SVGPathSegLinetoVerticalAbs::setY):
+ (WebCore::SVGPathSegLinetoVerticalAbs::y):
+ (WebCore::SVGPathSegLinetoVerticalRel::SVGPathSegLinetoVerticalRel):
+ (WebCore::SVGPathSegLinetoVerticalRel::setY):
+ (WebCore::SVGPathSegLinetoVerticalRel::y):
+ * ksvg2/svg/SVGPathSegLinetoVertical.h:
+ * ksvg2/svg/SVGPathSegList.cpp:
+ (WebCore::SVGPathSegList::getPathSegAtLength):
+ * ksvg2/svg/SVGPathSegList.h:
+ * ksvg2/svg/SVGPathSegMoveto.cpp:
+ (WebCore::SVGPathSegMovetoAbs::SVGPathSegMovetoAbs):
+ (WebCore::SVGPathSegMovetoAbs::setX):
+ (WebCore::SVGPathSegMovetoAbs::x):
+ (WebCore::SVGPathSegMovetoAbs::setY):
+ (WebCore::SVGPathSegMovetoAbs::y):
+ (WebCore::SVGPathSegMovetoRel::SVGPathSegMovetoRel):
+ (WebCore::SVGPathSegMovetoRel::setX):
+ (WebCore::SVGPathSegMovetoRel::x):
+ (WebCore::SVGPathSegMovetoRel::setY):
+ (WebCore::SVGPathSegMovetoRel::y):
+ * ksvg2/svg/SVGPathSegMoveto.h:
+ * ksvg2/svg/SVGPolyElement.cpp:
+ (WebCore::SVGPolyElement::svgPolyTo):
+ * ksvg2/svg/SVGRadialGradientElement.cpp:
+ (WebCore::SVGRadialGradientElement::buildGradient):
+ * ksvg2/svg/SVGSVGElement.cpp:
+ (WebCore::SVGSVGElement::viewport):
+ (WebCore::SVGSVGElement::getCurrentTime):
+ * ksvg2/svg/SVGStopElement.cpp:
+ (WebCore::SVGStopElement::SVGStopElement):
+ (WebCore::SVGStopElement::parseMappedAttribute):
+ * ksvg2/svg/SVGStopElement.h:
+ * ksvg2/svg/SVGTransform.cpp:
+ (SVGTransform::translate):
+ (SVGTransform::scale):
+ * ksvg2/svg/SVGTransformDistance.cpp:
+ (WebCore::SVGTransformDistance::addToSVGTransform):
+ (WebCore::SVGTransformDistance::distance):
+ * ksvg2/svg/SVGTransformable.cpp:
+ (WebCore::SVGTransformable::parseTransformAttribute):
+
2007-07-03 Anders Carlsson <andersca@apple.com>
Reviewed by Darin.
BC98A27D0C0C9950004BEBF7 /* JSStyleSheetCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC98A27C0C0C9950004BEBF7 /* JSStyleSheetCustom.cpp */; };
BCA169A20BFD55B40019CA76 /* JSHTMLTableCaptionElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA169A00BFD55B40019CA76 /* JSHTMLTableCaptionElement.cpp */; };
BCA169A30BFD55B40019CA76 /* JSHTMLTableCaptionElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA169A10BFD55B40019CA76 /* JSHTMLTableCaptionElement.h */; };
+ BCA85A100C3AEAF4006F8308 /* DOMSVGNumberInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA85A0F0C3AEAF4006F8308 /* DOMSVGNumberInternal.h */; };
BCAA90C30A7EBA60008B1229 /* ScrollBar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCAA90C20A7EBA60008B1229 /* ScrollBar.cpp */; };
BCB16B8B0979B01400467741 /* DeprecatedArray.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16B880979B01400467741 /* DeprecatedArray.h */; settings = {ATTRIBUTES = (Private, ); }; };
BCB16B8C0979B01400467741 /* ArrayImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB16B890979B01400467741 /* ArrayImpl.cpp */; };
BC98A27C0C0C9950004BEBF7 /* JSStyleSheetCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSStyleSheetCustom.cpp; sourceTree = "<group>"; };
BCA169A00BFD55B40019CA76 /* JSHTMLTableCaptionElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLTableCaptionElement.cpp; sourceTree = "<group>"; };
BCA169A10BFD55B40019CA76 /* JSHTMLTableCaptionElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLTableCaptionElement.h; sourceTree = "<group>"; };
+ BCA85A0F0C3AEAF4006F8308 /* DOMSVGNumberInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMSVGNumberInternal.h; sourceTree = "<group>"; };
BCAA90C20A7EBA60008B1229 /* ScrollBar.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ScrollBar.cpp; path = platform/ScrollBar.cpp; sourceTree = SOURCE_ROOT; };
BCB16B880979B01400467741 /* DeprecatedArray.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DeprecatedArray.h; sourceTree = "<group>"; };
BCB16B890979B01400467741 /* ArrayImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ArrayImpl.cpp; sourceTree = "<group>"; };
85E7113D0AC5D4A10053270F /* Internal */ = {
isa = PBXGroup;
children = (
+ BCA85A0F0C3AEAF4006F8308 /* DOMSVGNumberInternal.h */,
8538F0180AD718D8006A81D1 /* DOMAbstractViewInternal.h */,
85E7113E0AC5D5340053270F /* DOMAttrInternal.h */,
85E7113F0AC5D5340053270F /* DOMCDATASectionInternal.h */,
BC5A86850C33676000EEA649 /* DOMSelection.h in Headers */,
BC5A86B60C3367E800EEA649 /* JSDOMSelection.h in Headers */,
BC073BAA0C399B1F000F5979 /* FloatConversion.h in Headers */,
+ BCA85A100C3AEAF4006F8308 /* DOMSVGNumberInternal.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
my $type = shift;
return "unsigned" if $type eq "unsigned long";
- return $type if $type eq "unsigned short" or $type eq "float" or $type eq "AtomicString";
+ return $type if $type eq "unsigned short" or $type eq "float" or $type eq "double" or $type eq "AtomicString";
return "bool" if $type eq "boolean";
return "int" if $type eq "long";
return "String" if $type eq "DOMString";
return 0 if $type eq "boolean" or
$type eq "float" or
+ $type eq "double" or
$type eq "AtomicString" or
$type eq "DOMString" or
$type eq "Node" or
my $type = $codeGenerator->StripModule($signature->type);
return "$value->toBoolean(exec)" if $type eq "boolean";
- return "$value->toNumber(exec)" if $type eq "SVGNumber";
+ return "$value->toNumber(exec)" if $type eq "double" or $type eq "SVGNumber";
return "$value->toFloat(exec)" if $type eq "float";
return "$value->toInt32(exec${maybeOkParam})" if $type eq "unsigned long" or $type eq "long" or $type eq "unsigned short";
namespace WebCore {
-const float deg2rad = 0.017453292519943295769; // pi/180
-const float deg2grad = 400.0 / 360.0;
+const float deg2rad = 0.017453292519943295769f; // pi/180
+const float deg2grad = 400.0f / 360.0f;
#define rad2grad deg2grad / deg2rad
typedef SVGAnimatedTemplate<long> SVGAnimatedInteger;
typedef SVGAnimatedTemplate<SVGLength> SVGAnimatedLength;
typedef SVGAnimatedTemplate<SVGLengthList*> SVGAnimatedLengthList;
- typedef SVGAnimatedTemplate<double> SVGAnimatedNumber;
+ typedef SVGAnimatedTemplate<float> SVGAnimatedNumber;
typedef SVGAnimatedTemplate<SVGNumberList*> SVGAnimatedNumberList;
typedef SVGAnimatedTemplate<SVGPreserveAspectRatio*> SVGAnimatedPreserveAspectRatio;
typedef SVGAnimatedTemplate<FloatRect> SVGAnimatedRect;
return m_targetElement;
}
-double SVGAnimationElement::getEndTime() const
+float SVGAnimationElement::getEndTime() const
{
- return m_end;
+ return narrowPrecisionToFloat(m_end);
}
-double SVGAnimationElement::getStartTime() const
+float SVGAnimationElement::getStartTime() const
{
- return m_begin;
+ return narrowPrecisionToFloat(m_begin);
}
-double SVGAnimationElement::getCurrentTime() const
+float SVGAnimationElement::getCurrentTime() const
{
- return m_currentTime;
+ return narrowPrecisionToFloat(m_currentTime);
}
-double SVGAnimationElement::getSimpleDuration(ExceptionCode&) const
+float SVGAnimationElement::getSimpleDuration(ExceptionCode&) const
{
- return m_simpleDuration;
+ return narrowPrecisionToFloat(m_simpleDuration);
}
void SVGAnimationElement::parseKeyNumbers(Vector<float>& keyNumbers, const String& value)
virtual bool isValid() const { return SVGTests::isValid(); }
- double getEndTime() const;
- double getStartTime() const;
- double getCurrentTime() const;
- double getSimpleDuration(ExceptionCode&) const;
+ float getEndTime() const;
+ float getStartTime() const;
+ float getCurrentTime() const;
+ float getSimpleDuration(ExceptionCode&) const;
virtual void parseMappedAttribute(MappedAttribute* attr);
if (c < end) // nothing should come after the last, fourth number
doc->accessSVGExtensions()->reportWarning("Problem parsing viewBox=\"" + str + "\"");
else
- setViewBoxBaseValue(FloatRect(x, y, w, h));
+ setViewBoxBaseValue(FloatRect::narrowPrecision(x, y, w, h));
}
}
#include "SVGLength.h"
#include "DeprecatedString.h"
+#include "FloatConversion.h"
#include "FrameView.h"
#include "RenderObject.h"
#include "RenderView.h"
+#include "SVGParserUtilities.h"
#include "SVGSVGElement.h"
#include "SVGStyledElement.h"
-#include "SVGParserUtilities.h"
#include "csshelper.h"
#include <math.h>
parseNumber(ptr, end, convertedNumber, false);
m_unit = storeUnit(extractMode(m_unit), stringToLengthType(s));
- m_valueInSpecifiedUnits = convertedNumber;
+ m_valueInSpecifiedUnits = narrowPrecisionToFloat(convertedNumber);
}
String SVGLength::valueAsString() const
#if ENABLE(SVG)
#include "SVGLinearGradientElement.h"
+#include "FloatPoint.h"
#include "LinearGradientAttributes.h"
-#include "SVGPaintServerLinearGradient.h"
#include "SVGLength.h"
#include "SVGNames.h"
+#include "SVGPaintServerLinearGradient.h"
#include "SVGTransform.h"
#include "SVGTransformList.h"
#include "SVGUnitTypes.h"
linearGradient->setBoundingBoxMode(attributes.boundingBoxMode());
linearGradient->setGradientSpreadMethod(attributes.spreadMethod());
linearGradient->setGradientTransform(attributes.gradientTransform());
- linearGradient->setGradientStart(FloatPoint(attributes.x1(), attributes.y1()));
- linearGradient->setGradientEnd(FloatPoint(attributes.x2(), attributes.y2()));
+ linearGradient->setGradientStart(FloatPoint::narrowPrecision(attributes.x1(), attributes.y1()));
+ linearGradient->setGradientEnd(FloatPoint::narrowPrecision(attributes.x2(), attributes.y2()));
}
LinearGradientAttributes SVGLinearGradientElement::collectGradientProperties() const
module svg {
- interface [Conditional=SVG, PODType=AffineTransform] SVGMatrix {
- attribute float a;
- attribute float b;
- attribute float c;
- attribute float d;
- attribute float e;
- attribute float f;
+ interface [Conditional=SVG, PODType=AffineTransform] SVGMatrix {
+ // FIXME: these attributes should all be floats but since we implement
+ // AffineTransform with doubles setting these as doubles makes more sense.
+ attribute double a;
+ attribute double b;
+ attribute double c;
+ attribute double d;
+ attribute double e;
+ attribute double f;
SVGMatrix multiply(in SVGMatrix secondMatrix);
[Custom] SVGMatrix inverse()
raises(SVGException);
- SVGMatrix translate(in float x, in float y);
- SVGMatrix scale(in float scaleFactor);
- SVGMatrix scaleNonUniform(in float scaleFactorX, in float scaleFactorY);
- SVGMatrix rotate(in float angle);
- [Custom] SVGMatrix rotateFromVector(in float x, in float y)
+ SVGMatrix translate(in double x, in double y);
+ SVGMatrix scale(in double scaleFactor);
+ SVGMatrix scaleNonUniform(in double scaleFactorX, in double scaleFactorY);
+ SVGMatrix rotate(in double angle);
+ [Custom] SVGMatrix rotateFromVector(in double x, in double y)
raises(SVGException);
SVGMatrix flipX();
SVGMatrix flipY();
- SVGMatrix skewX(in float angle);
- SVGMatrix skewY(in float angle);
+ SVGMatrix skewX(in double angle);
+ SVGMatrix skewY(in double angle);
};
}
module svg {
interface [Conditional=SVG, PODType=double] SVGNumber {
- attribute float value
+ // FIXME: the spec says that this should be a float.
+ attribute double value
setter raises(DOMException);
};
#if ENABLE(SVG)
#include "SVGParserUtilities.h"
+#include "FloatConversion.h"
#include "PlatformString.h"
#include <math.h>
#include <wtf/MathExtras.h>
subpathx = curx = relative ? curx + tox : tox;
subpathy = cury = relative ? cury + toy : toy;
- svgMoveTo(curx, cury, closed);
+ svgMoveTo(narrowPrecisionToFloat(curx), narrowPrecisionToFloat(cury), closed);
} else
- svgMoveTo(tox, toy, closed, !relative);
+ svgMoveTo(narrowPrecisionToFloat(tox), narrowPrecisionToFloat(toy), closed, !relative);
closed = false;
break;
}
curx = relative ? curx + tox : tox;
cury = relative ? cury + toy : toy;
- svgLineTo(curx, cury);
+ svgLineTo(narrowPrecisionToFloat(curx), narrowPrecisionToFloat(cury));
}
else
- svgLineTo(tox, toy, !relative);
+ svgLineTo(narrowPrecisionToFloat(tox), narrowPrecisionToFloat(toy), !relative);
break;
}
case 'h':
return false;
if (process) {
curx = curx + tox;
- svgLineTo(curx, cury);
+ svgLineTo(narrowPrecisionToFloat(curx), narrowPrecisionToFloat(cury));
}
else
- svgLineToHorizontal(tox, false);
+ svgLineToHorizontal(narrowPrecisionToFloat(tox), false);
break;
}
case 'H':
return false;
if (process) {
curx = tox;
- svgLineTo(curx, cury);
+ svgLineTo(narrowPrecisionToFloat(curx), narrowPrecisionToFloat(cury));
}
else
- svgLineToHorizontal(tox);
+ svgLineToHorizontal(narrowPrecisionToFloat(tox));
break;
}
case 'v':
return false;
if (process) {
cury = cury + toy;
- svgLineTo(curx, cury);
+ svgLineTo(narrowPrecisionToFloat(curx), narrowPrecisionToFloat(cury));
}
else
- svgLineToVertical(toy, false);
+ svgLineToVertical(narrowPrecisionToFloat(toy), false);
break;
}
case 'V':
return false;
if (process) {
cury = toy;
- svgLineTo(curx, cury);
+ svgLineTo(narrowPrecisionToFloat(curx), narrowPrecisionToFloat(cury));
}
else
- svgLineToVertical(toy);
+ svgLineToVertical(narrowPrecisionToFloat(toy));
break;
}
case 'z':
px3 = relative ? curx + tox : tox;
py3 = relative ? cury + toy : toy;
- svgCurveToCubic(px1, py1, px2, py2, px3, py3);
+ svgCurveToCubic(narrowPrecisionToFloat(px1), narrowPrecisionToFloat(py1), narrowPrecisionToFloat(px2),
+ narrowPrecisionToFloat(py2), narrowPrecisionToFloat(px3), narrowPrecisionToFloat(py3));
contrlx = relative ? curx + x2 : x2;
contrly = relative ? cury + y2 : y2;
cury = relative ? cury + toy : toy;
}
else
- svgCurveToCubic(x1, y1, x2, y2, tox, toy, !relative);
+ svgCurveToCubic(narrowPrecisionToFloat(x1), narrowPrecisionToFloat(y1), narrowPrecisionToFloat(x2),
+ narrowPrecisionToFloat(y2), narrowPrecisionToFloat(tox), narrowPrecisionToFloat(toy), !relative);
break;
}
px3 = relative ? curx + tox : tox;
py3 = relative ? cury + toy : toy;
- svgCurveToCubic(px1, py1, px2, py2, px3, py3);
+ svgCurveToCubic(narrowPrecisionToFloat(px1), narrowPrecisionToFloat(py1), narrowPrecisionToFloat(px2),
+ narrowPrecisionToFloat(py2), narrowPrecisionToFloat(px3), narrowPrecisionToFloat(py3));
contrlx = relative ? curx + x2 : x2;
contrly = relative ? cury + y2 : y2;
cury = relative ? cury + toy : toy;
}
else
- svgCurveToCubicSmooth(x2, y2, tox, toy, !relative);
+ svgCurveToCubicSmooth(narrowPrecisionToFloat(x2), narrowPrecisionToFloat(y2),
+ narrowPrecisionToFloat(tox), narrowPrecisionToFloat(toy), !relative);
break;
}
case 'q':
px3 = relative ? curx + tox : tox;
py3 = relative ? cury + toy : toy;
- svgCurveToCubic(px1, py1, px2, py2, px3, py3);
+ svgCurveToCubic(narrowPrecisionToFloat(px1), narrowPrecisionToFloat(py1), narrowPrecisionToFloat(px2),
+ narrowPrecisionToFloat(py2), narrowPrecisionToFloat(px3), narrowPrecisionToFloat(py3));
contrlx = relative ? curx + x1 : x1;
contrly = relative ? cury + y1 : y1;
cury = relative ? cury + toy : toy;
}
else
- svgCurveToQuadratic(x1, y1, tox, toy, !relative);
+ svgCurveToQuadratic(narrowPrecisionToFloat(x1), narrowPrecisionToFloat(y1),
+ narrowPrecisionToFloat(tox), narrowPrecisionToFloat(toy), !relative);
break;
}
case 't':
px3 = relative ? curx + tox : tox;
py3 = relative ? cury + toy : toy;
- svgCurveToCubic(px1, py1, px2, py2, px3, py3);
+ svgCurveToCubic(narrowPrecisionToFloat(px1), narrowPrecisionToFloat(py1), narrowPrecisionToFloat(px2),
+ narrowPrecisionToFloat(py2), narrowPrecisionToFloat(px3), narrowPrecisionToFloat(py3));
contrlx = xc;
contrly = yc;
cury = relative ? cury + toy : toy;
}
else
- svgCurveToQuadraticSmooth(tox, toy, !relative);
+ svgCurveToQuadraticSmooth(narrowPrecisionToFloat(tox), narrowPrecisionToFloat(toy), !relative);
break;
}
case 'a':
if (process)
calculateArc(relative, curx, cury, angle, tox, toy, rx, ry, largeArc, sweep);
else
- svgArcTo(tox, toy, rx, ry, angle, largeArc, sweep, !relative);
+ svgArcTo(narrowPrecisionToFloat(tox), narrowPrecisionToFloat(toy), narrowPrecisionToFloat(rx), narrowPrecisionToFloat(ry),
+ narrowPrecisionToFloat(angle), largeArc, sweep, !relative);
break;
}
default:
x2 = x3 + t * sin(_th1);
y2 = y3 - t * cos(_th1);
- svgCurveToCubic(a00 * x1 + a01 * y1, a10 * x1 + a11 * y1, a00 * x2 + a01 * y2, a10 * x2 + a11 * y2, a00 * x3 + a01 * y3, a10 * x3 + a11 * y3);
+ svgCurveToCubic(narrowPrecisionToFloat(a00 * x1 + a01 * y1), narrowPrecisionToFloat(a10 * x1 + a11 * y1),
+ narrowPrecisionToFloat(a00 * x2 + a01 * y2), narrowPrecisionToFloat(a10 * x2 + a11 * y2),
+ narrowPrecisionToFloat(a00 * x3 + a01 * y3), narrowPrecisionToFloat(a10 * x3 + a11 * y3));
}
if (!relative)
cury += y;
}
-void SVGPathParser::svgLineToHorizontal(double, bool)
+void SVGPathParser::svgLineToHorizontal(float, bool)
{
}
-void SVGPathParser::svgLineToVertical(double, bool)
+void SVGPathParser::svgLineToVertical(float, bool)
{
}
-void SVGPathParser::svgCurveToCubicSmooth(double, double, double, double, bool)
+void SVGPathParser::svgCurveToCubicSmooth(float, float, float, float, bool)
{
}
-void SVGPathParser::svgCurveToQuadratic(double, double, double, double, bool)
+void SVGPathParser::svgCurveToQuadratic(float, float, float, float, bool)
{
}
-void SVGPathParser::svgCurveToQuadraticSmooth(double, double, bool)
+void SVGPathParser::svgCurveToQuadraticSmooth(float, float, bool)
{
}
-void SVGPathParser::svgArcTo(double, double, double, double, double, bool, bool, bool)
+void SVGPathParser::svgArcTo(float, float, float, float, float, bool, bool, bool)
{
}
bool parseSVG(const String& d, bool process = false);
protected:
- virtual void svgMoveTo(double x1, double y1, bool closed, bool abs = true) = 0;
- virtual void svgLineTo(double x1, double y1, bool abs = true) = 0;
- virtual void svgLineToHorizontal(double x, bool abs = true);
- virtual void svgLineToVertical(double y, bool abs = true);
- virtual void svgCurveToCubic(double x1, double y1, double x2, double y2, double x, double y, bool abs = true) = 0;
- virtual void svgCurveToCubicSmooth(double x, double y, double x2, double y2, bool abs = true);
- virtual void svgCurveToQuadratic(double x, double y, double x1, double y1, bool abs = true);
- virtual void svgCurveToQuadraticSmooth(double x, double y, bool abs = true);
- virtual void svgArcTo(double x, double y, double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag, bool abs = true);
+ virtual void svgMoveTo(float x1, float y1, bool closed, bool abs = true) = 0;
+ virtual void svgLineTo(float x1, float y1, bool abs = true) = 0;
+ virtual void svgLineToHorizontal(float x, bool abs = true);
+ virtual void svgLineToVertical(float y, bool abs = true);
+ virtual void svgCurveToCubic(float x1, float y1, float x2, float y2, float x, float y, bool abs = true) = 0;
+ virtual void svgCurveToCubicSmooth(float x, float y, float x2, float y2, bool abs = true);
+ virtual void svgCurveToQuadratic(float x, float y, float x1, float y1, bool abs = true);
+ virtual void svgCurveToQuadraticSmooth(float x, float y, bool abs = true);
+ virtual void svgArcTo(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, bool abs = true);
virtual void svgClosePath() = 0;
private:
void calculateArc(bool relative, double& curx, double& cury, double angle, double x, double y, double r1, double r2, bool largeArcFlag, bool sweepFlag);
, SVGLangSpace()
, SVGExternalResourcesRequired()
, SVGPathParser()
- , m_pathLength(0.0)
+ , m_pathLength(0.0f)
{
}
{
}
-ANIMATED_PROPERTY_DEFINITIONS(SVGPathElement, double, Number, number, PathLength, pathLength, SVGNames::pathLengthAttr.localName(), m_pathLength)
+ANIMATED_PROPERTY_DEFINITIONS(SVGPathElement, float, Number, number, PathLength, pathLength, SVGNames::pathLengthAttr.localName(), m_pathLength)
-double SVGPathElement::getTotalLength()
+float SVGPathElement::getTotalLength()
{
// FIXME: this may wish to use the pathSegList instead of the pathdata if that's cheaper to build (or cached)
return toPathData().length();
}
-FloatPoint SVGPathElement::getPointAtLength(double length)
+FloatPoint SVGPathElement::getPointAtLength(float length)
{
// FIXME: this may wish to use the pathSegList instead of the pathdata if that's cheaper to build (or cached)
bool ok = false;
return toPathData().pointAtLength(length, ok);
}
-unsigned long SVGPathElement::getPathSegAtLength(double length)
+unsigned long SVGPathElement::getPathSegAtLength(float length)
{
return pathSegList()->getPathSegAtLength(length);
}
return new SVGPathSegClosePath();
}
-SVGPathSegMovetoAbs* SVGPathElement::createSVGPathSegMovetoAbs(double x, double y)
+SVGPathSegMovetoAbs* SVGPathElement::createSVGPathSegMovetoAbs(float x, float y)
{
return new SVGPathSegMovetoAbs(x, y);
}
-SVGPathSegMovetoRel* SVGPathElement::createSVGPathSegMovetoRel(double x, double y)
+SVGPathSegMovetoRel* SVGPathElement::createSVGPathSegMovetoRel(float x, float y)
{
return new SVGPathSegMovetoRel(x, y);
}
-SVGPathSegLinetoAbs* SVGPathElement::createSVGPathSegLinetoAbs(double x, double y)
+SVGPathSegLinetoAbs* SVGPathElement::createSVGPathSegLinetoAbs(float x, float y)
{
return new SVGPathSegLinetoAbs(x, y);
}
-SVGPathSegLinetoRel* SVGPathElement::createSVGPathSegLinetoRel(double x, double y)
+SVGPathSegLinetoRel* SVGPathElement::createSVGPathSegLinetoRel(float x, float y)
{
return new SVGPathSegLinetoRel(x, y);
}
-SVGPathSegCurvetoCubicAbs* SVGPathElement::createSVGPathSegCurvetoCubicAbs(double x, double y, double x1, double y1, double x2, double y2)
+SVGPathSegCurvetoCubicAbs* SVGPathElement::createSVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2)
{
return new SVGPathSegCurvetoCubicAbs(x, y, x1, y1, x2, y2);
}
-SVGPathSegCurvetoCubicRel* SVGPathElement::createSVGPathSegCurvetoCubicRel(double x, double y, double x1, double y1, double x2, double y2)
+SVGPathSegCurvetoCubicRel* SVGPathElement::createSVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2)
{
return new SVGPathSegCurvetoCubicRel(x, y, x1, y1, x2, y2);
}
-SVGPathSegCurvetoQuadraticAbs* SVGPathElement::createSVGPathSegCurvetoQuadraticAbs(double x, double y, double x1, double y1)
+SVGPathSegCurvetoQuadraticAbs* SVGPathElement::createSVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1)
{
return new SVGPathSegCurvetoQuadraticAbs(x, y, x1, y1);
}
-SVGPathSegCurvetoQuadraticRel* SVGPathElement::createSVGPathSegCurvetoQuadraticRel(double x, double y, double x1, double y1)
+SVGPathSegCurvetoQuadraticRel* SVGPathElement::createSVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1)
{
return new SVGPathSegCurvetoQuadraticRel(x, y, x1, y1);
}
-SVGPathSegArcAbs* SVGPathElement::createSVGPathSegArcAbs(double x, double y, double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag)
+SVGPathSegArcAbs* SVGPathElement::createSVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag)
{
return new SVGPathSegArcAbs(x, y, r1, r2, angle, largeArcFlag, sweepFlag);
}
-SVGPathSegArcRel* SVGPathElement::createSVGPathSegArcRel(double x, double y, double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag)
+SVGPathSegArcRel* SVGPathElement::createSVGPathSegArcRel(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag)
{
return new SVGPathSegArcRel(x, y, r1, r2, angle, largeArcFlag, sweepFlag);
}
-SVGPathSegLinetoHorizontalAbs* SVGPathElement::createSVGPathSegLinetoHorizontalAbs(double x)
+SVGPathSegLinetoHorizontalAbs* SVGPathElement::createSVGPathSegLinetoHorizontalAbs(float x)
{
return new SVGPathSegLinetoHorizontalAbs(x);
}
-SVGPathSegLinetoHorizontalRel* SVGPathElement::createSVGPathSegLinetoHorizontalRel(double x)
+SVGPathSegLinetoHorizontalRel* SVGPathElement::createSVGPathSegLinetoHorizontalRel(float x)
{
return new SVGPathSegLinetoHorizontalRel(x);
}
-SVGPathSegLinetoVerticalAbs* SVGPathElement::createSVGPathSegLinetoVerticalAbs(double y)
+SVGPathSegLinetoVerticalAbs* SVGPathElement::createSVGPathSegLinetoVerticalAbs(float y)
{
return new SVGPathSegLinetoVerticalAbs(y);
}
-SVGPathSegLinetoVerticalRel* SVGPathElement::createSVGPathSegLinetoVerticalRel(double y)
+SVGPathSegLinetoVerticalRel* SVGPathElement::createSVGPathSegLinetoVerticalRel(float y)
{
return new SVGPathSegLinetoVerticalRel(y);
}
-SVGPathSegCurvetoCubicSmoothAbs* SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs(double x, double y, double x2, double y2)
+SVGPathSegCurvetoCubicSmoothAbs* SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2)
{
return new SVGPathSegCurvetoCubicSmoothAbs(x, y, x2, y2);
}
-SVGPathSegCurvetoCubicSmoothRel* SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel(double x, double y, double x2, double y2)
+SVGPathSegCurvetoCubicSmoothRel* SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2)
{
return new SVGPathSegCurvetoCubicSmoothRel(x, y, x2, y2);
}
-SVGPathSegCurvetoQuadraticSmoothAbs* SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs(double x, double y)
+SVGPathSegCurvetoQuadraticSmoothAbs* SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y)
{
return new SVGPathSegCurvetoQuadraticSmoothAbs(x, y);
}
-SVGPathSegCurvetoQuadraticSmoothRel* SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel(double x, double y)
+SVGPathSegCurvetoQuadraticSmoothRel* SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel(float x, float y)
{
return new SVGPathSegCurvetoQuadraticSmoothRel(x, y);
}
-void SVGPathElement::svgMoveTo(double x1, double y1, bool, bool abs)
+void SVGPathElement::svgMoveTo(float x1, float y1, bool, bool abs)
{
ExceptionCode ec = 0;
pathSegList()->appendItem(createSVGPathSegMovetoRel(x1, y1), ec);
}
-void SVGPathElement::svgLineTo(double x1, double y1, bool abs)
+void SVGPathElement::svgLineTo(float x1, float y1, bool abs)
{
ExceptionCode ec = 0;
pathSegList()->appendItem(createSVGPathSegLinetoRel(x1, y1), ec);
}
-void SVGPathElement::svgLineToHorizontal(double x, bool abs)
+void SVGPathElement::svgLineToHorizontal(float x, bool abs)
{
ExceptionCode ec = 0;
pathSegList()->appendItem(createSVGPathSegLinetoHorizontalRel(x), ec);
}
-void SVGPathElement::svgLineToVertical(double y, bool abs)
+void SVGPathElement::svgLineToVertical(float y, bool abs)
{
ExceptionCode ec = 0;
pathSegList()->appendItem(createSVGPathSegLinetoVerticalRel(y), ec);
}
-void SVGPathElement::svgCurveToCubic(double x1, double y1, double x2, double y2, double x, double y, bool abs)
+void SVGPathElement::svgCurveToCubic(float x1, float y1, float x2, float y2, float x, float y, bool abs)
{
ExceptionCode ec = 0;
pathSegList()->appendItem(createSVGPathSegCurvetoCubicRel(x, y, x1, y1, x2, y2), ec);
}
-void SVGPathElement::svgCurveToCubicSmooth(double x, double y, double x2, double y2, bool abs)
+void SVGPathElement::svgCurveToCubicSmooth(float x, float y, float x2, float y2, bool abs)
{
ExceptionCode ec = 0;
pathSegList()->appendItem(createSVGPathSegCurvetoCubicSmoothRel(x2, y2, x, y), ec);
}
-void SVGPathElement::svgCurveToQuadratic(double x, double y, double x1, double y1, bool abs)
+void SVGPathElement::svgCurveToQuadratic(float x, float y, float x1, float y1, bool abs)
{
ExceptionCode ec = 0;
pathSegList()->appendItem(createSVGPathSegCurvetoQuadraticRel(x1, y1, x, y), ec);
}
-void SVGPathElement::svgCurveToQuadraticSmooth(double x, double y, bool abs)
+void SVGPathElement::svgCurveToQuadraticSmooth(float x, float y, bool abs)
{
ExceptionCode ec = 0;
pathSegList()->appendItem(createSVGPathSegCurvetoQuadraticSmoothRel(x, y), ec);
}
-void SVGPathElement::svgArcTo(double x, double y, double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag, bool abs)
+void SVGPathElement::svgArcTo(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, bool abs)
{
ExceptionCode ec = 0;
if (!parseSVG(attr->value(), true))
document()->accessSVGExtensions()->reportError("Problem parsing d=\"" + attr->value() + "\"");
} else if (attr->name() == SVGNames::pathLengthAttr) {
- m_pathLength = attr->value().toDouble();
- if (m_pathLength < 0.0)
+ m_pathLength = attr->value().toFloat();
+ if (m_pathLength < 0.0f)
document()->accessSVGExtensions()->reportError("A negative value for path attribute <pathLength> is not allowed");
} else {
if (SVGTests::parseMappedAttribute(attr))
#include "SVGStyledTransformableElement.h"
#include "SVGTests.h"
-namespace WebCore
-{
+namespace WebCore {
+
class SVGPathSeg;
class SVGPathSegArcAbs;
class SVGPathSegArcRel;
virtual ~SVGPathElement();
virtual bool isValid() const { return SVGTests::isValid(); }
- double getTotalLength();
- FloatPoint getPointAtLength(double distance);
- unsigned long getPathSegAtLength(double distance);
+ float getTotalLength();
+ FloatPoint getPointAtLength(float distance);
+ unsigned long getPathSegAtLength(float distance);
SVGPathSegClosePath* createSVGPathSegClosePath();
- SVGPathSegMovetoAbs* createSVGPathSegMovetoAbs(double x, double y);
- SVGPathSegMovetoRel* createSVGPathSegMovetoRel(double x, double y);
- SVGPathSegLinetoAbs* createSVGPathSegLinetoAbs(double x, double y);
- SVGPathSegLinetoRel* createSVGPathSegLinetoRel(double x, double y);
- SVGPathSegCurvetoCubicAbs* createSVGPathSegCurvetoCubicAbs(double x, double y, double x1, double y1, double x2, double y2);
- SVGPathSegCurvetoCubicRel* createSVGPathSegCurvetoCubicRel(double x, double y, double x1, double y1, double x2, double y2);
- SVGPathSegCurvetoQuadraticAbs* createSVGPathSegCurvetoQuadraticAbs(double x, double y, double x1, double y1);
- SVGPathSegCurvetoQuadraticRel* createSVGPathSegCurvetoQuadraticRel(double x, double y, double x1, double y1);
- SVGPathSegArcAbs* createSVGPathSegArcAbs(double x, double y, double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag);
- SVGPathSegArcRel* createSVGPathSegArcRel(double x, double y, double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag);
- SVGPathSegLinetoHorizontalAbs* createSVGPathSegLinetoHorizontalAbs(double x);
- SVGPathSegLinetoHorizontalRel* createSVGPathSegLinetoHorizontalRel(double x);
- SVGPathSegLinetoVerticalAbs* createSVGPathSegLinetoVerticalAbs(double y);
- SVGPathSegLinetoVerticalRel* createSVGPathSegLinetoVerticalRel(double y);
- SVGPathSegCurvetoCubicSmoothAbs* createSVGPathSegCurvetoCubicSmoothAbs(double x, double y, double x2, double y2);
- SVGPathSegCurvetoCubicSmoothRel* createSVGPathSegCurvetoCubicSmoothRel(double x, double y, double x2, double y2);
- SVGPathSegCurvetoQuadraticSmoothAbs* createSVGPathSegCurvetoQuadraticSmoothAbs(double x, double y);
- SVGPathSegCurvetoQuadraticSmoothRel* createSVGPathSegCurvetoQuadraticSmoothRel(double x, double y);
+ SVGPathSegMovetoAbs* createSVGPathSegMovetoAbs(float x, float y);
+ SVGPathSegMovetoRel* createSVGPathSegMovetoRel(float x, float y);
+ SVGPathSegLinetoAbs* createSVGPathSegLinetoAbs(float x, float y);
+ SVGPathSegLinetoRel* createSVGPathSegLinetoRel(float x, float y);
+ SVGPathSegCurvetoCubicAbs* createSVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2);
+ SVGPathSegCurvetoCubicRel* createSVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2);
+ SVGPathSegCurvetoQuadraticAbs* createSVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1);
+ SVGPathSegCurvetoQuadraticRel* createSVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1);
+ SVGPathSegArcAbs* createSVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag);
+ SVGPathSegArcRel* createSVGPathSegArcRel(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag);
+ SVGPathSegLinetoHorizontalAbs* createSVGPathSegLinetoHorizontalAbs(float x);
+ SVGPathSegLinetoHorizontalRel* createSVGPathSegLinetoHorizontalRel(float x);
+ SVGPathSegLinetoVerticalAbs* createSVGPathSegLinetoVerticalAbs(float y);
+ SVGPathSegLinetoVerticalRel* createSVGPathSegLinetoVerticalRel(float y);
+ SVGPathSegCurvetoCubicSmoothAbs* createSVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2);
+ SVGPathSegCurvetoCubicSmoothRel* createSVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2);
+ SVGPathSegCurvetoQuadraticSmoothAbs* createSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y);
+ SVGPathSegCurvetoQuadraticSmoothRel* createSVGPathSegCurvetoQuadraticSmoothRel(float x, float y);
// Derived from: 'SVGAnimatedPathData'
virtual SVGPathSegList* pathSegList() const;
ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGExternalResourcesRequired, bool, ExternalResourcesRequired, externalResourcesRequired)
- ANIMATED_PROPERTY_DECLARATIONS(SVGPathElement, double, double, PathLength, pathLength)
-
- virtual void svgMoveTo(double x1, double y1, bool closed, bool abs = true);
- virtual void svgLineTo(double x1, double y1, bool abs = true);
- virtual void svgLineToHorizontal(double x, bool abs = true);
- virtual void svgLineToVertical(double y, bool abs = true);
- virtual void svgCurveToCubic(double x1, double y1, double x2, double y2, double x, double y, bool abs = true);
- virtual void svgCurveToCubicSmooth(double x, double y, double x2, double y2, bool abs = true);
- virtual void svgCurveToQuadratic(double x, double y, double x1, double y1, bool abs = true);
- virtual void svgCurveToQuadraticSmooth(double x, double y, bool abs = true);
- virtual void svgArcTo(double x, double y, double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag, bool abs = true);
+ ANIMATED_PROPERTY_DECLARATIONS(SVGPathElement, float, float, PathLength, pathLength)
+
+ virtual void svgMoveTo(float x1, float y1, bool closed, bool abs = true);
+ virtual void svgLineTo(float x1, float y1, bool abs = true);
+ virtual void svgLineToHorizontal(float x, bool abs = true);
+ virtual void svgLineToVertical(float y, bool abs = true);
+ virtual void svgCurveToCubic(float x1, float y1, float x2, float y2, float x, float y, bool abs = true);
+ virtual void svgCurveToCubicSmooth(float x, float y, float x2, float y2, bool abs = true);
+ virtual void svgCurveToQuadratic(float x, float y, float x1, float y1, bool abs = true);
+ virtual void svgCurveToQuadraticSmooth(float x, float y, bool abs = true);
+ virtual void svgArcTo(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, bool abs = true);
virtual void svgClosePath();
};
namespace WebCore {
-SVGPathSegArcAbs::SVGPathSegArcAbs(double x, double y, double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag)
+SVGPathSegArcAbs::SVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag)
: SVGPathSeg()
, m_x(x)
, m_y(y)
{
}
-void SVGPathSegArcAbs::setX(double x)
+void SVGPathSegArcAbs::setX(float x)
{
m_x = x;
}
-double SVGPathSegArcAbs::x() const
+float SVGPathSegArcAbs::x() const
{
return m_x;
}
-void SVGPathSegArcAbs::setY(double y)
+void SVGPathSegArcAbs::setY(float y)
{
m_y = y;
}
-double SVGPathSegArcAbs::y() const
+float SVGPathSegArcAbs::y() const
{
return m_y;
}
-void SVGPathSegArcAbs::setR1(double r1)
+void SVGPathSegArcAbs::setR1(float r1)
{
m_r1 = r1;
}
-double SVGPathSegArcAbs::r1() const
+float SVGPathSegArcAbs::r1() const
{
return m_r1;
}
-void SVGPathSegArcAbs::setR2(double r2)
+void SVGPathSegArcAbs::setR2(float r2)
{
m_r2 = r2;
}
-double SVGPathSegArcAbs::r2() const
+float SVGPathSegArcAbs::r2() const
{
return m_r2;
}
-void SVGPathSegArcAbs::setAngle(double angle)
+void SVGPathSegArcAbs::setAngle(float angle)
{
m_angle = angle;
}
-double SVGPathSegArcAbs::angle() const
+float SVGPathSegArcAbs::angle() const
{
return m_angle;
}
-SVGPathSegArcRel::SVGPathSegArcRel(double x, double y, double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag)
+SVGPathSegArcRel::SVGPathSegArcRel(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag)
: SVGPathSeg()
, m_x(x)
, m_y(y)
{
}
-void SVGPathSegArcRel::setX(double x)
+void SVGPathSegArcRel::setX(float x)
{
m_x = x;
}
-double SVGPathSegArcRel::x() const
+float SVGPathSegArcRel::x() const
{
return m_x;
}
-void SVGPathSegArcRel::setY(double y)
+void SVGPathSegArcRel::setY(float y)
{
m_y = y;
}
-double SVGPathSegArcRel::y() const
+float SVGPathSegArcRel::y() const
{
return m_y;
}
-void SVGPathSegArcRel::setR1(double r1)
+void SVGPathSegArcRel::setR1(float r1)
{
m_r1 = r1;
}
-double SVGPathSegArcRel::r1() const
+float SVGPathSegArcRel::r1() const
{
return m_r1;
}
-void SVGPathSegArcRel::setR2(double r2)
+void SVGPathSegArcRel::setR2(float r2)
{
m_r2 = r2;
}
-double SVGPathSegArcRel::r2() const
+float SVGPathSegArcRel::r2() const
{
return m_r2;
}
-void SVGPathSegArcRel::setAngle(double angle)
+void SVGPathSegArcRel::setAngle(float angle)
{
m_angle = angle;
}
-double SVGPathSegArcRel::angle() const
+float SVGPathSegArcRel::angle() const
{
return m_angle;
}
#include "SVGPathSeg.h"
-namespace WebCore
-{
- class SVGPathSegArcAbs : public SVGPathSeg
- {
+namespace WebCore {
+
+ class SVGPathSegArcAbs : public SVGPathSeg {
public:
- SVGPathSegArcAbs(double x, double y, double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag);
+ SVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag);
virtual ~SVGPathSegArcAbs();
virtual unsigned short pathSegType() const { return PATHSEG_ARC_ABS; }
virtual String pathSegTypeAsLetter() const { return "A"; }
virtual String toString() const { return String::format("A %.6lg %.6lg %.6lg %d %d %.6lg %.6lg", m_r1, m_r2, m_angle, m_largeArcFlag, m_sweepFlag, m_x, m_y); }
- void setX(double x);
- double x() const;
+ void setX(float x);
+ float x() const;
- void setY(double y);
- double y() const;
+ void setY(float y);
+ float y() const;
- void setR1(double r1);
- double r1() const;
+ void setR1(float r1);
+ float r1() const;
- void setR2(double r2);
- double r2() const;
+ void setR2(float r2);
+ float r2() const;
- void setAngle(double angle);
- double angle() const;
+ void setAngle(float angle);
+ float angle() const;
void setLargeArcFlag(bool largeArcFlag);
bool largeArcFlag() const;
bool sweepFlag() const;
private:
- double m_x;
- double m_y;
- double m_r1;
- double m_r2;
- double m_angle;
+ float m_x;
+ float m_y;
+ float m_r1;
+ float m_r2;
+ float m_angle;
bool m_largeArcFlag : 1;
bool m_sweepFlag : 1;
};
- class SVGPathSegArcRel : public SVGPathSeg
- {
+ class SVGPathSegArcRel : public SVGPathSeg {
public:
- SVGPathSegArcRel(double x, double y, double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag);
+ SVGPathSegArcRel(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag);
virtual ~SVGPathSegArcRel();
virtual unsigned short pathSegType() const { return PATHSEG_ARC_REL; }
virtual String pathSegTypeAsLetter() const { return "a"; }
virtual String toString() const { return String::format("a %.6lg %.6lg %.6lg %d %d %.6lg %.6lg", m_r1, m_r2, m_angle, m_largeArcFlag, m_sweepFlag, m_x, m_y); }
- void setX(double x);
- double x() const;
+ void setX(float x);
+ float x() const;
- void setY(double y);
- double y() const;
+ void setY(float y);
+ float y() const;
- void setR1(double r1);
- double r1() const;
+ void setR1(float r1);
+ float r1() const;
- void setR2(double r2);
- double r2() const;
+ void setR2(float r2);
+ float r2() const;
- void setAngle(double angle);
- double angle() const;
+ void setAngle(float angle);
+ float angle() const;
void setLargeArcFlag(bool largeArcFlag);
bool largeArcFlag() const;
bool sweepFlag() const;
private:
- double m_x;
- double m_y;
- double m_r1;
- double m_r2;
- double m_angle;
+ float m_x;
+ float m_y;
+ float m_r1;
+ float m_r2;
+ float m_angle;
bool m_largeArcFlag : 1;
bool m_sweepFlag : 1;
namespace WebCore {
-SVGPathSegCurvetoCubicAbs::SVGPathSegCurvetoCubicAbs(double x, double y, double x1, double y1, double x2, double y2)
+SVGPathSegCurvetoCubicAbs::SVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2)
: SVGPathSeg()
, m_x(x)
, m_y(y)
{
}
-void SVGPathSegCurvetoCubicAbs::setX(double x)
+void SVGPathSegCurvetoCubicAbs::setX(float x)
{
m_x = x;
}
-double SVGPathSegCurvetoCubicAbs::x() const
+float SVGPathSegCurvetoCubicAbs::x() const
{
return m_x;
}
-void SVGPathSegCurvetoCubicAbs::setY(double y)
+void SVGPathSegCurvetoCubicAbs::setY(float y)
{
m_y = y;
}
-double SVGPathSegCurvetoCubicAbs::y() const
+float SVGPathSegCurvetoCubicAbs::y() const
{
return m_y;
}
-void SVGPathSegCurvetoCubicAbs::setX1(double x1)
+void SVGPathSegCurvetoCubicAbs::setX1(float x1)
{
m_x1 = x1;
}
-double SVGPathSegCurvetoCubicAbs::x1() const
+float SVGPathSegCurvetoCubicAbs::x1() const
{
return m_x1;
}
-void SVGPathSegCurvetoCubicAbs::setY1(double y1)
+void SVGPathSegCurvetoCubicAbs::setY1(float y1)
{
m_y1 = y1;
}
-double SVGPathSegCurvetoCubicAbs::y1() const
+float SVGPathSegCurvetoCubicAbs::y1() const
{
return m_y1;
}
-void SVGPathSegCurvetoCubicAbs::setX2(double x2)
+void SVGPathSegCurvetoCubicAbs::setX2(float x2)
{
m_x2 = x2;
}
-double SVGPathSegCurvetoCubicAbs::x2() const
+float SVGPathSegCurvetoCubicAbs::x2() const
{
return m_x2;
}
-void SVGPathSegCurvetoCubicAbs::setY2(double y2)
+void SVGPathSegCurvetoCubicAbs::setY2(float y2)
{
m_y2 = y2;
}
-double SVGPathSegCurvetoCubicAbs::y2() const
+float SVGPathSegCurvetoCubicAbs::y2() const
{
return m_y2;
}
-SVGPathSegCurvetoCubicRel::SVGPathSegCurvetoCubicRel(double x, double y, double x1, double y1, double x2, double y2)
+SVGPathSegCurvetoCubicRel::SVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2)
: SVGPathSeg()
, m_x(x)
, m_y(y)
{
}
-void SVGPathSegCurvetoCubicRel::setX(double x)
+void SVGPathSegCurvetoCubicRel::setX(float x)
{
m_x = x;
}
-double SVGPathSegCurvetoCubicRel::x() const
+float SVGPathSegCurvetoCubicRel::x() const
{
return m_x;
}
-void SVGPathSegCurvetoCubicRel::setY(double y)
+void SVGPathSegCurvetoCubicRel::setY(float y)
{
m_y = y;
}
-double SVGPathSegCurvetoCubicRel::y() const
+float SVGPathSegCurvetoCubicRel::y() const
{
return m_y;
}
-void SVGPathSegCurvetoCubicRel::setX1(double x1)
+void SVGPathSegCurvetoCubicRel::setX1(float x1)
{
m_x1 = x1;
}
-double SVGPathSegCurvetoCubicRel::x1() const
+float SVGPathSegCurvetoCubicRel::x1() const
{
return m_x1;
}
-void SVGPathSegCurvetoCubicRel::setY1(double y1)
+void SVGPathSegCurvetoCubicRel::setY1(float y1)
{
m_y1 = y1;
}
-double SVGPathSegCurvetoCubicRel::y1() const
+float SVGPathSegCurvetoCubicRel::y1() const
{
return m_y1;
}
-void SVGPathSegCurvetoCubicRel::setX2(double x2)
+void SVGPathSegCurvetoCubicRel::setX2(float x2)
{
m_x2 = x2;
}
-double SVGPathSegCurvetoCubicRel::x2() const
+float SVGPathSegCurvetoCubicRel::x2() const
{
return m_x2;
}
-void SVGPathSegCurvetoCubicRel::setY2(double y2)
+void SVGPathSegCurvetoCubicRel::setY2(float y2)
{
m_y2 = y2;
}
-double SVGPathSegCurvetoCubicRel::y2() const
+float SVGPathSegCurvetoCubicRel::y2() const
{
return m_y2;
}
#include "SVGPathSeg.h"
-namespace WebCore
-{
- class SVGPathSegCurvetoCubicAbs : public SVGPathSeg
- {
+namespace WebCore {
+ class SVGPathSegCurvetoCubicAbs : public SVGPathSeg {
public:
- SVGPathSegCurvetoCubicAbs(double x, double y, double x1, double y1, double x2, double y2);
+ SVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2);
virtual ~SVGPathSegCurvetoCubicAbs();
virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_CUBIC_ABS; }
virtual String pathSegTypeAsLetter() const { return "C"; }
virtual String toString() const { return String::format("C %.6lg %.6lg %.6lg %.6lg %.6lg %.6lg", m_x1, m_y1, m_x2, m_y2, m_x, m_y); }
- void setX(double);
- double x() const;
+ void setX(float);
+ float x() const;
- void setY(double);
- double y() const;
+ void setY(float);
+ float y() const;
- void setX1(double);
- double x1() const;
+ void setX1(float);
+ float x1() const;
- void setY1(double);
- double y1() const;
+ void setY1(float);
+ float y1() const;
- void setX2(double);
- double x2() const;
+ void setX2(float);
+ float x2() const;
- void setY2(double);
- double y2() const;
+ void setY2(float);
+ float y2() const;
private:
- double m_x;
- double m_y;
- double m_x1;
- double m_y1;
- double m_x2;
- double m_y2;
+ float m_x;
+ float m_y;
+ float m_x1;
+ float m_y1;
+ float m_x2;
+ float m_y2;
};
- class SVGPathSegCurvetoCubicRel : public SVGPathSeg
- {
+ class SVGPathSegCurvetoCubicRel : public SVGPathSeg {
public:
- SVGPathSegCurvetoCubicRel(double x, double y, double x1, double y1, double x2, double y2);
+ SVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2);
virtual ~SVGPathSegCurvetoCubicRel();
virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_CUBIC_REL; }
virtual String pathSegTypeAsLetter() const { return "c"; }
virtual String toString() const { return String::format("c %.6lg %.6lg %.6lg %.6lg %.6lg %.6lg", m_x1, m_y1, m_x2, m_y2, m_x, m_y); }
- void setX(double);
- double x() const;
+ void setX(float);
+ float x() const;
- void setY(double);
- double y() const;
+ void setY(float);
+ float y() const;
- void setX1(double);
- double x1() const;
+ void setX1(float);
+ float x1() const;
- void setY1(double);
- double y1() const;
+ void setY1(float);
+ float y1() const;
- void setX2(double);
- double x2() const;
+ void setX2(float);
+ float x2() const;
- void setY2(double);
- double y2() const;
+ void setY2(float);
+ float y2() const;
private:
- double m_x;
- double m_y;
- double m_x1;
- double m_y1;
- double m_x2;
- double m_y2;
+ float m_x;
+ float m_y;
+ float m_x1;
+ float m_y1;
+ float m_x2;
+ float m_y2;
};
} // namespace WebCore
namespace WebCore {
-SVGPathSegCurvetoCubicSmoothAbs::SVGPathSegCurvetoCubicSmoothAbs(double x, double y, double x2, double y2)
+SVGPathSegCurvetoCubicSmoothAbs::SVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2)
: SVGPathSeg()
, m_x(x)
, m_y(y)
{
}
-void SVGPathSegCurvetoCubicSmoothAbs::setX(double x)
+void SVGPathSegCurvetoCubicSmoothAbs::setX(float x)
{
m_x = x;
}
-double SVGPathSegCurvetoCubicSmoothAbs::x() const
+float SVGPathSegCurvetoCubicSmoothAbs::x() const
{
return m_x;
}
-void SVGPathSegCurvetoCubicSmoothAbs::setY(double y)
+void SVGPathSegCurvetoCubicSmoothAbs::setY(float y)
{
m_y = y;
}
-double SVGPathSegCurvetoCubicSmoothAbs::y() const
+float SVGPathSegCurvetoCubicSmoothAbs::y() const
{
return m_y;
}
-void SVGPathSegCurvetoCubicSmoothAbs::setX2(double x2)
+void SVGPathSegCurvetoCubicSmoothAbs::setX2(float x2)
{
m_x2 = x2;
}
-double SVGPathSegCurvetoCubicSmoothAbs::x2() const
+float SVGPathSegCurvetoCubicSmoothAbs::x2() const
{
return m_x2;
}
-void SVGPathSegCurvetoCubicSmoothAbs::setY2(double y2)
+void SVGPathSegCurvetoCubicSmoothAbs::setY2(float y2)
{
m_y2 = y2;
}
-double SVGPathSegCurvetoCubicSmoothAbs::y2() const
+float SVGPathSegCurvetoCubicSmoothAbs::y2() const
{
return m_y2;
}
-SVGPathSegCurvetoCubicSmoothRel::SVGPathSegCurvetoCubicSmoothRel(double x, double y, double x2, double y2)
+SVGPathSegCurvetoCubicSmoothRel::SVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2)
: SVGPathSeg()
, m_x(x)
, m_y(y)
{
}
-void SVGPathSegCurvetoCubicSmoothRel::setX(double x)
+void SVGPathSegCurvetoCubicSmoothRel::setX(float x)
{
m_x = x;
}
-double SVGPathSegCurvetoCubicSmoothRel::x() const
+float SVGPathSegCurvetoCubicSmoothRel::x() const
{
return m_x;
}
-void SVGPathSegCurvetoCubicSmoothRel::setY(double y)
+void SVGPathSegCurvetoCubicSmoothRel::setY(float y)
{
m_y = y;
}
-double SVGPathSegCurvetoCubicSmoothRel::y() const
+float SVGPathSegCurvetoCubicSmoothRel::y() const
{
return m_y;
}
-void SVGPathSegCurvetoCubicSmoothRel::setX2(double x2)
+void SVGPathSegCurvetoCubicSmoothRel::setX2(float x2)
{
m_x2 = x2;
}
-double SVGPathSegCurvetoCubicSmoothRel::x2() const
+float SVGPathSegCurvetoCubicSmoothRel::x2() const
{
return m_x2;
}
-void SVGPathSegCurvetoCubicSmoothRel::setY2(double y2)
+void SVGPathSegCurvetoCubicSmoothRel::setY2(float y2)
{
m_y2 = y2;
}
-double SVGPathSegCurvetoCubicSmoothRel::y2() const
+float SVGPathSegCurvetoCubicSmoothRel::y2() const
{
return m_y2;
}
#include "SVGPathSeg.h"
-namespace WebCore
-{
- class SVGPathSegCurvetoCubicSmoothAbs : public SVGPathSeg
- {
+namespace WebCore {
+
+ class SVGPathSegCurvetoCubicSmoothAbs : public SVGPathSeg {
public:
- SVGPathSegCurvetoCubicSmoothAbs(double x, double y, double x2, double y2);
+ SVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2);
virtual ~SVGPathSegCurvetoCubicSmoothAbs();
virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_CUBIC_SMOOTH_ABS; }
virtual String pathSegTypeAsLetter() const { return "S"; }
virtual String toString() const { return String::format("S %.6lg %.6lg %.6lg %.6lg", m_x2, m_y2, m_x, m_y); }
- void setX(double);
- double x() const;
+ void setX(float);
+ float x() const;
- void setY(double);
- double y() const;
+ void setY(float);
+ float y() const;
- void setX2(double);
- double x2() const;
+ void setX2(float);
+ float x2() const;
- void setY2(double);
- double y2() const;
+ void setY2(float);
+ float y2() const;
private:
- double m_x;
- double m_y;
- double m_x2;
- double m_y2;
+ float m_x;
+ float m_y;
+ float m_x2;
+ float m_y2;
};
- class SVGPathSegCurvetoCubicSmoothRel : public SVGPathSeg
- {
+ class SVGPathSegCurvetoCubicSmoothRel : public SVGPathSeg {
public:
- SVGPathSegCurvetoCubicSmoothRel(double x, double y, double x2, double y2);
+ SVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2);
virtual ~SVGPathSegCurvetoCubicSmoothRel();
virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_CUBIC_SMOOTH_REL; }
virtual String pathSegTypeAsLetter() const { return "s"; }
virtual String toString() const { return String::format("s %.6lg %.6lg %.6lg %.6lg", m_x2, m_y2, m_x, m_y); }
- void setX(double);
- double x() const;
+ void setX(float);
+ float x() const;
- void setY(double);
- double y() const;
+ void setY(float);
+ float y() const;
- void setX2(double);
- double x2() const;
+ void setX2(float);
+ float x2() const;
- void setY2(double);
- double y2() const;
+ void setY2(float);
+ float y2() const;
private:
- double m_x;
- double m_y;
- double m_x2;
- double m_y2;
+ float m_x;
+ float m_y;
+ float m_x2;
+ float m_y2;
};
} // namespace WebCore
namespace WebCore {
-SVGPathSegCurvetoQuadraticAbs::SVGPathSegCurvetoQuadraticAbs(double x, double y, double x1, double y1)
+SVGPathSegCurvetoQuadraticAbs::SVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1)
: SVGPathSeg()
, m_x(x)
, m_y(y)
{
}
-void SVGPathSegCurvetoQuadraticAbs::setX(double x)
+void SVGPathSegCurvetoQuadraticAbs::setX(float x)
{
m_x = x;
}
-double SVGPathSegCurvetoQuadraticAbs::x() const
+float SVGPathSegCurvetoQuadraticAbs::x() const
{
return m_x;
}
-void SVGPathSegCurvetoQuadraticAbs::setY(double y)
+void SVGPathSegCurvetoQuadraticAbs::setY(float y)
{
m_y = y;
}
-double SVGPathSegCurvetoQuadraticAbs::y() const
+float SVGPathSegCurvetoQuadraticAbs::y() const
{
return m_y;
}
-void SVGPathSegCurvetoQuadraticAbs::setX1(double x1)
+void SVGPathSegCurvetoQuadraticAbs::setX1(float x1)
{
m_x1 = x1;
}
-double SVGPathSegCurvetoQuadraticAbs::x1() const
+float SVGPathSegCurvetoQuadraticAbs::x1() const
{
return m_x1;
}
-void SVGPathSegCurvetoQuadraticAbs::setY1(double y1)
+void SVGPathSegCurvetoQuadraticAbs::setY1(float y1)
{
m_y1 = y1;
}
-double SVGPathSegCurvetoQuadraticAbs::y1() const
+float SVGPathSegCurvetoQuadraticAbs::y1() const
{
return m_y1;
}
-SVGPathSegCurvetoQuadraticRel::SVGPathSegCurvetoQuadraticRel(double x, double y, double x1, double y1)
+SVGPathSegCurvetoQuadraticRel::SVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1)
: SVGPathSeg()
, m_x(x)
, m_y(y)
{
}
-void SVGPathSegCurvetoQuadraticRel::setX(double x)
+void SVGPathSegCurvetoQuadraticRel::setX(float x)
{
m_x = x;
}
-double SVGPathSegCurvetoQuadraticRel::x() const
+float SVGPathSegCurvetoQuadraticRel::x() const
{
return m_x;
}
-void SVGPathSegCurvetoQuadraticRel::setY(double y)
+void SVGPathSegCurvetoQuadraticRel::setY(float y)
{
m_y = y;
}
-double SVGPathSegCurvetoQuadraticRel::y() const
+float SVGPathSegCurvetoQuadraticRel::y() const
{
return m_y;
}
-void SVGPathSegCurvetoQuadraticRel::setX1(double x1)
+void SVGPathSegCurvetoQuadraticRel::setX1(float x1)
{
m_x1 = x1;
}
-double SVGPathSegCurvetoQuadraticRel::x1() const
+float SVGPathSegCurvetoQuadraticRel::x1() const
{
return m_x1;
}
-void SVGPathSegCurvetoQuadraticRel::setY1(double y1)
+void SVGPathSegCurvetoQuadraticRel::setY1(float y1)
{
m_y1 = y1;
}
-double SVGPathSegCurvetoQuadraticRel::y1() const
+float SVGPathSegCurvetoQuadraticRel::y1() const
{
return m_y1;
}
#include "SVGPathSeg.h"
-namespace WebCore
-{
- class SVGPathSegCurvetoQuadraticAbs : public SVGPathSeg
- {
+namespace WebCore {
+
+ class SVGPathSegCurvetoQuadraticAbs : public SVGPathSeg {
public:
- SVGPathSegCurvetoQuadraticAbs(double x, double y, double x1, double y1);
+ SVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1);
virtual ~SVGPathSegCurvetoQuadraticAbs();
virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_QUADRATIC_ABS; }
virtual String pathSegTypeAsLetter() const { return "Q"; }
virtual String toString() const { return String::format("Q %.6lg %.6lg %.6lg %.6lg", m_x1, m_y1, m_x, m_y); }
- void setX(double);
- double x() const;
+ void setX(float);
+ float x() const;
- void setY(double);
- double y() const;
+ void setY(float);
+ float y() const;
- void setX1(double);
- double x1() const;
+ void setX1(float);
+ float x1() const;
- void setY1(double);
- double y1() const;
+ void setY1(float);
+ float y1() const;
private:
- double m_x;
- double m_y;
- double m_x1;
- double m_y1;
+ float m_x;
+ float m_y;
+ float m_x1;
+ float m_y1;
};
- class SVGPathSegCurvetoQuadraticRel : public SVGPathSeg
- {
+ class SVGPathSegCurvetoQuadraticRel : public SVGPathSeg {
public:
- SVGPathSegCurvetoQuadraticRel(double x, double y, double x1, double y1);
+ SVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1);
virtual ~SVGPathSegCurvetoQuadraticRel();
virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_QUADRATIC_REL; }
virtual String pathSegTypeAsLetter() const { return "q"; }
virtual String toString() const { return String::format("q %.6lg %.6lg %.6lg %.6lg", m_x1, m_y1, m_x, m_y); }
-
- void setX(double);
- double x() const;
- void setY(double);
- double y() const;
+ void setX(float);
+ float x() const;
+
+ void setY(float);
+ float y() const;
- void setX1(double);
- double x1() const;
+ void setX1(float);
+ float x1() const;
- void setY1(double);
- double y1() const;
+ void setY1(float);
+ float y1() const;
private:
- double m_x;
- double m_y;
- double m_x1;
- double m_y1;
+ float m_x;
+ float m_y;
+ float m_x1;
+ float m_y1;
};
} // namespace WebCore
namespace WebCore {
-SVGPathSegCurvetoQuadraticSmoothAbs::SVGPathSegCurvetoQuadraticSmoothAbs(double x, double y)
+SVGPathSegCurvetoQuadraticSmoothAbs::SVGPathSegCurvetoQuadraticSmoothAbs(float x, float y)
: SVGPathSeg()
, m_x(x)
, m_y(y)
{
}
-void SVGPathSegCurvetoQuadraticSmoothAbs::setX(double x)
+void SVGPathSegCurvetoQuadraticSmoothAbs::setX(float x)
{
m_x = x;
}
-double SVGPathSegCurvetoQuadraticSmoothAbs::x() const
+float SVGPathSegCurvetoQuadraticSmoothAbs::x() const
{
return m_x;
}
-void SVGPathSegCurvetoQuadraticSmoothAbs::setY(double y)
+void SVGPathSegCurvetoQuadraticSmoothAbs::setY(float y)
{
m_y = y;
}
-double SVGPathSegCurvetoQuadraticSmoothAbs::y() const
+float SVGPathSegCurvetoQuadraticSmoothAbs::y() const
{
return m_y;
}
-SVGPathSegCurvetoQuadraticSmoothRel::SVGPathSegCurvetoQuadraticSmoothRel(double x, double y)
+SVGPathSegCurvetoQuadraticSmoothRel::SVGPathSegCurvetoQuadraticSmoothRel(float x, float y)
: SVGPathSeg()
, m_x(x)
, m_y(y)
{
}
-void SVGPathSegCurvetoQuadraticSmoothRel::setX(double x)
+void SVGPathSegCurvetoQuadraticSmoothRel::setX(float x)
{
m_x = x;
}
-double SVGPathSegCurvetoQuadraticSmoothRel::x() const
+float SVGPathSegCurvetoQuadraticSmoothRel::x() const
{
return m_x;
}
-void SVGPathSegCurvetoQuadraticSmoothRel::setY(double y)
+void SVGPathSegCurvetoQuadraticSmoothRel::setY(float y)
{
m_y = y;
}
-double SVGPathSegCurvetoQuadraticSmoothRel::y() const
+float SVGPathSegCurvetoQuadraticSmoothRel::y() const
{
return m_y;
}
#include "SVGPathSeg.h"
-namespace WebCore
-{
- class SVGPathSegCurvetoQuadraticSmoothAbs : public SVGPathSeg
- {
+namespace WebCore {
+
+ class SVGPathSegCurvetoQuadraticSmoothAbs : public SVGPathSeg {
public:
- SVGPathSegCurvetoQuadraticSmoothAbs(double x, double y);
+ SVGPathSegCurvetoQuadraticSmoothAbs(float x, float y);
virtual ~SVGPathSegCurvetoQuadraticSmoothAbs();
virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS; }
virtual String pathSegTypeAsLetter() const { return "T"; }
virtual String toString() const { return String::format("T %.6lg %.6lg", m_x, m_y); }
- void setX(double);
- double x() const;
+ void setX(float);
+ float x() const;
- void setY(double);
- double y() const;
+ void setY(float);
+ float y() const;
private:
- double m_x;
- double m_y;
+ float m_x;
+ float m_y;
};
- class SVGPathSegCurvetoQuadraticSmoothRel : public SVGPathSeg
- {
+ class SVGPathSegCurvetoQuadraticSmoothRel : public SVGPathSeg {
public:
- SVGPathSegCurvetoQuadraticSmoothRel(double x, double y);
+ SVGPathSegCurvetoQuadraticSmoothRel(float x, float y);
virtual ~SVGPathSegCurvetoQuadraticSmoothRel();
virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL; }
virtual String pathSegTypeAsLetter() const { return "t"; }
virtual String toString() const { return String::format("t %.6lg %.6lg", m_x, m_y); }
- void setX(double);
- double x() const;
+ void setX(float);
+ float x() const;
- void setY(double);
- double y() const;
+ void setY(float);
+ float y() const;
private:
- double m_x;
- double m_y;
+ float m_x;
+ float m_y;
};
} // namespace WebCore
namespace WebCore {
-SVGPathSegLinetoAbs::SVGPathSegLinetoAbs(double x, double y)
+SVGPathSegLinetoAbs::SVGPathSegLinetoAbs(float x, float y)
: SVGPathSeg()
, m_x(x)
, m_y(y)
{
}
-void SVGPathSegLinetoAbs::setX(double x)
+void SVGPathSegLinetoAbs::setX(float x)
{
m_x = x;
}
-double SVGPathSegLinetoAbs::x() const
+float SVGPathSegLinetoAbs::x() const
{
return m_x;
}
-void SVGPathSegLinetoAbs::setY(double y)
+void SVGPathSegLinetoAbs::setY(float y)
{
m_y = y;
}
-double SVGPathSegLinetoAbs::y() const
+float SVGPathSegLinetoAbs::y() const
{
return m_y;
}
-SVGPathSegLinetoRel::SVGPathSegLinetoRel(double x, double y)
+SVGPathSegLinetoRel::SVGPathSegLinetoRel(float x, float y)
: SVGPathSeg()
, m_x(x)
, m_y(y)
{
}
-void SVGPathSegLinetoRel::setX(double x)
+void SVGPathSegLinetoRel::setX(float x)
{
m_x = x;
}
-double SVGPathSegLinetoRel::x() const
+float SVGPathSegLinetoRel::x() const
{
return m_x;
}
-void SVGPathSegLinetoRel::setY(double y)
+void SVGPathSegLinetoRel::setY(float y)
{
m_y = y;
}
-double SVGPathSegLinetoRel::y() const
+float SVGPathSegLinetoRel::y() const
{
return m_y;
}
#include "SVGPathSeg.h"
-namespace WebCore
-{
- class SVGPathSegLinetoAbs : public SVGPathSeg
- {
+namespace WebCore {
+ class SVGPathSegLinetoAbs : public SVGPathSeg {
public:
- SVGPathSegLinetoAbs(double x, double y);
+ SVGPathSegLinetoAbs(float x, float y);
virtual ~SVGPathSegLinetoAbs();
virtual unsigned short pathSegType() const { return PATHSEG_LINETO_ABS; }
virtual String pathSegTypeAsLetter() const { return "L"; }
virtual String toString() const { return String::format("L %.6lg %.6lg", m_x, m_y); }
- void setX(double);
- double x() const;
+ void setX(float);
+ float x() const;
- void setY(double);
- double y() const;
+ void setY(float);
+ float y() const;
private:
- double m_x;
- double m_y;
+ float m_x;
+ float m_y;
};
- class SVGPathSegLinetoRel : public SVGPathSeg
- {
+ class SVGPathSegLinetoRel : public SVGPathSeg {
public:
- SVGPathSegLinetoRel(double x, double y);
+ SVGPathSegLinetoRel(float x, float y);
virtual ~SVGPathSegLinetoRel();
virtual unsigned short pathSegType() const { return PATHSEG_LINETO_REL; }
virtual String pathSegTypeAsLetter() const { return "l"; }
virtual String toString() const { return String::format("l %.6lg %.6lg", m_x, m_y); }
- void setX(double);
- double x() const;
+ void setX(float);
+ float x() const;
- void setY(double);
- double y() const;
+ void setY(float);
+ float y() const;
private:
- double m_x;
- double m_y;
+ float m_x;
+ float m_y;
};
} // namespace WebCore
namespace WebCore {
-SVGPathSegLinetoHorizontalAbs::SVGPathSegLinetoHorizontalAbs(double x)
+SVGPathSegLinetoHorizontalAbs::SVGPathSegLinetoHorizontalAbs(float x)
: SVGPathSeg()
, m_x(x)
{
{
}
-void SVGPathSegLinetoHorizontalAbs::setX(double x)
+void SVGPathSegLinetoHorizontalAbs::setX(float x)
{
m_x = x;
}
-double SVGPathSegLinetoHorizontalAbs::x() const
+float SVGPathSegLinetoHorizontalAbs::x() const
{
return m_x;
}
-SVGPathSegLinetoHorizontalRel::SVGPathSegLinetoHorizontalRel(double x)
+SVGPathSegLinetoHorizontalRel::SVGPathSegLinetoHorizontalRel(float x)
: SVGPathSeg()
, m_x(x)
{
{
}
-void SVGPathSegLinetoHorizontalRel::setX(double x)
+void SVGPathSegLinetoHorizontalRel::setX(float x)
{
m_x = x;
}
-double SVGPathSegLinetoHorizontalRel::x() const
+float SVGPathSegLinetoHorizontalRel::x() const
{
return m_x;
}
#include "SVGPathSeg.h"
-namespace WebCore
-{
- class SVGPathSegLinetoHorizontalAbs : public SVGPathSeg
- {
+namespace WebCore {
+
+ class SVGPathSegLinetoHorizontalAbs : public SVGPathSeg {
public:
- SVGPathSegLinetoHorizontalAbs(double x);
+ SVGPathSegLinetoHorizontalAbs(float x);
virtual ~SVGPathSegLinetoHorizontalAbs();
virtual unsigned short pathSegType() const { return PATHSEG_LINETO_HORIZONTAL_ABS; }
virtual String pathSegTypeAsLetter() const { return "H"; }
virtual String toString() const { return String::format("H %.6lg", m_x); }
- void setX(double);
- double x() const;
+ void setX(float);
+ float x() const;
private:
- double m_x;
+ float m_x;
};
- class SVGPathSegLinetoHorizontalRel : public SVGPathSeg
- {
+ class SVGPathSegLinetoHorizontalRel : public SVGPathSeg {
public:
- SVGPathSegLinetoHorizontalRel(double x);
+ SVGPathSegLinetoHorizontalRel(float x);
virtual ~SVGPathSegLinetoHorizontalRel();
virtual unsigned short pathSegType() const { return PATHSEG_LINETO_HORIZONTAL_REL; }
virtual String pathSegTypeAsLetter() const { return "h"; }
virtual String toString() const { return String::format("h %.6lg", m_x); }
- void setX(double);
- double x() const;
+ void setX(float);
+ float x() const;
private:
- double m_x;
+ float m_x;
};
} // namespace WebCore
namespace WebCore {
-SVGPathSegLinetoVerticalAbs::SVGPathSegLinetoVerticalAbs(double y)
+SVGPathSegLinetoVerticalAbs::SVGPathSegLinetoVerticalAbs(float y)
: SVGPathSeg()
, m_y(y)
{
{
}
-void SVGPathSegLinetoVerticalAbs::setY(double y)
+void SVGPathSegLinetoVerticalAbs::setY(float y)
{
m_y = y;
}
-double SVGPathSegLinetoVerticalAbs::y() const
+float SVGPathSegLinetoVerticalAbs::y() const
{
return m_y;
}
-SVGPathSegLinetoVerticalRel::SVGPathSegLinetoVerticalRel(double y)
+SVGPathSegLinetoVerticalRel::SVGPathSegLinetoVerticalRel(float y)
: SVGPathSeg()
, m_y(y)
{
{
}
-void SVGPathSegLinetoVerticalRel::setY(double y)
+void SVGPathSegLinetoVerticalRel::setY(float y)
{
m_y = y;
}
-double SVGPathSegLinetoVerticalRel::y() const
+float SVGPathSegLinetoVerticalRel::y() const
{
return m_y;
}
#include "SVGPathSeg.h"
-namespace WebCore
-{
- class SVGPathSegLinetoVerticalAbs : public SVGPathSeg
- {
+namespace WebCore {
+
+ class SVGPathSegLinetoVerticalAbs : public SVGPathSeg {
public:
- SVGPathSegLinetoVerticalAbs(double y);
+ SVGPathSegLinetoVerticalAbs(float y);
virtual~SVGPathSegLinetoVerticalAbs();
virtual unsigned short pathSegType() const { return PATHSEG_LINETO_VERTICAL_ABS; }
virtual String pathSegTypeAsLetter() const { return "V"; }
virtual String toString() const { return String::format("V %.6lg", m_y); }
- void setY(double);
- double y() const;
+ void setY(float);
+ float y() const;
private:
- double m_y;
+ float m_y;
};
- class SVGPathSegLinetoVerticalRel : public SVGPathSeg
- {
+ class SVGPathSegLinetoVerticalRel : public SVGPathSeg {
public:
- SVGPathSegLinetoVerticalRel(double y);
+ SVGPathSegLinetoVerticalRel(float y);
virtual ~SVGPathSegLinetoVerticalRel();
virtual unsigned short pathSegType() const { return PATHSEG_LINETO_VERTICAL_REL; }
virtual String pathSegTypeAsLetter() const { return "v"; }
virtual String toString() const { return String::format("v %.6lg", m_y); }
- void setY(double);
- double y() const;
+ void setY(float);
+ float y() const;
private:
- double m_y;
+ float m_y;
};
} // namespace WebCore
return m_context;
}
-unsigned SVGPathSegList::getPathSegAtLength(double)
+unsigned SVGPathSegList::getPathSegAtLength(float)
{
// FIXME : to be useful this will need to support non-normalized SVGPathSegLists
ExceptionCode ec = 0;
#include "SVGList.h"
#include "SVGPathSeg.h"
-namespace WebCore
-{
+namespace WebCore {
+
class Path;
class SVGElement;
- class SVGPathSegList : public SVGList<RefPtr<SVGPathSeg> >
- {
+ class SVGPathSegList : public SVGList<RefPtr<SVGPathSeg> > {
public:
SVGPathSegList(const SVGElement* context);
virtual ~SVGPathSegList();
const SVGElement* context() const;
-
- unsigned getPathSegAtLength(double);
+
+ unsigned getPathSegAtLength(float);
Path toPathData();
private:
namespace WebCore {
-SVGPathSegMovetoAbs::SVGPathSegMovetoAbs(double x, double y)
+SVGPathSegMovetoAbs::SVGPathSegMovetoAbs(float x, float y)
: SVGPathSeg()
, m_x(x)
, m_y(y)
{
}
-void SVGPathSegMovetoAbs::setX(double x)
+void SVGPathSegMovetoAbs::setX(float x)
{
m_x = x;
}
-double SVGPathSegMovetoAbs::x() const
+float SVGPathSegMovetoAbs::x() const
{
return m_x;
}
-void SVGPathSegMovetoAbs::setY(double y)
+void SVGPathSegMovetoAbs::setY(float y)
{
m_y = y;
}
-double SVGPathSegMovetoAbs::y() const
+float SVGPathSegMovetoAbs::y() const
{
return m_y;
}
-SVGPathSegMovetoRel::SVGPathSegMovetoRel(double x, double y)
+SVGPathSegMovetoRel::SVGPathSegMovetoRel(float x, float y)
: SVGPathSeg()
, m_x(x)
, m_y(y)
{
}
-void SVGPathSegMovetoRel::setX(double x)
+void SVGPathSegMovetoRel::setX(float x)
{
m_x = x;
}
-double SVGPathSegMovetoRel::x() const
+float SVGPathSegMovetoRel::x() const
{
return m_x;
}
-void SVGPathSegMovetoRel::setY(double y)
+void SVGPathSegMovetoRel::setY(float y)
{
m_y = y;
}
-double SVGPathSegMovetoRel::y() const
+float SVGPathSegMovetoRel::y() const
{
return m_y;
}
#include "SVGPathSeg.h"
-namespace WebCore
-{
- class SVGPathSegMovetoAbs : public SVGPathSeg
- {
+namespace WebCore {
+ class SVGPathSegMovetoAbs : public SVGPathSeg {
public:
- SVGPathSegMovetoAbs(double x, double y);
+ SVGPathSegMovetoAbs(float x, float y);
virtual ~SVGPathSegMovetoAbs();
virtual unsigned short pathSegType() const { return PATHSEG_MOVETO_ABS; }
virtual String pathSegTypeAsLetter() const { return "M"; }
virtual String toString() const { return String::format("M %.6lg %.6lg", m_x, m_y); }
- void setX(double);
- double x() const;
+ void setX(float);
+ float x() const;
- void setY(double);
- double y() const;
+ void setY(float);
+ float y() const;
private:
- double m_x;
- double m_y;
+ float m_x;
+ float m_y;
};
- class SVGPathSegMovetoRel : public SVGPathSeg
- {
+ class SVGPathSegMovetoRel : public SVGPathSeg {
public:
- SVGPathSegMovetoRel(double x, double y);
+ SVGPathSegMovetoRel(float x, float y);
virtual ~SVGPathSegMovetoRel();
virtual unsigned short pathSegType() const { return PATHSEG_MOVETO_REL; }
virtual String pathSegTypeAsLetter() const { return "m"; }
virtual String toString() const { return String::format("m %.6lg %.6lg", m_x, m_y); }
- void setX(double);
- double x() const;
+ void setX(float);
+ float x() const;
- void setY(double);
- double y() const;
+ void setY(float);
+ float y() const;
private:
- double m_x;
- double m_y;
+ float m_x;
+ float m_y;
};
} // namespace WebCore
#include "SVGPolyElement.h"
#include "Document.h"
+#include "FloatPoint.h"
#include "SVGNames.h"
#include "SVGPointList.h"
void SVGPolyElement::svgPolyTo(double x1, double y1, int) const
{
ExceptionCode ec = 0;
- points()->appendItem(FloatPoint(x1, y1), ec);
+ points()->appendItem(FloatPoint::narrowPrecision(x1, y1), ec);
}
void SVGPolyElement::notifyAttributeChange() const
#include "SVGRadialGradientElement.h"
#include "FloatConversion.h"
+#include "FloatPoint.h"
#include "RadialGradientAttributes.h"
#include "SVGLength.h"
#include "SVGNames.h"
radialGradient->setBoundingBoxMode(attributes.boundingBoxMode());
radialGradient->setGradientSpreadMethod(attributes.spreadMethod());
radialGradient->setGradientTransform(attributes.gradientTransform());
- radialGradient->setGradientCenter(FloatPoint(attributes.cx(), attributes.cy()));
- radialGradient->setGradientFocal(FloatPoint(attributes.fx(), attributes.fy()));
+ radialGradient->setGradientCenter(FloatPoint::narrowPrecision(attributes.cx(), attributes.cy()));
+ radialGradient->setGradientFocal(FloatPoint::narrowPrecision(attributes.fx(), attributes.fy()));
radialGradient->setGradientRadius(narrowPrecisionToFloat(attributes.r()));
}
#include "Document.h"
#include "EventListener.h"
#include "EventNames.h"
+#include "FloatConversion.h"
+#include "FloatRect.h"
#include "Frame.h"
#include "HTMLNames.h"
#include "RenderSVGContainer.h"
_x = x().value();
_y = y().value();
}
- double w = width().value();
- double h = height().value();
+ float w = width().value();
+ float h = height().value();
AffineTransform viewBox = viewBoxToViewTransform(w, h);
+ double wDouble = w;
+ double hDouble = h;
viewBox.map(_x, _y, &_x, &_y);
- viewBox.map(w, h, &w, &h);
- return FloatRect(_x, _y, w, h);
+ viewBox.map(w, h, &wDouble, &hDouble);
+ return FloatRect::narrowPrecision(_x, _y, wDouble, hDouble);
}
float SVGSVGElement::pixelUnitToMillimeterX() const
float SVGSVGElement::getCurrentTime() const
{
- return m_timeScheduler->elapsed();
+ return narrowPrecisionToFloat(m_timeScheduler->elapsed());
}
void SVGSVGElement::setCurrentTime(float /* seconds */)
SVGStopElement::SVGStopElement(const QualifiedName& tagName, Document* doc)
: SVGStyledElement(tagName, doc)
- , m_offset(0.0)
+ , m_offset(0.0f)
{
}
{
}
-ANIMATED_PROPERTY_DEFINITIONS(SVGStopElement, double, Number, number, Offset, offset, SVGNames::offsetAttr.localName(), m_offset)
+ANIMATED_PROPERTY_DEFINITIONS(SVGStopElement, float, Number, number, Offset, offset, SVGNames::offsetAttr.localName(), m_offset)
void SVGStopElement::parseMappedAttribute(MappedAttribute* attr)
{
if (attr->name() == SVGNames::offsetAttr) {
const String& value = attr->value();
if (value.endsWith("%"))
- setOffsetBaseValue(value.left(value.length() - 1).toDouble() / 100.);
+ setOffsetBaseValue(value.left(value.length() - 1).toFloat() / 100.0f);
else
- setOffsetBaseValue(value.toDouble());
+ setOffsetBaseValue(value.toFloat());
} else
SVGStyledElement::parseMappedAttribute(attr);
}
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
private:
- ANIMATED_PROPERTY_DECLARATIONS(SVGStopElement, double, double, Offset, offset)
+ ANIMATED_PROPERTY_DECLARATIONS(SVGStopElement, float, float, Offset, offset)
};
} // namespace WebCore
#include "config.h"
#if ENABLE(SVG)
+#include "FloatPoint.h"
+#include "FloatSize.h"
#include "SVGAngle.h"
-#include "SVGTransform.h"
#include "SVGSVGElement.h"
+#include "SVGTransform.h"
#include <math.h>
FloatPoint SVGTransform::translate() const
{
- return FloatPoint(m_matrix.e(), m_matrix.f());
+ return FloatPoint::narrowPrecision(m_matrix.e(), m_matrix.f());
}
void SVGTransform::setScale(float sx, float sy)
FloatSize SVGTransform::scale() const
{
- return FloatSize(m_matrix.a(), m_matrix.d());
+ return FloatSize::narrowPrecision(m_matrix.a(), m_matrix.d());
}
void SVGTransform::setRotate(float angle, float cx, float cy)
#if ENABLE(SVG)
#include "SVGTransformDistance.h"
+#include "FloatConversion.h"
#include "FloatPoint.h"
#include "FloatSize.h"
#include "SVGTransform.h"
case SVGTransform::SVG_TRANSFORM_TRANSLATE:
{
FloatPoint translation = transform.translate();
- translation += FloatSize(m_transform.e(), m_transform.f());
+ translation += FloatSize::narrowPrecision(m_transform.e(), m_transform.f());
newTransform.setTranslate(translation.x(), translation.y());
return newTransform;
}
case SVGTransform::SVG_TRANSFORM_SCALE:
{
FloatSize scale = transform.scale();
- scale += FloatSize(m_transform.a(), m_transform.d());
+ scale += FloatSize::narrowPrecision(m_transform.a(), m_transform.d());
newTransform.setScale(scale.width(), scale.height());
return newTransform;
}
{
// FIXME: I'm not certain the translation is calculated correctly here
FloatPoint center = transform.rotationCenter();
- newTransform.setRotate(transform.angle() + m_angle, center.x() + m_cx, center.y() + m_cy);
+ newTransform.setRotate(narrowPrecisionToFloat(transform.angle() + m_angle),
+ narrowPrecisionToFloat(center.x() + m_cx),
+ narrowPrecisionToFloat(center.y() + m_cy));
return newTransform;
}
case SVGTransform::SVG_TRANSFORM_SKEWX:
- newTransform.setSkewX(transform.angle() + m_angle);
+ newTransform.setSkewX(narrowPrecisionToFloat(transform.angle() + m_angle));
return newTransform;
case SVGTransform::SVG_TRANSFORM_SKEWY:
- newTransform.setSkewY(transform.angle() + m_angle);
+ newTransform.setSkewY(narrowPrecisionToFloat(transform.angle() + m_angle));
return newTransform;
}
case SVGTransform::SVG_TRANSFORM_UNKNOWN:
return 0.0f;
case SVGTransform::SVG_TRANSFORM_ROTATE:
- return sqrtf(m_angle * m_angle + m_cx * m_cx + m_cy * m_cy);
+ return narrowPrecisionToFloat(sqrt(m_angle * m_angle + m_cx * m_cx + m_cy * m_cy));
case SVGTransform::SVG_TRANSFORM_MATRIX:
return 0.0f; // I'm not quite sure yet what distance between two matrices means.
case SVGTransform::SVG_TRANSFORM_SCALE:
- return sqrtf(m_transform.a() * m_transform.a() + m_transform.d() * m_transform.d());
+ return narrowPrecisionToFloat(sqrt(m_transform.a() * m_transform.a() + m_transform.d() * m_transform.d()));
case SVGTransform::SVG_TRANSFORM_TRANSLATE:
- return sqrtf(m_transform.e() * m_transform.e() + m_transform.f() * m_transform.f());
+ return narrowPrecisionToFloat(sqrt(m_transform.e() * m_transform.e() + m_transform.f() * m_transform.f()));
case SVGTransform::SVG_TRANSFORM_SKEWX:
case SVGTransform::SVG_TRANSFORM_SKEWY:
- return m_angle;
+ return narrowPrecisionToFloat(m_angle);
}
ASSERT_NOT_REACHED();
return 0.0f;
#if ENABLE(SVG)
#include "SVGTransformable.h"
-#include "RegularExpression.h"
#include "AffineTransform.h"
+#include "FloatConversion.h"
+#include "RegularExpression.h"
#include "SVGNames.h"
#include "SVGParserUtilities.h"
#include "SVGStyledElement.h"
switch (type) {
case SVGTransform::SVG_TRANSFORM_SKEWX:
- t.setSkewX(x[0]);
+ t.setSkewX(narrowPrecisionToFloat(x[0]));
break;
case SVGTransform::SVG_TRANSFORM_SKEWY:
- t.setSkewY(x[0]);
+ t.setSkewY(narrowPrecisionToFloat(x[0]));
break;
case SVGTransform::SVG_TRANSFORM_SCALE:
if (nr == 1) // Spec: if only one param given, assume uniform scaling
- t.setScale(x[0], x[0]);
+ t.setScale(narrowPrecisionToFloat(x[0]), narrowPrecisionToFloat(x[0]));
else
- t.setScale(x[0], x[1]);
+ t.setScale(narrowPrecisionToFloat(x[0]), narrowPrecisionToFloat(x[1]));
break;
case SVGTransform::SVG_TRANSFORM_TRANSLATE:
if (nr == 1) // Spec: if only one param given, assume 2nd param to be 0
- t.setTranslate(x[0], 0);
+ t.setTranslate(narrowPrecisionToFloat(x[0]), 0);
else
- t.setTranslate(x[0], x[1]);
+ t.setTranslate(narrowPrecisionToFloat(x[0]), narrowPrecisionToFloat(x[1]));
break;
case SVGTransform::SVG_TRANSFORM_ROTATE:
if (nr == 1)
- t.setRotate(x[0], 0, 0);
+ t.setRotate(narrowPrecisionToFloat(x[0]), 0, 0);
else
- t.setRotate(x[0], x[1], x[2]);
+ t.setRotate(narrowPrecisionToFloat(x[0]), narrowPrecisionToFloat(x[1]), narrowPrecisionToFloat(x[2]));
break;
case SVGTransform::SVG_TRANSFORM_MATRIX:
t.setMatrix(AffineTransform(x[0], x[1], x[2], x[3], x[4], x[5]));