Changeset 174222 in webkit for trunk/Source/WebCore/css/CSSGradientValue.cpp
- Timestamp:
- Oct 2, 2014, 11:35:30 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/css/CSSGradientValue.cpp
r174191 r174222 108 108 { 109 109 bool derived = false; 110 for ( unsigned i = 0; i < m_stops.size(); i++) {111 if (! m_stops[i].isMidpoint && styleResolver->colorFromPrimitiveValueIsDerivedFromElement(m_stops[i].m_color.get())) {112 m_stops[i].m_colorIsDerivedFromElement = true;110 for (auto& stop : m_stops) { 111 if (!stop.isMidpoint && styleResolver->colorFromPrimitiveValueIsDerivedFromElement(stop.m_color.get())) { 112 stop.m_colorIsDerivedFromElement = true; 113 113 derived = true; 114 114 break; … … 128 128 } 129 129 130 for ( unsigned i = 0; i < result->m_stops.size(); i++) {131 if (! result->m_stops[i].isMidpoint)132 result->m_stops[i].m_resolvedColor = styleResolver->colorFromPrimitiveValue(result->m_stops[i].m_color.get());130 for (auto& stop : result->m_stops) { 131 if (!stop.isMidpoint) 132 stop.m_resolvedColor = styleResolver->colorFromPrimitiveValue(stop.m_color.get()); 133 133 } 134 134 … … 277 277 // Stops on the side with the most stops start midway because the curve approximates 278 278 // a line in that region. We then add 5 more color stops on that side to minimize the change 279 // how the luminance changes at each of the color stops. We don't have to add as many on the other side280 // since it becomes small which increases the differentation of luminance which hides the color stops.281 // Even with 4 extra color stops, it *is* possible to discern the steps when the gradient is large and has279 // how the luminance changes at each of the color stops. We don't have to add as many on the other side 280 // since it becomes small which increases the differentation of luminance which hides the color stops. 281 // Even with 4 extra color stops, it *is* possible to discern the steps when the gradient is large and has 282 282 // large luminance differences between midpoint and color stop. If this becomes an issue, we can consider 283 283 // making this algorithm a bit smarter.
Note:
See TracChangeset
for help on using the changeset viewer.