Closed Bug 445079 Opened 16 years ago Closed 16 years ago

Make foreignObject work in filters (and patterns)

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: roc, Assigned: roc)

Details

Attachments

(1 file)

Attached patch fixSplinter Review
Currently foreignObject doesn't work when 'filter' is applied to it, because filters create a new nsSVGRenderState with no embedded nsIRenderingContext. We should just create one on demand. One issue is that the gfxContext wrapped in an nsIRenderingContext must be heap-allocated; this patch changes nsSVGRenderState to target a temporary surface instead of a temporary context, and makes nsSVGRenderState manage the gfxContext itself.
Attachment #329382 - Flags: superreview?(mats.palmgren)
Attachment #329382 - Flags: review?(longsonr)
Comment on attachment 329382 [details] [diff] [review]
fix

>diff -NrpU12 mozilla-checkin.6692da1caef5/layout/reftests/svg/filter-foreignobject-01.svg mozilla-checkin/layout/reftests/svg/filter-foreignobject-01.svg
>--- mozilla-checkin.6692da1caef5/layout/reftests/svg/filter-foreignobject-01.svg	1970-01-01 12:00:00.000000000 +1200
>+++ mozilla-checkin/layout/reftests/svg/filter-foreignobject-01.svg	2008-07-14 

Can you change the filename case to foreignObject so that it matches the other foreignObject files in this directory please?
Attachment #329382 - Flags: review?(longsonr) → review+
Comment on attachment 329382 [details] [diff] [review]
fix

sr=mats

It looks like nsSVGFilterInstance.cpp does not need
#include "gfxContext.h"
Attachment #329382 - Flags: superreview?(mats.palmgren) → superreview+
Pushed 6c8c95fcaf9b with comments.
Status: NEW → RESOLVED
Closed: 16 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
I backed out ... the test failed on Windows. I'm not sure why.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
I think bug 445410 is contributing to the problem. However, the main issue is that the filter region is not pixel-aligned (because of the default -10%/+20% values) and so there's inevitable smearing when we composite a temporary surface into that rectangle. I think perhaps we should snap the filter region to pixels.
But I'd like to land the rest of the filter patches from my branch before I fix that, otherwise there will be conflicts.
(In reply to comment #6)
> I think perhaps we should snap the filter region to pixels.

That sounds like a good plan to me.  Would you round the region outwards, or just snap to nearest?
Probably snap to nearest.
Pushed 8c1b20b1be5e.

I didn't solve the underlying smearing problem that caused the test failure. I just worked around it by making the filter region precisely the viewport. I don't have time to solve the smearing problem right now and I needed to land this fix to keep making progress landing bling-branch patches.
Status: REOPENED → RESOLVED
Closed: 16 years ago16 years ago
Resolution: --- → FIXED
Verified. Works perfectly with Canvas.. now we only need Tamarin to speed up software filters and we have a Photoshop killer :)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: