| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 } | 107 } |
| 108 | 108 |
| 109 void SVGGradientElement::childrenChanged(bool changedByParser, Node* beforeChang
e, Node* afterChange, int childCountDelta) | 109 void SVGGradientElement::childrenChanged(bool changedByParser, Node* beforeChang
e, Node* afterChange, int childCountDelta) |
| 110 { | 110 { |
| 111 SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, chil
dCountDelta); | 111 SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, chil
dCountDelta); |
| 112 | 112 |
| 113 if (changedByParser) | 113 if (changedByParser) |
| 114 return; | 114 return; |
| 115 | 115 |
| 116 if (RenderObject* object = renderer()) | 116 if (RenderObject* object = renderer()) |
| 117 object->setNeedsLayoutAndFullRepaint(); | 117 object->setNeedsLayoutAndFullPaintInvalidation(); |
| 118 } | 118 } |
| 119 | 119 |
| 120 Vector<Gradient::ColorStop> SVGGradientElement::buildStops() | 120 Vector<Gradient::ColorStop> SVGGradientElement::buildStops() |
| 121 { | 121 { |
| 122 Vector<Gradient::ColorStop> stops; | 122 Vector<Gradient::ColorStop> stops; |
| 123 | 123 |
| 124 float previousOffset = 0.0f; | 124 float previousOffset = 0.0f; |
| 125 for (SVGStopElement* stop = Traversal<SVGStopElement>::firstChild(*this); st
op; stop = Traversal<SVGStopElement>::nextSibling(*stop)) { | 125 for (SVGStopElement* stop = Traversal<SVGStopElement>::firstChild(*this); st
op; stop = Traversal<SVGStopElement>::nextSibling(*stop)) { |
| 126 // Figure out right monotonic offset | 126 // Figure out right monotonic offset |
| 127 float offset = stop->offset()->currentValue()->value(); | 127 float offset = stop->offset()->currentValue()->value(); |
| 128 offset = std::min(std::max(previousOffset, offset), 1.0f); | 128 offset = std::min(std::max(previousOffset, offset), 1.0f); |
| 129 previousOffset = offset; | 129 previousOffset = offset; |
| 130 | 130 |
| 131 stops.append(Gradient::ColorStop(offset, stop->stopColorIncludingOpacity
())); | 131 stops.append(Gradient::ColorStop(offset, stop->stopColorIncludingOpacity
())); |
| 132 } | 132 } |
| 133 | 133 |
| 134 return stops; | 134 return stops; |
| 135 } | 135 } |
| 136 | 136 |
| 137 } | 137 } |
| OLD | NEW |