OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 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) Research In Motion Limited 2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
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 29 matching lines...) Expand all Loading... |
40 } | 40 } |
41 return entries; | 41 return entries; |
42 } | 42 } |
43 | 43 |
44 SVGGradientElement::SVGGradientElement(const QualifiedName& tagName, | 44 SVGGradientElement::SVGGradientElement(const QualifiedName& tagName, |
45 Document& document) | 45 Document& document) |
46 : SVGElement(tagName, document), | 46 : SVGElement(tagName, document), |
47 SVGURIReference(this), | 47 SVGURIReference(this), |
48 m_gradientTransform( | 48 m_gradientTransform( |
49 SVGAnimatedTransformList::create(this, | 49 SVGAnimatedTransformList::create(this, |
50 SVGNames::gradientTransformAttr, | 50 SVGNames::gradientTransformAttr)), |
51 SVGTransformList::create())), | |
52 m_spreadMethod(SVGAnimatedEnumeration<SVGSpreadMethodType>::create( | 51 m_spreadMethod(SVGAnimatedEnumeration<SVGSpreadMethodType>::create( |
53 this, | 52 this, |
54 SVGNames::spreadMethodAttr, | 53 SVGNames::spreadMethodAttr, |
55 SVGSpreadMethodPad)), | 54 SVGSpreadMethodPad)), |
56 m_gradientUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::create( | 55 m_gradientUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::create( |
57 this, | 56 this, |
58 SVGNames::gradientUnitsAttr, | 57 SVGNames::gradientUnitsAttr, |
59 SVGUnitTypes::kSvgUnitTypeObjectboundingbox)) { | 58 SVGUnitTypes::kSvgUnitTypeObjectboundingbox)) { |
60 addToPropertyMap(m_gradientTransform); | 59 addToPropertyMap(m_gradientTransform); |
61 addToPropertyMap(m_spreadMethod); | 60 addToPropertyMap(m_spreadMethod); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 float offset = stop.offset()->currentValue()->value(); | 108 float offset = stop.offset()->currentValue()->value(); |
110 offset = std::min(std::max(previousOffset, offset), 1.0f); | 109 offset = std::min(std::max(previousOffset, offset), 1.0f); |
111 previousOffset = offset; | 110 previousOffset = offset; |
112 | 111 |
113 stops.append(Gradient::ColorStop(offset, stop.stopColorIncludingOpacity())); | 112 stops.append(Gradient::ColorStop(offset, stop.stopColorIncludingOpacity())); |
114 } | 113 } |
115 return stops; | 114 return stops; |
116 } | 115 } |
117 | 116 |
118 } // namespace blink | 117 } // namespace blink |
OLD | NEW |