There are still some minor problems with SVG Gradients.
1.Stroke of objects aren't handled with gradients at present.
2.If a stop is less than all previous stops, it is set equal to the largest stop:
3.If you fill the stroke of a line with a gradient without stoppoints (only color-set), CAIRO stops rendering at this point:
(only related to lines)
4.If you use an own font-family (with glyph) a gradient is drawn for every glyph instead for the hole text.
(can only be seen if you modify FontCairo, to draw texts with colors, gradients, pattern for SVG)
Created attachment 20899 [details]
Fixes point 1 and 2.
Point 3 is related to the boundingBoxMode.
FloatRect bbox = object->relativeBBox(false);
gets (0,0,0,0). Thats why cairo stops rendering.
I have no idea what could be the reason.
object->relativeBBox(false) seems to call FloatRect(const IntRect& r) ... in FloatRect.cpp
and FloatRect should give the right values but gives (0,0,0,0).
I could have sworn I reviewed this exact patch already on some other bug?
(In reply to comment #3)
> I could have sworn I reviewed this exact patch already on some other bug?
Nearly the same, on another bug yes :-) 18700.
I reseted the review-tag to none, since it is clear, how the code should be shared.
Created attachment 21022 [details]
This patch fixes 1, 2 and 3.
The problem for 3 was PathCairo. PathCairo uses cairo_fill_extends instead of cairo_path_extends (like suggested in the manual of cairo). Thats why boundingBox gets (0,0,0,0). The SVG-test-suite of W3C runs smooth with one exception: point 4.
4 is related to FontCairo and should be fixed there.
As long as it is not clear which code should be shared with the other PaintServers (look #18700), the review-flag is empty.
Created attachment 21309 [details]
Additional fix for radial gradients with bounding box. (see http://www.w3.org/Graphics/SVG/Test/20061213/htmlEmbedHarness/full-pservers-grad-13-b.html last two boxes). A focus have to be inside a radius of a gradient.
Created attachment 21429 [details]
Modified coding-style to the one of SVG/Cairo patterns.
Created attachment 21909 [details]
forgot my email
Good job, indeed the paintserver code has to be shared across all implementations. The long term goal is to remove the whole specialized painting abstraction for SVG anyway and join with GraphicsContext used throughout WebCore.
Have a nice weekend :-)
Landed in r35391.