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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 , SVGURIReference(this) | 50 , SVGURIReference(this) |
51 , m_gradientTransform(SVGAnimatedTransformList::create(this, SVGNames::gradi
entTransformAttr, SVGTransformList::create())) | 51 , m_gradientTransform(SVGAnimatedTransformList::create(this, SVGNames::gradi
entTransformAttr, SVGTransformList::create())) |
52 , m_spreadMethod(SVGAnimatedEnumeration<SVGSpreadMethodType>::create(this, S
VGNames::spreadMethodAttr, SVGSpreadMethodPad)) | 52 , m_spreadMethod(SVGAnimatedEnumeration<SVGSpreadMethodType>::create(this, S
VGNames::spreadMethodAttr, SVGSpreadMethodPad)) |
53 , m_gradientUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::create(
this, SVGNames::gradientUnitsAttr, SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
)) | 53 , m_gradientUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::create(
this, SVGNames::gradientUnitsAttr, SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
)) |
54 { | 54 { |
55 addToPropertyMap(m_gradientTransform); | 55 addToPropertyMap(m_gradientTransform); |
56 addToPropertyMap(m_spreadMethod); | 56 addToPropertyMap(m_spreadMethod); |
57 addToPropertyMap(m_gradientUnits); | 57 addToPropertyMap(m_gradientUnits); |
58 } | 58 } |
59 | 59 |
| 60 void SVGGradientElement::trace(Visitor* visitor) |
| 61 { |
| 62 visitor->trace(m_gradientTransform); |
| 63 visitor->trace(m_spreadMethod); |
| 64 visitor->trace(m_gradientUnits); |
| 65 SVGElement::trace(visitor); |
| 66 SVGURIReference::trace(visitor); |
| 67 } |
| 68 |
60 bool SVGGradientElement::isSupportedAttribute(const QualifiedName& attrName) | 69 bool SVGGradientElement::isSupportedAttribute(const QualifiedName& attrName) |
61 { | 70 { |
62 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 71 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
63 if (supportedAttributes.isEmpty()) { | 72 if (supportedAttributes.isEmpty()) { |
64 SVGURIReference::addSupportedAttributes(supportedAttributes); | 73 SVGURIReference::addSupportedAttributes(supportedAttributes); |
65 supportedAttributes.add(SVGNames::gradientUnitsAttr); | 74 supportedAttributes.add(SVGNames::gradientUnitsAttr); |
66 supportedAttributes.add(SVGNames::gradientTransformAttr); | 75 supportedAttributes.add(SVGNames::gradientTransformAttr); |
67 supportedAttributes.add(SVGNames::spreadMethodAttr); | 76 supportedAttributes.add(SVGNames::spreadMethodAttr); |
68 } | 77 } |
69 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 78 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 offset = std::min(std::max(previousOffset, offset), 1.0f); | 119 offset = std::min(std::max(previousOffset, offset), 1.0f); |
111 previousOffset = offset; | 120 previousOffset = offset; |
112 | 121 |
113 stops.append(Gradient::ColorStop(offset, stop->stopColorIncludingOpacity
())); | 122 stops.append(Gradient::ColorStop(offset, stop->stopColorIncludingOpacity
())); |
114 } | 123 } |
115 | 124 |
116 return stops; | 125 return stops; |
117 } | 126 } |
118 | 127 |
119 } | 128 } |
OLD | NEW |