[cairo] adding canvas/javascript backend

Vladimir Vukicevic vladimir at pobox.com
Mon Jan 7 11:31:33 PST 2008


On Jan 7, 2008, at 9:38 AM, Geert Jansen wrote:

>
> Finally do you know if the imaging models of Mozilla's 2d canvas and
> Cairo are compatible? I'm no expert in this area so I can only see  
> that
> superficially they look the same but I'd like to prevent finding out
> that there's fundamental differences after putting a lot of work in  
> this.

They are for the most part, though there are a few slight differences  
-- also canvas doesn't expose cairo's entire functionality (e.g. other  
than with some mozilla-firefox-3-only extensions, there is no way to  
draw text; you can emulate that with <div>s, but you can't do  
transformed text that way; only recent canvas implementations have  
setTransform() for general transformation matrix modification, etc.).   
Neat idea nonetheless; shouldn't be too hard to do.

If you take a look at the patch in bug https://bugzilla.mozilla.org/show_bug.cgi?id=391604 
  part of it implements a "cairo-null-surface.c", which is basically  
the minimum bits necessary to implement a full backend.  It doesn't  
actually do anything, but you can then fill in the blanks :)  (Is  
there interest in me checking that into cairo proper?  That patch  
never landed in mozilla either, it was intended to let me measure  
performance without bringing in platform-specific rendering.)

     - Vlad



More information about the cairo mailing list