| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 m_spreadMethod = value; | 45 m_spreadMethod = value; |
| 46 m_spreadMethodSet = true; | 46 m_spreadMethodSet = true; |
| 47 } | 47 } |
| 48 | 48 |
| 49 void setGradientUnits(SVGUnitTypes::SVGUnitType unitType) | 49 void setGradientUnits(SVGUnitTypes::SVGUnitType unitType) |
| 50 { | 50 { |
| 51 m_gradientUnits = unitType; | 51 m_gradientUnits = unitType; |
| 52 m_gradientUnitsSet = true; | 52 m_gradientUnitsSet = true; |
| 53 } | 53 } |
| 54 | 54 |
| 55 void setGradientTransformFromStyle(SVGGradientElement* element) | |
| 56 { | |
| 57 AffineTransform transform; | |
| 58 bool hasTransform = element->getStyleTransform(transform); | |
| 59 | |
| 60 // If CSS property was set, use that, otherwise fallback to attribute (i
f set). | |
| 61 if (!hasTransform && element->gradientTransform()->isSpecified()) { | |
| 62 element->gradientTransform()->currentValue()->concatenate(transform)
; | |
| 63 hasTransform = true; | |
| 64 } | |
| 65 | |
| 66 if (hasTransform) | |
| 67 setGradientTransform(transform); | |
| 68 } | |
| 69 | |
| 70 void setGradientTransform(const AffineTransform& value) | 55 void setGradientTransform(const AffineTransform& value) |
| 71 { | 56 { |
| 72 m_gradientTransform = value; | 57 m_gradientTransform = value; |
| 73 m_gradientTransformSet = true; | 58 m_gradientTransformSet = true; |
| 74 } | 59 } |
| 75 | 60 |
| 76 void setStops(const Vector<Gradient::ColorStop>& value) | 61 void setStops(const Vector<Gradient::ColorStop>& value) |
| 77 { | 62 { |
| 78 m_stops = value; | 63 m_stops = value; |
| 79 m_stopsSet = true; | 64 m_stopsSet = true; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 103 AffineTransform a; | 88 AffineTransform a; |
| 104 Vector<Gradient::ColorStop> b; | 89 Vector<Gradient::ColorStop> b; |
| 105 unsigned c : 8; | 90 unsigned c : 8; |
| 106 }; | 91 }; |
| 107 | 92 |
| 108 COMPILE_ASSERT(sizeof(GradientAttributes) == sizeof(SameSizeAsGradientAttributes
), GradientAttributes_size_guard); | 93 COMPILE_ASSERT(sizeof(GradientAttributes) == sizeof(SameSizeAsGradientAttributes
), GradientAttributes_size_guard); |
| 109 | 94 |
| 110 } // namespace blink | 95 } // namespace blink |
| 111 | 96 |
| 112 #endif | 97 #endif |
| OLD | NEW |