Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: Source/core/svg/SVGGradientElement.cpp

Issue 1025213002: Begin tracking why layout is invalidated (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 } 91 }
92 92
93 void SVGGradientElement::childrenChanged(const ChildrenChange& change) 93 void SVGGradientElement::childrenChanged(const ChildrenChange& change)
94 { 94 {
95 SVGElement::childrenChanged(change); 95 SVGElement::childrenChanged(change);
96 96
97 if (change.byParser) 97 if (change.byParser)
98 return; 98 return;
99 99
100 if (LayoutObject* object = layoutObject()) 100 if (LayoutObject* object = layoutObject())
101 object->setNeedsLayoutAndFullPaintInvalidation(); 101 object->setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationReason: :ChildChanged);
102 } 102 }
103 103
104 Vector<Gradient::ColorStop> SVGGradientElement::buildStops() 104 Vector<Gradient::ColorStop> SVGGradientElement::buildStops()
105 { 105 {
106 Vector<Gradient::ColorStop> stops; 106 Vector<Gradient::ColorStop> stops;
107 107
108 float previousOffset = 0.0f; 108 float previousOffset = 0.0f;
109 for (SVGStopElement* stop = Traversal<SVGStopElement>::firstChild(*this); st op; stop = Traversal<SVGStopElement>::nextSibling(*stop)) { 109 for (SVGStopElement* stop = Traversal<SVGStopElement>::firstChild(*this); st op; stop = Traversal<SVGStopElement>::nextSibling(*stop)) {
110 // Figure out right monotonic offset 110 // Figure out right monotonic offset
111 float offset = stop->offset()->currentValue()->value(); 111 float offset = stop->offset()->currentValue()->value();
112 offset = std::min(std::max(previousOffset, offset), 1.0f); 112 offset = std::min(std::max(previousOffset, offset), 1.0f);
113 previousOffset = offset; 113 previousOffset = offset;
114 114
115 stops.append(Gradient::ColorStop(offset, stop->stopColorIncludingOpacity ())); 115 stops.append(Gradient::ColorStop(offset, stop->stopColorIncludingOpacity ()));
116 } 116 }
117 117
118 return stops; 118 return stops;
119 } 119 }
120 120
121 } 121 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698