[cairo] [cairo-commit] 2 commits - src/cairo-os2.h src/cairo-os2-surface.c

Behdad Esfahbod behdad at behdad.org
Thu Feb 7 21:17:45 PST 2008


On Thu, 2008-02-07 at 22:23 +0100, Peter Weilbacher wrote:
> On 07.02.08 00:25, Behdad Esfahbod wrote:
> > On Wed, 2008-02-06 at 15:07 -0800, Peter Weilbacher wrote:
> >> +/**
> >> + * cairo_os2_init:
> >> + *
> >> + * Initializes the Cairo library. This function is automatically called if
> >> + * Cairo was compiled to be a DLL (however it's not a problem if it's called
> >> + * multiple times). But if you link to Cairo statically, you have to call it
> >> + * once to set up Cairo's internal structures and mutexes.
> >> + *
> >> + * Since: 1.4
> >> + **/
> >>   cairo_public void
> >>   cairo_os2_init (void)
> >>   {
> >
> > Why do you need this?  This function is not in the spirit of cairo.
> 
> The archive should be already full of reasons why we need that.

One would assume that there's a reason for me asking.  We (tbf and I)
rewrote the mutex stuff three times such that no one needs to do these
kind of things anymore.


> > Mutex initialization should happen automatically.  If you need this for
> > FcInit(), we can make that automatic too.
> 
> How?

By calling CAIRO_MUTEX_INITIALIZE() in strategic places, making sure all
static mutexes are initialized before being used.

For FcInit(), it would be a matter of doing similarly in a couple places
in cairo-ft-font.c.  Why do you call FcInit() btw?  I've never seen
anyone calling it.  Cairo doesn't, pango doesn't, GTK+ doesn't.  Why do
you think it's necessary on OS/2?


> > BTW, the code in there
> > assumes that freetype font backend is compiled in unconditionally.
> 
> Yes, we should indeed bracket the Fc*() calls with #if CAIRO_HAS_FT_FONT.
> Even though it is highly unlikely that someone will compile the OS/2
> backend without the FreeType stuff.
> 
>     Peter.
-- 
behdad
http://behdad.org/

"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