From:  "Peter Weilbacher" <>
Date:  24 Nov 2005 17:47:19 Hong Kong Time

Re: Background color for SVG


On Wed, 23 Nov 2005 18:45:36 UTC, T Rowley wrote:

> On 11/23/05 3:26 AM, Peter Weilbacher wrote:
> > 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.
> It sounds like your cairo backend might be correctly implemented, but as 
> it isn't in CVS I can't check.

No, from what I have heard it's not in CVS because there were some 
changes necessary to the cairo codebase to get it to compile on OS/2 
with different compilers that the cairo team didn't like. And I guess 
Mozilla syncs with cairo CVS so it's not there, either. (Hmm, can we 
check in the working OS/2 files to Mozilla CVS at all under these 

> Cairo has fallbacks that allow it to be 
> implemented on platforms that have no native support for an alpha 
> channel.  If a backend doesn't support native compositing, the fallback 
> calls _cairo_os2_surface_acquire_dest_image to obtain the current 
> surface contents, does the composite internally, and then 
> _cairo_os2_surface_release_dest_image to render the result.  This is 
> similar to the method nsImageOS2.cpp uses to draw RGBA images.

If you want you can take a look at the OS/2 cairo files in
Both functions you quote are implemented and get called when I display 
SVG content in my SeaMonkey build. But should the actual compositing be 
implemented in the backend (I notice a function 
_cairo_win32_surface_composite) or how else is cairo told that it should
do the compositing?
Greetings,                                                             ^