[cairo] adding canvas/javascript backend

Behdad Esfahbod behdad at behdad.org
Mon Jan 7 13:03:50 PST 2008

On Mon, 2008-01-07 at 14:31 -0500, Vladimir Vukicevic wrote:
> 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?

I like the idea.  Can be made a measurement surface instead.  We need to
be able to set all the per-backend info on it to be useful.  That means
adding the following API:


and any new ones in the future.  For that reason, may make sense to have
a function to copy all per-surface properties that affect rendering
(including extents) from one surface to another.  This will be useful
when we expose meta-surface too.

This doesn't solve the measurement needed before creating the surface
though.  With this, the new practice would be even uglier:

  1) Create a 0x0 PDF surface
  2) Create measurement surface and copy surface properties from the PDF
surface.  Measure
  3) Create PDF surface of the right size using extents returned by
measurement surface.


"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759

More information about the cairo mailing list