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

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: Rebase Created 5 years, 8 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
« no previous file with comments | « Source/core/svg/SVGFilterElement.cpp ('k') | Source/core/svg/SVGMarkerElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 90 }
91 91
92 void SVGGradientElement::childrenChanged(const ChildrenChange& change) 92 void SVGGradientElement::childrenChanged(const ChildrenChange& change)
93 { 93 {
94 SVGElement::childrenChanged(change); 94 SVGElement::childrenChanged(change);
95 95
96 if (change.byParser) 96 if (change.byParser)
97 return; 97 return;
98 98
99 if (LayoutObject* object = layoutObject()) 99 if (LayoutObject* object = layoutObject())
100 object->setNeedsLayoutAndFullPaintInvalidation(); 100 object->setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationReason: :ChildChanged);
101 } 101 }
102 102
103 Vector<Gradient::ColorStop> SVGGradientElement::buildStops() 103 Vector<Gradient::ColorStop> SVGGradientElement::buildStops()
104 { 104 {
105 Vector<Gradient::ColorStop> stops; 105 Vector<Gradient::ColorStop> stops;
106 106
107 float previousOffset = 0.0f; 107 float previousOffset = 0.0f;
108 for (SVGStopElement* stop = Traversal<SVGStopElement>::firstChild(*this); st op; stop = Traversal<SVGStopElement>::nextSibling(*stop)) { 108 for (SVGStopElement* stop = Traversal<SVGStopElement>::firstChild(*this); st op; stop = Traversal<SVGStopElement>::nextSibling(*stop)) {
109 // Figure out right monotonic offset 109 // Figure out right monotonic offset
110 float offset = stop->offset()->currentValue()->value(); 110 float offset = stop->offset()->currentValue()->value();
111 offset = std::min(std::max(previousOffset, offset), 1.0f); 111 offset = std::min(std::max(previousOffset, offset), 1.0f);
112 previousOffset = offset; 112 previousOffset = offset;
113 113
114 stops.append(Gradient::ColorStop(offset, stop->stopColorIncludingOpacity ())); 114 stops.append(Gradient::ColorStop(offset, stop->stopColorIncludingOpacity ()));
115 } 115 }
116 116
117 return stops; 117 return stops;
118 } 118 }
119 119
120 } 120 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGFilterElement.cpp ('k') | Source/core/svg/SVGMarkerElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698