Bug 15449 - [CAIRO] SVG gradients do not work properly
Summary: [CAIRO] SVG gradients do not work properly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 523.x (Safari 3)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: Cairo
Depends on:
Blocks:
 
Reported: 2007-10-09 21:59 PDT by Alp Toker
Modified: 2008-04-20 17:25 PDT (History)
2 users (show)

See Also:


Attachments
Correct colors of gradients (1.31 KB, patch)
2008-04-14 07:50 PDT, Dirk Schulze
no flags Details | Formatted Diff | Diff
Add RadialGradient to Cairo (1.95 KB, patch)
2008-04-14 11:15 PDT, Dirk Schulze
no flags Details | Formatted Diff | Diff
Fixed colors and drawing of Gradients in Cairo (3.64 KB, patch)
2008-04-15 09:45 PDT, Dirk Schulze
no flags Details | Formatted Diff | Diff
Fixed gradients for SVG in Cairo (3.80 KB, patch)
2008-04-16 01:18 PDT, Dirk Schulze
no flags Details | Formatted Diff | Diff
Fixed gradients for SVG in Cairo (4.05 KB, patch)
2008-04-16 10:17 PDT, Dirk Schulze
no flags Details | Formatted Diff | Diff
Fixed colors and drawing (4.30 KB, patch)
2008-04-16 11:37 PDT, Dirk Schulze
eric: review-
Details | Formatted Diff | Diff
Fixed gradients for SVG in Cairo (4.25 KB, patch)
2008-04-16 22:34 PDT, Dirk Schulze
no flags Details | Formatted Diff | Diff
Fixed gradients for SVG in Cairo (4.44 KB, patch)
2008-04-17 13:08 PDT, Dirk Schulze
alp: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alp Toker 2007-10-09 21:59:46 PDT
Linear gradients are often wrong and radial gradients are not implemented at all.
Comment 1 Dirk Schulze 2008-04-14 07:50:30 PDT
Created attachment 20532 [details]
Correct colors of gradients

This only correct the colors of gradients in svg. There are still problems with displaying linear gradients.
Comment 2 Dirk Schulze 2008-04-14 11:15:07 PDT
Created attachment 20535 [details]
Add RadialGradient to Cairo

Add basic radialGradient for SVG to Cairo. Don't inclued boundingBoxMode.
Comment 3 Dirk Schulze 2008-04-15 09:45:41 PDT
Created attachment 20558 [details]
Fixed colors and drawing of Gradients in Cairo

Fixed colors and drawing of Gradients in Cairo. boundingBoxMode is still missing for radian gradients. (This patch includes previous patches)
Comment 4 Dirk Schulze 2008-04-16 01:18:22 PDT
Created attachment 20578 [details]
Fixed gradients for SVG in Cairo

This Patch fixes problems with color-set and drawing of radial and linear gradients (fixed problems with boundingBoxMode too).

Have problems with animation and gradients (but I have problems with animation all the time). Should be fixed in another bug-report. I don't believe that it is related to SVGPaintServerGradientCairo.

Why should boundingBoxMode use strokeBBox? The qt-port uses something like that and the source-code is bigger with it.
Comment 5 Dirk Schulze 2008-04-16 10:17:21 PDT
Created attachment 20590 [details]
Fixed gradients for SVG in Cairo

(forgot a focal-test in radialGradient)
Comment 6 Dirk Schulze 2008-04-16 11:37:11 PDT
Created attachment 20593 [details]
Fixed colors and drawing

minor changes
Comment 7 Eric Seidel (no email) 2008-04-16 21:41:11 PDT
Comment on attachment 20593 [details]
Fixed colors and drawing

The patch in general looks fine.

We don't generally pre-declare variables at the top of a block.  That's C-style and this is C++.
double cx, fx, cy, fy, radius, fradius; // one example

These are extra braces according to our style guidelines:
if ((fx + cx) <  cx) {
+                fx = int(cos(angle) * radius) + 1;
+            }

Otherwise it looks fine.

Why are there no test changes?  Does the GTK build still not have pixel tests?
Comment 8 Dirk Schulze 2008-04-16 22:34:20 PDT
Created attachment 20611 [details]
Fixed gradients for SVG in Cairo

Fixes to match coding-style.
Comment 9 Dirk Schulze 2008-04-17 13:08:03 PDT
Created attachment 20635 [details]
Fixed gradients for SVG in Cairo

It uses RenderPathCairo's strokeBBox now.
Comment 10 Alp Toker 2008-04-20 17:24:32 PDT
Comment on attachment 20635 [details]
Fixed gradients for SVG in Cairo

r=me
Comment 11 Alp Toker 2008-04-20 17:25:03 PDT
Landed in r32284.