| 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, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2010 Dirk Schulze <krit@webkit.org> | 4 * Copyright (C) 2010 Dirk Schulze <krit@webkit.org> |
| 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 26 matching lines...) Expand all Loading... |
| 37 { | 37 { |
| 38 setDefault(); | 38 setDefault(); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void SVGPreserveAspectRatio::setDefault() | 41 void SVGPreserveAspectRatio::setDefault() |
| 42 { | 42 { |
| 43 m_align = SVG_PRESERVEASPECTRATIO_XMIDYMID; | 43 m_align = SVG_PRESERVEASPECTRATIO_XMIDYMID; |
| 44 m_meetOrSlice = SVG_MEETORSLICE_MEET; | 44 m_meetOrSlice = SVG_MEETORSLICE_MEET; |
| 45 } | 45 } |
| 46 | 46 |
| 47 PassRefPtr<SVGPreserveAspectRatio> SVGPreserveAspectRatio::clone() const | 47 PassRefPtrWillBeRawPtr<SVGPreserveAspectRatio> SVGPreserveAspectRatio::clone() c
onst |
| 48 { | 48 { |
| 49 RefPtr<SVGPreserveAspectRatio> preserveAspectRatio = create(); | 49 RefPtrWillBeRawPtr<SVGPreserveAspectRatio> preserveAspectRatio = create(); |
| 50 | 50 |
| 51 preserveAspectRatio->m_align = m_align; | 51 preserveAspectRatio->m_align = m_align; |
| 52 preserveAspectRatio->m_meetOrSlice = m_meetOrSlice; | 52 preserveAspectRatio->m_meetOrSlice = m_meetOrSlice; |
| 53 | 53 |
| 54 return preserveAspectRatio.release(); | 54 return preserveAspectRatio.release(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 template<typename CharType> | 57 template<typename CharType> |
| 58 bool SVGPreserveAspectRatio::parseInternal(const CharType*& ptr, const CharType*
end, bool validate) | 58 bool SVGPreserveAspectRatio::parseInternal(const CharType*& ptr, const CharType*
end, bool validate) |
| 59 { | 59 { |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 case SVG_MEETORSLICE_SLICE: | 390 case SVG_MEETORSLICE_SLICE: |
| 391 return alignType + " slice"; | 391 return alignType + " slice"; |
| 392 } | 392 } |
| 393 } | 393 } |
| 394 | 394 |
| 395 void SVGPreserveAspectRatio::add(PassRefPtrWillBeRawPtr<SVGPropertyBase> other,
SVGElement*) | 395 void SVGPreserveAspectRatio::add(PassRefPtrWillBeRawPtr<SVGPropertyBase> other,
SVGElement*) |
| 396 { | 396 { |
| 397 ASSERT_NOT_REACHED(); | 397 ASSERT_NOT_REACHED(); |
| 398 } | 398 } |
| 399 | 399 |
| 400 void SVGPreserveAspectRatio::calculateAnimatedValue(SVGAnimationElement* animati
onElement, float percentage, unsigned repeatCount, PassRefPtr<SVGPropertyBase> f
romValue, PassRefPtr<SVGPropertyBase> toValue, PassRefPtr<SVGPropertyBase>, SVGE
lement*) | 400 void SVGPreserveAspectRatio::calculateAnimatedValue(SVGAnimationElement* animati
onElement, float percentage, unsigned repeatCount, PassRefPtrWillBeRawPtr<SVGPro
pertyBase> fromValue, PassRefPtrWillBeRawPtr<SVGPropertyBase> toValue, PassRefPt
rWillBeRawPtr<SVGPropertyBase>, SVGElement*) |
| 401 { | 401 { |
| 402 ASSERT(animationElement); | 402 ASSERT(animationElement); |
| 403 | 403 |
| 404 bool useToValue; | 404 bool useToValue; |
| 405 animationElement->animateDiscreteType(percentage, false, true, useToValue); | 405 animationElement->animateDiscreteType(percentage, false, true, useToValue); |
| 406 | 406 |
| 407 RefPtr<SVGPreserveAspectRatio> preserveAspectRatioToUse = useToValue ? toSVG
PreserveAspectRatio(toValue) : toSVGPreserveAspectRatio(fromValue); | 407 RefPtrWillBeRawPtr<SVGPreserveAspectRatio> preserveAspectRatioToUse = useToV
alue ? toSVGPreserveAspectRatio(toValue) : toSVGPreserveAspectRatio(fromValue); |
| 408 | 408 |
| 409 m_align = preserveAspectRatioToUse->m_align; | 409 m_align = preserveAspectRatioToUse->m_align; |
| 410 m_meetOrSlice = preserveAspectRatioToUse->m_meetOrSlice; | 410 m_meetOrSlice = preserveAspectRatioToUse->m_meetOrSlice; |
| 411 } | 411 } |
| 412 | 412 |
| 413 float SVGPreserveAspectRatio::calculateDistance(PassRefPtr<SVGPropertyBase> toVa
lue, SVGElement* contextElement) | 413 float SVGPreserveAspectRatio::calculateDistance(PassRefPtrWillBeRawPtr<SVGProper
tyBase> toValue, SVGElement* contextElement) |
| 414 { | 414 { |
| 415 // No paced animations for SVGPreserveAspectRatio. | 415 // No paced animations for SVGPreserveAspectRatio. |
| 416 return -1; | 416 return -1; |
| 417 } | 417 } |
| 418 | 418 |
| 419 } | 419 } |
| OLD | NEW |