| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2014 Google, Inc. | 4 * Copyright (C) 2014 Google, Inc. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 return SVGMatrixTearOff::create(getCTM()); | 125 return SVGMatrixTearOff::create(getCTM()); |
| 126 } | 126 } |
| 127 | 127 |
| 128 PassRefPtrWillBeRawPtr<SVGMatrixTearOff> SVGGraphicsElement::getScreenCTMFromJav
ascript() | 128 PassRefPtrWillBeRawPtr<SVGMatrixTearOff> SVGGraphicsElement::getScreenCTMFromJav
ascript() |
| 129 { | 129 { |
| 130 return SVGMatrixTearOff::create(getScreenCTM()); | 130 return SVGMatrixTearOff::create(getScreenCTM()); |
| 131 } | 131 } |
| 132 | 132 |
| 133 bool SVGGraphicsElement::hasAnimatedLocalTransform() const | 133 bool SVGGraphicsElement::hasAnimatedLocalTransform() const |
| 134 { | 134 { |
| 135 RenderStyle* style = renderer() ? renderer()->style() : 0; | 135 const RenderStyle* style = renderer() ? renderer()->style() : 0; |
| 136 | 136 |
| 137 // Each of these is used in SVGGraphicsElement::calculateAnimatedLocalTransf
orm to create an animated local transform. | 137 // Each of these is used in SVGGraphicsElement::calculateAnimatedLocalTransf
orm to create an animated local transform. |
| 138 return (style && style->hasTransform()) || !m_transform->currentValue()->isE
mpty() || hasSVGRareData(); | 138 return (style && style->hasTransform()) || !m_transform->currentValue()->isE
mpty() || hasSVGRareData(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 AffineTransform SVGGraphicsElement::calculateAnimatedLocalTransform() const | 141 AffineTransform SVGGraphicsElement::calculateAnimatedLocalTransform() const |
| 142 { | 142 { |
| 143 AffineTransform matrix; | 143 AffineTransform matrix; |
| 144 RenderStyle* style = renderer() ? renderer()->style() : 0; | 144 const RenderStyle* style = renderer() ? renderer()->style() : 0; |
| 145 | 145 |
| 146 // If CSS property was set, use that, otherwise fallback to attribute (if se
t). | 146 // If CSS property was set, use that, otherwise fallback to attribute (if se
t). |
| 147 if (style && style->hasTransform()) { | 147 if (style && style->hasTransform()) { |
| 148 TransformationMatrix transform; | 148 TransformationMatrix transform; |
| 149 float zoom = style->effectiveZoom(); | 149 float zoom = style->effectiveZoom(); |
| 150 | 150 |
| 151 // SVGTextElements need special handling for the text positioning code. | 151 // SVGTextElements need special handling for the text positioning code. |
| 152 if (isSVGTextElement(this)) { | 152 if (isSVGTextElement(this)) { |
| 153 // Do not take into account SVG's zoom rules, transform-origin, or p
ercentage values. | 153 // Do not take into account SVG's zoom rules, transform-origin, or p
ercentage values. |
| 154 style->applyTransform(transform, LayoutSize(0, 0), RenderStyle::Excl
udeTransformOrigin); | 154 style->applyTransform(transform, LayoutSize(0, 0), RenderStyle::Excl
udeTransformOrigin); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 return FloatRect(); | 260 return FloatRect(); |
| 261 | 261 |
| 262 return renderer()->objectBoundingBox(); | 262 return renderer()->objectBoundingBox(); |
| 263 } | 263 } |
| 264 | 264 |
| 265 PassRefPtrWillBeRawPtr<SVGRectTearOff> SVGGraphicsElement::getBBoxFromJavascript
() | 265 PassRefPtrWillBeRawPtr<SVGRectTearOff> SVGGraphicsElement::getBBoxFromJavascript
() |
| 266 { | 266 { |
| 267 return SVGRectTearOff::create(SVGRect::create(getBBox()), 0, PropertyIsNotAn
imVal); | 267 return SVGRectTearOff::create(SVGRect::create(getBBox()), 0, PropertyIsNotAn
imVal); |
| 268 } | 268 } |
| 269 | 269 |
| 270 RenderObject* SVGGraphicsElement::createRenderer(RenderStyle*) | 270 RenderObject* SVGGraphicsElement::createRenderer(const RenderStyle*) |
| 271 { | 271 { |
| 272 // By default, any subclass is expected to do path-based drawing | 272 // By default, any subclass is expected to do path-based drawing |
| 273 return new RenderSVGPath(this); | 273 return new RenderSVGPath(this); |
| 274 } | 274 } |
| 275 | 275 |
| 276 void SVGGraphicsElement::toClipPath(Path& path) | 276 void SVGGraphicsElement::toClipPath(Path& path) |
| 277 { | 277 { |
| 278 updatePathFromGraphicsElement(this, path); | 278 updatePathFromGraphicsElement(this, path); |
| 279 path.transform(calculateAnimatedLocalTransform()); | 279 path.transform(calculateAnimatedLocalTransform()); |
| 280 } | 280 } |
| 281 | 281 |
| 282 } | 282 } |
| OLD | NEW |