Closed Bug 603584 Opened 14 years ago Closed 14 years ago

Filter feDisplacementMap broken

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0b8

People

(Reporter: jay, Assigned: longsonr)

References

()

Details

(Keywords: testcase)

Attachments

(3 files, 7 obsolete files)

fill in ff nightly predominantly light Opera and Safari dark
Attached image os x testcase (obsolete) —
Keywords: testcase
Attached image screengrab, Opera on left, ff on right (obsolete) —
url provides use case, or broader context
How have you established that Firefox is wrong and Opera/Safari is right other than it being 2 against 1?
Needs a reduced testcase.
Status: NEW → UNCONFIRMED
Ever confirmed: false
Please could you define a little better what you would expect in the testcase? How would you like me to establish this, other than by filing a bug or taking to the working group? in my tests before filing a bug, I ascertained that all three browsers closely agreed, when either no filter was applied, or feTurbulence only was applied. The original fill is dark, and similar to that in Opera and Safari in the final result.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached image testcase (obsolete) —
Attachment #482504 - Attachment is obsolete: true
Status: NEW → UNCONFIRMED
Ever confirmed: false
OS: Mac OS X → All
(In reply to comment #6) > Please could you define a little better what you would expect in the testcase? > How would you like me to establish this, other than by filing a bug or taking > to the working group? If you think feDisplacementMap is wrong then that should be the only filter. The output of feTurbulence is complicated and so it makes the displacement map data complicated. Don't use gradients in tests about filters. Don't use more than one rect with the filter on it. > The original fill is dark, and similar to that in Opera and Safari in the final > result. Why are they correct? If you make the testcase simple enough we should be able to work out where the colours are coming from. With feTurbulence we can't really as the exact pixel colours of the turbulence vary so much across the surface and are not directly accessible.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: All → Mac OS X
OK I wrote that before comment 7. Just the turbulence to remove now.
Alternatively, see bug 584322. Can you figure out why this example (https://bugzilla.mozilla.org/attachment.cgi?id=462849) which also uses turbulence and displacement map now gives the same result as Opera whilst yours does not. If you adjust your filter attributes till you find what makes the difference we may get somewhere.
Attached image testcase (obsolete) —
Attached image testcase
Attachment #482509 - Attachment is obsolete: true
Attachment #482523 - Attachment is obsolete: true
#10 Robert, this uses the identical filter to 584322, which is hard to credit... but at least on OS X the hue is lighter, whereas darker in Opera & Safari. the only action I took was to widen the rectangle as when the scale="50" the distortion is great for a narrow rectangle.
Attachment #482505 - Attachment is obsolete: true
4.0b8pre os x 10.6.4
It all comes down to whether the output of feDisplacementMap should be premultiplied or not. The specification clearly says how to treat the inputs (in1 and in2) http://www.w3.org/TR/SVG/filters.html#feDisplacementMapElement it does not say how to treat the output. Should that be affected by color-interpolation-filters or should it always be SRGB, LINEARRGB or whatever in1 is or even whatever in2 is. Firefox takes the output as being whatever colour space is defined by color-interpolation-filters i.e. if in1 starts as LINEARRGB then it finishes as LINEARRGB. It seems like Opera and Safari assume it is SRGB. This needs taking up with the w3c as it is unclear what is correct.
Status: NEW → UNCONFIRMED
Ever confirmed: false
Attached patch patch (obsolete) — Splinter Review
in1 is the source image and in2 supplies the displacements. So it does not make sense that applying in2 should change the colour space of the output. The output colour space should be whatever in1 is.
Assignee: nobody → longsonr
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #483817 - Flags: review?
Attachment #483817 - Flags: review? → review?(roc)
Giving OperatesOnSRGB a side effect and relying on it being called with aInput==0 before aInput==-1 is really ugly. Can we do this in a better way?
Attachment #483817 - Flags: review?(roc)
Attached patch how about this instead then? (obsolete) — Splinter Review
Attachment #485491 - Flags: review?(roc)
Attached patch without the no-op line this time (obsolete) — Splinter Review
Attachment #485491 - Attachment is obsolete: true
Attachment #485497 - Flags: review?(roc)
Attachment #485491 - Flags: review?(roc)
Comment on attachment 485497 [details] [diff] [review] without the no-op line this time still think I can make this neater
Attachment #485497 - Flags: review?(roc)
Comment on attachment 485497 [details] [diff] [review] without the no-op line this time I tried restructuring it again without success so this is the best I've come up with.
Attachment #485497 - Flags: review?(roc)
Plan c) would be to create a new nsTArray of pointers to images. Then pass that through to the GetxxxColorMap methods. GetOutputColorMap would then work as it would have the in1 image. However this really isn't required if we keep the code in nsSVGFilterInstance to use the in1 image as the output colour map.
Comment on attachment 485497 [details] [diff] [review] without the no-op line this time straightforward patch with reftest.
Attachment #485497 - Flags: approval2.0?
Attachment #483817 - Attachment is obsolete: true
Attachment #485497 - Attachment is obsolete: true
Keywords: checkin-needed
Whiteboard: [c-n: after 2.0b7 freeze]
Status: NEW → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
OS: Mac OS X → All
Resolution: --- → FIXED
Whiteboard: [c-n: after 2.0b7 freeze]
Target Milestone: --- → mozilla2.0b8
is this fix in the trunk? the latest nightly dated today's date, remains predominantly light, as opposed to dark.
The fix will be in the next nightly.
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: