Home | History | Annotate | Download | only in css

Lines Matching refs:stops

155         // The back end already sorted the stops.
162 Vector<GradientStop> stops(numStops);
177 stops[i].color = renderer->resolveColor(stop.m_resolvedColor);
181 stops[i].offset = stop.m_position->getFloatValue(CSSPrimitiveValue::CSS_PERCENTAGE) / 100;
192 stops[i].offset = (gradientLength > 0) ? length / gradientLength : 0;
195 stops[i].offset = 0;
197 stops[i].specified = true;
202 stops[i].offset = 0;
203 stops[i].specified = true;
205 stops[i].offset = 1;
206 stops[i].specified = true;
213 if (stops[i].specified && i > 0) {
216 if (stops[prevSpecifiedIndex].specified)
220 if (stops[i].offset < stops[prevSpecifiedIndex].offset)
221 stops[i].offset = stops[prevSpecifiedIndex].offset;
225 ASSERT(stops[0].specified && stops[numStops - 1].specified);
228 // color-stops without positions, set their positions so that they are evenly spaced
229 // between the preceding and following color-stops with positions.
235 if (!stops[i].specified && !inUnspecifiedRun) {
238 } else if (stops[i].specified && inUnspecifiedRun) {
242 float lastSpecifiedOffset = stops[unspecifiedRunStart - 1].offset;
243 float nextSpecifiedOffset = stops[unspecifiedRunEnd].offset;
247 stops[j].offset = lastSpecifiedOffset + (j - unspecifiedRunStart + 1) * delta;
255 // If the gradient is repeating, repeat the color stops.
259 // If the difference in the positions of the first and last color-stops is 0,
261 float gradientRange = stops[numStops - 1].offset - stops[0].offset;
263 stops.first().offset = 0;
264 stops.first().color = stops.last().color;
265 stops.shrink(1);
285 // Work backwards from the first, adding stops until we get one before 0.
286 float firstOffset = stops[0].offset;
292 GradientStop newStop = stops[originalFirstStopIndex + srcStopOrdinal];
294 stops.prepend(newStop);
300 currOffset -= stops[originalFirstStopIndex + srcStopOrdinal].offset - stops[originalFirstStopIndex + srcStopOrdinal - 1].offset;
305 // Work forwards from the end, adding stops until we get one after 1.
306 float lastOffset = stops[stops.size() - 1].offset;
313 GradientStop newStop = stops[srcStopIndex];
315 stops.append(newStop);
319 currOffset += stops[srcStopIndex + 1].offset - stops[srcStopIndex].offset;
326 numStops = stops.size();
328 // If the gradient goes outside the 0-1 range, normalize it by moving the endpoints, and adjusting the stops.
329 if (numStops > 1 && (stops[0].offset < 0 || stops[numStops - 1].offset > 1)) {
331 float firstOffset = stops[0].offset;
332 float lastOffset = stops[numStops - 1].offset;
336 stops[i].offset = (stops[i].offset - firstOffset) / scale;
345 float lastOffset = stops[numStops - 1].offset;
351 if (stops[i].offset >= 0) {
358 if (firstZeroOrGreaterIndex < numStops && stops[firstZeroOrGreaterIndex].offset > 0) {
359 float prevOffset = stops[firstZeroOrGreaterIndex - 1].offset;
360 float nextOffset = stops[firstZeroOrGreaterIndex].offset;
364 Color blendedColor = blend(stops[firstZeroOrGreaterIndex - 1].color, stops[firstZeroOrGreaterIndex].color, interStopProportion);
368 stops[i].offset = 0;
369 stops[i].color = blendedColor;
372 // All stops are below 0; just clamp them.
374 stops[i].offset = 0;
379 stops[i].offset /= scale;
387 gradient->addColorStop(stops[i].offset, stops[i].color);
703 // Now add the stops.
1121 // Now add the stops.