| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "core/svg/SVGTransform.h" | 22 #include "core/svg/SVGTransform.h" |
| 23 | 23 |
| 24 #include "platform/FloatConversion.h" | 24 #include "platform/FloatConversion.h" |
| 25 #include "platform/geometry/FloatSize.h" | 25 #include "platform/geometry/FloatSize.h" |
| 26 #include "wtf/MathExtras.h" | 26 #include "wtf/MathExtras.h" |
| 27 #include "wtf/text/StringBuilder.h" | 27 #include "wtf/text/StringBuilder.h" |
| 28 | 28 |
| 29 namespace WebCore { | 29 namespace WebCore { |
| 30 | 30 |
| 31 SVGTransform::SVGTransform() | 31 SVGTransform::SVGTransform() |
| 32 : NewSVGPropertyBase(classType()) | 32 : SVGPropertyBase(classType()) |
| 33 , m_transformType(SVG_TRANSFORM_UNKNOWN) | 33 , m_transformType(SVG_TRANSFORM_UNKNOWN) |
| 34 , m_angle(0) | 34 , m_angle(0) |
| 35 { | 35 { |
| 36 } | 36 } |
| 37 | 37 |
| 38 SVGTransform::SVGTransform(SVGTransformType transformType, ConstructionMode mode
) | 38 SVGTransform::SVGTransform(SVGTransformType transformType, ConstructionMode mode
) |
| 39 : NewSVGPropertyBase(classType()) | 39 : SVGPropertyBase(classType()) |
| 40 , m_transformType(transformType) | 40 , m_transformType(transformType) |
| 41 , m_angle(0) | 41 , m_angle(0) |
| 42 { | 42 { |
| 43 if (mode == ConstructZeroTransform) | 43 if (mode == ConstructZeroTransform) |
| 44 m_matrix = AffineTransform(0, 0, 0, 0, 0, 0); | 44 m_matrix = AffineTransform(0, 0, 0, 0, 0, 0); |
| 45 } | 45 } |
| 46 | 46 |
| 47 SVGTransform::SVGTransform(const AffineTransform& matrix) | 47 SVGTransform::SVGTransform(const AffineTransform& matrix) |
| 48 : NewSVGPropertyBase(classType()) | 48 : SVGPropertyBase(classType()) |
| 49 , m_transformType(SVG_TRANSFORM_MATRIX) | 49 , m_transformType(SVG_TRANSFORM_MATRIX) |
| 50 , m_angle(0) | 50 , m_angle(0) |
| 51 , m_matrix(matrix) | 51 , m_matrix(matrix) |
| 52 { | 52 { |
| 53 } | 53 } |
| 54 | 54 |
| 55 SVGTransform::SVGTransform(SVGTransformType transformType, float angle, const Fl
oatPoint& center, const AffineTransform& matrix) | 55 SVGTransform::SVGTransform(SVGTransformType transformType, float angle, const Fl
oatPoint& center, const AffineTransform& matrix) |
| 56 : NewSVGPropertyBase(classType()) | 56 : SVGPropertyBase(classType()) |
| 57 , m_transformType(transformType) | 57 , m_transformType(transformType) |
| 58 , m_angle(angle) | 58 , m_angle(angle) |
| 59 , m_center(center) | 59 , m_center(center) |
| 60 , m_matrix(matrix) | 60 , m_matrix(matrix) |
| 61 { | 61 { |
| 62 } | 62 } |
| 63 | 63 |
| 64 SVGTransform::~SVGTransform() | 64 SVGTransform::~SVGTransform() |
| 65 { | 65 { |
| 66 } | 66 } |
| 67 | 67 |
| 68 PassRefPtr<SVGTransform> SVGTransform::clone() const | 68 PassRefPtr<SVGTransform> SVGTransform::clone() const |
| 69 { | 69 { |
| 70 return adoptRef(new SVGTransform(m_transformType, m_angle, m_center, m_matri
x)); | 70 return adoptRef(new SVGTransform(m_transformType, m_angle, m_center, m_matri
x)); |
| 71 } | 71 } |
| 72 | 72 |
| 73 PassRefPtr<NewSVGPropertyBase> SVGTransform::cloneForAnimation(const String&) co
nst | 73 PassRefPtr<SVGPropertyBase> SVGTransform::cloneForAnimation(const String&) const |
| 74 { | 74 { |
| 75 // SVGTransform is never animated. | 75 // SVGTransform is never animated. |
| 76 ASSERT_NOT_REACHED(); | 76 ASSERT_NOT_REACHED(); |
| 77 return nullptr; | 77 return nullptr; |
| 78 } | 78 } |
| 79 | 79 |
| 80 void SVGTransform::setMatrix(const AffineTransform& matrix) | 80 void SVGTransform::setMatrix(const AffineTransform& matrix) |
| 81 { | 81 { |
| 82 onMatrixChange(); | 82 onMatrixChange(); |
| 83 m_matrix = matrix; | 83 m_matrix = matrix; |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 case SVG_TRANSFORM_SKEWX: | 217 case SVG_TRANSFORM_SKEWX: |
| 218 return prefix + String::number(m_angle) + ')'; | 218 return prefix + String::number(m_angle) + ')'; |
| 219 case SVG_TRANSFORM_SKEWY: | 219 case SVG_TRANSFORM_SKEWY: |
| 220 return prefix + String::number(m_angle) + ')'; | 220 return prefix + String::number(m_angle) + ')'; |
| 221 } | 221 } |
| 222 | 222 |
| 223 ASSERT_NOT_REACHED(); | 223 ASSERT_NOT_REACHED(); |
| 224 return emptyString(); | 224 return emptyString(); |
| 225 } | 225 } |
| 226 | 226 |
| 227 void SVGTransform::add(PassRefPtr<NewSVGPropertyBase>, SVGElement*) | 227 void SVGTransform::add(PassRefPtr<SVGPropertyBase>, SVGElement*) |
| 228 { | 228 { |
| 229 // SVGTransform is not animated by itself. | 229 // SVGTransform is not animated by itself. |
| 230 ASSERT_NOT_REACHED(); | 230 ASSERT_NOT_REACHED(); |
| 231 } | 231 } |
| 232 | 232 |
| 233 void SVGTransform::calculateAnimatedValue(SVGAnimationElement*, float, unsigned,
PassRefPtr<NewSVGPropertyBase>, PassRefPtr<NewSVGPropertyBase>, PassRefPtr<NewS
VGPropertyBase>, SVGElement*) | 233 void SVGTransform::calculateAnimatedValue(SVGAnimationElement*, float, unsigned,
PassRefPtr<SVGPropertyBase>, PassRefPtr<SVGPropertyBase>, PassRefPtr<SVGPropert
yBase>, SVGElement*) |
| 234 { | 234 { |
| 235 // SVGTransform is not animated by itself. | 235 // SVGTransform is not animated by itself. |
| 236 ASSERT_NOT_REACHED(); | 236 ASSERT_NOT_REACHED(); |
| 237 } | 237 } |
| 238 | 238 |
| 239 float SVGTransform::calculateDistance(PassRefPtr<NewSVGPropertyBase>, SVGElement
*) | 239 float SVGTransform::calculateDistance(PassRefPtr<SVGPropertyBase>, SVGElement*) |
| 240 { | 240 { |
| 241 // SVGTransform is not animated by itself. | 241 // SVGTransform is not animated by itself. |
| 242 ASSERT_NOT_REACHED(); | 242 ASSERT_NOT_REACHED(); |
| 243 | 243 |
| 244 return -1; | 244 return -1; |
| 245 } | 245 } |
| 246 | 246 |
| 247 } // namespace WebCore | 247 } // namespace WebCore |
| OLD | NEW |