Comment 12 for bug 597974

Revision history for this message
Tavmjong Bah (tavmjong-free) wrote :

Fix checked into trunk. Will backport to 0.48 if no one cries foul in the next day or two. The fix is to initialize the mask bitmap black rather than white. I was wrong about the routine not taking alpha into account, the RGB values are already multiplied by alpha, fill_opacity, etc. (my original test cases hid this). I also fixed the luminance calculation. I used floats since speed isn't a big factor in exporting.

I found a new problem. In the screen display of masked objects, the mask RGB values are added linearly. They should be added as described above. This results in the screen display looking different from the PDF export and from display in browsers. The location of the relevant code is in nr-arena-item.cpp (two places). This is mission critical code so I'll ask for help in fixing it.

One additional possible problem, is that luminance should be calculated with linear RGB values. I believe the code is using sRGB however the results seem to match other SVG renderers.