| 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 27 matching lines...) Expand all Loading... |
| 38 entries.append(std::make_pair(SVGSpreadMethodRepeat, "repeat")); | 38 entries.append(std::make_pair(SVGSpreadMethodRepeat, "repeat")); |
| 39 } | 39 } |
| 40 return entries; | 40 return entries; |
| 41 } | 41 } |
| 42 | 42 |
| 43 SVGGradientElement::SVGGradientElement(const QualifiedName& tagName, Document& d
ocument) | 43 SVGGradientElement::SVGGradientElement(const QualifiedName& tagName, Document& d
ocument) |
| 44 : SVGElement(tagName, document) | 44 : SVGElement(tagName, document) |
| 45 , SVGURIReference(this) | 45 , SVGURIReference(this) |
| 46 , m_gradientTransform(SVGAnimatedTransformList::create(this, SVGNames::gradi
entTransformAttr, SVGTransformList::create())) | 46 , m_gradientTransform(SVGAnimatedTransformList::create(this, SVGNames::gradi
entTransformAttr, SVGTransformList::create())) |
| 47 , m_spreadMethod(SVGAnimatedEnumeration<SVGSpreadMethodType>::create(this, S
VGNames::spreadMethodAttr, SVGSpreadMethodPad)) | 47 , m_spreadMethod(SVGAnimatedEnumeration<SVGSpreadMethodType>::create(this, S
VGNames::spreadMethodAttr, SVGSpreadMethodPad)) |
| 48 , m_gradientUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::create(
this, SVGNames::gradientUnitsAttr, SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
)) | 48 , m_gradientUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::create(
this, SVGNames::gradientUnitsAttr, SVGUnitTypes::kSvgUnitTypeObjectboundingbox)) |
| 49 { | 49 { |
| 50 addToPropertyMap(m_gradientTransform); | 50 addToPropertyMap(m_gradientTransform); |
| 51 addToPropertyMap(m_spreadMethod); | 51 addToPropertyMap(m_spreadMethod); |
| 52 addToPropertyMap(m_gradientUnits); | 52 addToPropertyMap(m_gradientUnits); |
| 53 } | 53 } |
| 54 | 54 |
| 55 DEFINE_TRACE(SVGGradientElement) | 55 DEFINE_TRACE(SVGGradientElement) |
| 56 { | 56 { |
| 57 visitor->trace(m_gradientTransform); | 57 visitor->trace(m_gradientTransform); |
| 58 visitor->trace(m_spreadMethod); | 58 visitor->trace(m_spreadMethod); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 float offset = stop.offset()->currentValue()->value(); | 101 float offset = stop.offset()->currentValue()->value(); |
| 102 offset = std::min(std::max(previousOffset, offset), 1.0f); | 102 offset = std::min(std::max(previousOffset, offset), 1.0f); |
| 103 previousOffset = offset; | 103 previousOffset = offset; |
| 104 | 104 |
| 105 stops.append(Gradient::ColorStop(offset, stop.stopColorIncludingOpacity(
))); | 105 stops.append(Gradient::ColorStop(offset, stop.stopColorIncludingOpacity(
))); |
| 106 } | 106 } |
| 107 return stops; | 107 return stops; |
| 108 } | 108 } |
| 109 | 109 |
| 110 } // namespace blink | 110 } // namespace blink |
| OLD | NEW |