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) 2008 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> | 5 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> |
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 } | 106 } |
107 | 107 |
108 static void setGradientAttributes(SVGGradientElement* element, LinearGradientAtt
ributes& attributes, bool isLinear = true) | 108 static void setGradientAttributes(SVGGradientElement* element, LinearGradientAtt
ributes& attributes, bool isLinear = true) |
109 { | 109 { |
110 if (!attributes.hasSpreadMethod() && element->spreadMethod()->isSpecified()) | 110 if (!attributes.hasSpreadMethod() && element->spreadMethod()->isSpecified()) |
111 attributes.setSpreadMethod(element->spreadMethod()->currentValue()->enum
Value()); | 111 attributes.setSpreadMethod(element->spreadMethod()->currentValue()->enum
Value()); |
112 | 112 |
113 if (!attributes.hasGradientUnits() && element->gradientUnits()->isSpecified(
)) | 113 if (!attributes.hasGradientUnits() && element->gradientUnits()->isSpecified(
)) |
114 attributes.setGradientUnits(element->gradientUnits()->currentValue()->en
umValue()); | 114 attributes.setGradientUnits(element->gradientUnits()->currentValue()->en
umValue()); |
115 | 115 |
116 if (!attributes.hasGradientTransform() && element->gradientTransform()->isSp
ecified()) { | 116 if (!attributes.hasGradientTransform()) { |
117 AffineTransform transform; | 117 attributes.setGradientTransformFromStyle(element); |
118 element->gradientTransform()->currentValue()->concatenate(transform); | |
119 attributes.setGradientTransform(transform); | |
120 } | 118 } |
121 | 119 |
122 if (!attributes.hasStops()) { | 120 if (!attributes.hasStops()) { |
123 const Vector<Gradient::ColorStop>& stops(element->buildStops()); | 121 const Vector<Gradient::ColorStop>& stops(element->buildStops()); |
124 if (!stops.isEmpty()) | 122 if (!stops.isEmpty()) |
125 attributes.setStops(stops); | 123 attributes.setStops(stops); |
126 } | 124 } |
127 | 125 |
128 if (isLinear) { | 126 if (isLinear) { |
129 SVGLinearGradientElement* linear = toSVGLinearGradientElement(element); | 127 SVGLinearGradientElement* linear = toSVGLinearGradientElement(element); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 177 |
180 bool SVGLinearGradientElement::selfHasRelativeLengths() const | 178 bool SVGLinearGradientElement::selfHasRelativeLengths() const |
181 { | 179 { |
182 return m_x1->currentValue()->isRelative() | 180 return m_x1->currentValue()->isRelative() |
183 || m_y1->currentValue()->isRelative() | 181 || m_y1->currentValue()->isRelative() |
184 || m_x2->currentValue()->isRelative() | 182 || m_x2->currentValue()->isRelative() |
185 || m_y2->currentValue()->isRelative(); | 183 || m_y2->currentValue()->isRelative(); |
186 } | 184 } |
187 | 185 |
188 } | 186 } |
OLD | NEW |