From:  Peter Weilbacher <newsspam@weilbacher.org>
Date:  23 Nov 2005 17:26:45 Hong Kong Time
Newsgroup:  news.mozilla.org/netscape.public.mozilla.layout
Subject:  

Re: Background color for SVG

NNTP-Posting-Host:  null

T Rowley wrote:
> On 11/22/05 5:20 AM, Peter Weilbacher wrote:
>> The compositing is the problem on OS/2. AFAIU it's not possible to draw 
>> directly to the screen in an efficient way. Instead we draw to an 
>> offscreen surface and then blit that to the screen. To composite implies
>> that we know the background color while painting the offscreen surface.
> 
> On all platforms gecko uses doublebuffering, rendering offscreen and 
> only showing the user the completed rendered area.  If your os/2 cairo 
> backend is working correctly then the composite "just happens" from the 
> mozilla SVG point of view.

The part that I didn't describe above and that you are not aware of was
that we cannot draw transparent pixels on OS/2 (the graphics routines
don't know an alpha channel). We can only compute the appearance of
transparency and so simulate the correct appearance.
Under these circumstances, cairo doesn't draw anything for the empty
areas. But when blitting to screen the transparent areas are filled with
whatever was there before (random parts of previous SVG content in most
cases). As cairo has no knowledge about the background color it cannot
draw these pixels correctly. Hence my original question about the
background color behind the SVG and how I could access it from
nsSVGCairoCanvas.

I am aware that when the SVG appears on top of some other content we
will get wrong results without real transparency but for now this is the
best we could do. Or did I get it all wrong again?
-- 
Grüße von
   Peter.