Closed Bug 379321 Opened 17 years ago Closed 17 years ago

spreadmethod="reflect" or "repeat" with linear gradient in <object> doesn't work?

Categories

(Core :: SVG, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jruderman, Unassigned)

References

()

Details

Attachments

(1 file, 1 obsolete file)

http://www.w3.org/Graphics/SVG/Test/20061213/htmlObjectHarness/full-pservers-grad-14-b.html

All of the examples on the left look the same (pad).  But if I right-click and select "Show only this frame", it looks right.  So maybe being in an <object> is somehow screwing it up?
This might be Mac-specific, or even a bug in the cairo quartz backend.
(In reply to comment #1)
> This might be Mac-specific, or even a bug in the cairo quartz backend.
> 

It does seem to work properly on Windows XP.
CC'ing Brian in case he knows anything about this.
Yes, its a cairo bug. Looking at our tests I see the extend_pad test is marked XFAIL, and the extend_reflect test case isn't even being run (IIRC its an intermittent X11-crasher). So theres known bugs in there.

In any case, fixing extend_* and making the quartz surface fully supported is on the roadmap for 1.6 - supposedly in July - which is supposed to target anything still needing done for firefox 3.
Previously cairo quartz only implemented extend-repeat, which makes it even odder that you only see extend-pad here! I've started implementing the others - this adds extend-reflect. I've checked it out using cairo's tests and it works fine, but some other fallback must be kicking in to cause this rendering in minefield, which is unchanged. Also, its only affecting the linear gradients? Weird.

So, this patch isn't really helping (yet), but will be part of getting this all to work. I'll dig on.
The 'correct' linear gradient rendering happens when the test in _cairo_quartz_cairo_gradient_pattern_to_quartz for an identity pattern matrix fails. 
The radial gradient doesn't even get this far before dropping to the fallback implementation, so it works too;
Finally, the incorrect rendering happens because the quartz implementation doesn't actually support extend for gradients - gradients are implemented directly on top of CGShadingRef, when we have extend-reflect or extend-repeat we need to create a CGPattern first.

There is an easy workaround and a harder fix; the workaround is just to check for unsupported options at the same point in _cairo_quartz_cairo_gradient_pattern_to_quartz, and return NULL. That's this patch, which fixes the bug in my minefield.

The fix is to implement gradients properly (doh! :) ). Marking previous patch as superseded, you won't need it for this to work. I'll shepherd this or a proper fix into cairo trunk for 1.6.
Attachment #266402 - Attachment is obsolete: true
Depends on: 383960
Is this still broken?
Working now, fixed by 383960 landing.

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9b2pre) Gecko/2007113023 Minefield/3.0b2pre
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: