Changeset 18681 in webkit
- Timestamp:
- Jan 8, 2007 2:51:24 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r18679 r18681 1 2007-01-08 Remi Zara <remi_zara@mac.com> 2 3 Reviewed by Darin and Eric. 4 5 Fixes: http://bugs.webkit.org/show_bug.cgi?id=12150 6 Corrected results for W3C's pservers-grad-16-b. 7 Add a test for stop calues corner cases. 8 9 * svg/W3C-SVG-1.1/pservers-grad-16-b-expected.checksum: 10 * svg/W3C-SVG-1.1/pservers-grad-16-b-expected.png: 11 * svg/W3C-SVG-1.1/pservers-grad-16-b-expected.txt: 12 * svg/custom/gradient-stop-corner-cases-expected.checksum: Added. 13 * svg/custom/gradient-stop-corner-cases-expected.png: Added. 14 * svg/custom/gradient-stop-corner-cases-expected.txt: Added. 15 * svg/custom/gradient-stop-corner-cases.svg: Added. 16 1 17 2007-01-08 Darin Adler <darin@apple.com> 2 18 -
trunk/LayoutTests/svg/W3C-SVG-1.1/pservers-grad-16-b-expected.checksum
r18436 r18681 1 498bc4ec2c76c2338c891a2a59c6eb0c 1 8acbf6d2f62d72eaefd74ba51ee14158 -
trunk/LayoutTests/svg/W3C-SVG-1.1/pservers-grad-16-b-expected.txt
r18521 r18681 1 1 KRenderingPaintServer {id="defs1" [type=LINEAR-GRADIENT] [stops=[]] [start=(0,0)] [end=(0,0)]} 2 2 KRenderingPaintServer {id="defs2" [type=LINEAR-GRADIENT] [stops=[(1.00,#000000)]] [start=(0,0)] [end=(1,0)]} 3 KRenderingPaintServer {id="defs3" [type=LINEAR-GRADIENT] [stops=[(0.00,#FFFF00), (0. 10,#0000FF), (0.25,#FF0000), (0.50,#008000)]] [start=(0,0)] [end=(1,0)]}3 KRenderingPaintServer {id="defs3" [type=LINEAR-GRADIENT] [stops=[(0.00,#FFFF00), (0.25,#FF0000), (0.50,#008000), (0.10,#0000FF)]] [start=(0,0)] [end=(1,0)]} 4 4 layer at (0,0) size 480x360 5 5 RenderView at (0,0) size 480x360 … … 8 8 RenderPath {rect} at (19.50,9.50) size 441x81 [stroke={[type=SOLID] [color=#FF0000]}] [fill={[type=LINEAR-GRADIENT] [stops=[]] [start=(0,0)] [end=(0,0)]}] [data="M20.00,10.00L460.00,10.00L460.00,90.00L20.00,90.00"] 9 9 RenderPath {rect} at (20,110) size 440x80 [fill={[type=LINEAR-GRADIENT] [stops=[(1.00,#000000)]] [start=(0,0)] [end=(1,0)]}] [data="M20.00,110.00L460.00,110.00L460.00,190.00L20.00,190.00"] 10 RenderPath {rect} at (20,210) size 440x80 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#FFFF00), (0. 10,#0000FF), (0.25,#FF0000), (0.50,#008000)]] [start=(0,0)] [end=(1,0)]}] [data="M20.00,210.00L460.00,210.00L460.00,290.00L20.00,290.00"]10 RenderPath {rect} at (20,210) size 440x80 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#FFFF00), (0.25,#FF0000), (0.50,#008000), (0.10,#0000FF)]] [start=(0,0)] [end=(1,0)]}] [data="M20.00,210.00L460.00,210.00L460.00,290.00L20.00,290.00"] 11 11 RenderSVGText {text} at (10,340) size 480x46 12 12 RenderSVGInlineText {#text} at (0,-36) size 264x46 -
trunk/WebCore/ChangeLog
r18680 r18681 1 2007-01-08 Remi Zara <remi_zara@mac.com> 2 3 Reviewed by Darin and Eric. 4 5 Fixes: http://bugs.webkit.org/show_bug.cgi?id=12150 6 Handle correctly cases where no stops are defined, cases where a 7 stop offset value is less than previous stops offset value, and cases 8 where a stop offset value is greater than 1.0. 9 10 * platform/graphics/svg/SVGPaintServerGradient.cpp: 11 (WebCore::SVGPaintServerGradient::setGradientStops): Don't sort stops 12 * platform/graphics/svg/cg/SVGPaintServerGradientCg.cpp: 13 (WebCore::cgGradientCallback): When there are no stops, use a transparent 14 fill 15 (WebCore::SVGPaintServerGradient::updateQuartzGradientStopsCache): 16 a stop offset must always be considered at greater or equal to all 17 preceding stop offsets, but no more than 1.0 18 1 19 2007-01-08 Timothy Hatcher <timothy@apple.com> 2 20 … … 196 214 Added this method to DOM and IDL, too. Made namedItem() non-virtual. 197 215 198 >>>>>>> .r18675199 216 2007-01-08 Beth Dakin <bdakin@apple.com> 200 217 -
trunk/WebCore/platform/graphics/svg/SVGPaintServerGradient.cpp
r18521 r18681 33 33 34 34 namespace WebCore { 35 36 // Helpers37 static inline bool compareStopOffset(const SVGGradientStop& first, const SVGGradientStop& second)38 {39 return first.first < second.first;40 }41 35 42 36 TextStream& operator<<(TextStream& ts, SVGGradientSpreadMethod m) … … 98 92 { 99 93 m_stops = stops; 100 std::sort(m_stops.begin(), m_stops.end(), compareStopOffset);101 94 } 102 95 -
trunk/WebCore/platform/graphics/svg/cg/SVGPaintServerGradientCg.cpp
r18641 r18681 46 46 47 47 if (!stopsCount) { 48 outColor[0] = 0; 49 outColor[1] = 0; 50 outColor[2] = 0; 51 outColor[3] = 1; 48 memset(outColor, 0, 4 * sizeof(CGFloat)); 52 49 return; 53 50 } else if (stopsCount == 1) { … … 133 130 CGFloat previousOffset = 0.0; 134 131 for (unsigned i = 0; i < stops.size(); ++i) { 135 m_stopsCache[i].offset = stops[i].first; 136 m_stopsCache[i].previousDeltaInverse = 1.0 / (stops[i].first - previousOffset); 137 previousOffset = stops[i].first; 132 CGFloat currOffset = min(max(stops[i].first, previousOffset), 1.0f); 133 m_stopsCache[i].offset = currOffset; 134 m_stopsCache[i].previousDeltaInverse = 1.0 / (currOffset - previousOffset); 135 previousOffset = currOffset; 138 136 CGFloat* ca = m_stopsCache[i].colorArray; 139 137 stops[i].second.getRGBA(ca[0], ca[1], ca[2], ca[3]);
Note: See TracChangeset
for help on using the changeset viewer.