Bug 88877
Summary: | SVG Lightning filter effects incorrect under zoom | ||
---|---|---|---|
Product: | WebKit | Reporter: | Philip Rogers <pdr> |
Component: | SVG | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | fmalita, krit, rhodovan.u-szeged, simon.fraser, zherczeg, zimmermann |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Bug Depends on: | |||
Bug Blocks: | 68469, 26389 |
Philip Rogers
fePointLight (and other filters) are incorrect if the page is zoomed. As an example, visit the following url and zoom in: http://www.w3.org/Graphics/SVG/Test/20110816/harness/htmlObjectApproved/filters-light-01-f.html
Expected: light sources zoom consistently.
Actual: light sources change in intensity and position.
(Original bug: crbug.com/130945)
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Dirk Schulze
I thought we already have a bug report for that? IIRC Reni or Zoltan were working on that but seem to be busy yet. Sadly the search engine
Robert Longson
http://www.w3.org/TR/SVG/filters.html#feDiffuseLightingElement Because they operate on pixels, such filters are inherently resolution-dependent. To make ‘feDiffuseLighting’ produce resolution-independent results, an explicit value should be provided for either the ‘filterRes’ attribute on the ‘filter’ element and/or attribute ‘kernelUnitLength’.
The testsuite test doesn't set these attributes so zooming in is likely to result in at least an intensity change depending on how it's implemented in Webkit.
Dirk Schulze
(In reply to comment #2)
> http://www.w3.org/TR/SVG/filters.html#feDiffuseLightingElement Because they operate on pixels, such filters are inherently resolution-dependent. To make ‘feDiffuseLighting’ produce resolution-independent results, an explicit value should be provided for either the ‘filterRes’ attribute on the ‘filter’ element and/or attribute ‘kernelUnitLength’.
>
> The testsuite test doesn't set these attributes so zooming in is likely to result in at least an intensity change depending on how it's implemented in Webkit.
At the moment the light source position is transformed by using wrong transformations. That causes the issue. This is a known bug, that we have since filters render pixel perfect. FF handles this case correctly.
Dirk Schulze
(In reply to comment #3)
the issue. This is a known bug, that we have since filters render pixel perfect.
s/pixel-perfect/resolution-independent/ :)
Zoltan Herczeg
I remember this bug very well, and I think we should fix it sometimes.
Florin Malita
A couple of problems I found (related to the original bug report - http://crbug.com/13094):
1) light source positioning: currently we're not transforming the light source *at all* (zoom or no zoom)
2) FELighting is applied in unmultiplied space, but the alpha channel is calculated as if in premultiplied space (spec says Sa = max(Sr, Sg, Sb), premultiplied RGBA implied). Then when the image is converted to premultiplied for compositing, the RGB values are scaled down resulting in a darker light effect.
I'll open a separate bug for #2.
Simon Fraser (smfr)
Fixed via bug 181147 and bug 181197