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

Peter Weilbacher mozilla at Weilbacher.org
Fri Feb 8 03:53:57 PST 2008


On Fri, 8 Feb 2008, Behdad Esfahbod wrote:

>> On 07.02.08 00:25, Behdad Esfahbod wrote:
>>> Mutex initialization should happen automatically.  If you need this for
>>> FcInit(), we can make that automatic too.
>
> By calling CAIRO_MUTEX_INITIALIZE() in strategic places, making sure all
> static mutexes are initialized before being used.

I notice that some of the other platform surfaces call that in their 
_create() function(s). Is that what you mean by "strategic"? But then 
where should I put the respective FINALIZE? I don't see that e.g. in 
cairo_surface_destroy(). And what about _create()s of the other surface 
types?

And if that was so easy, why then does the Windows code have to set up 
these things in the DLL init routine, too? (And what does Windows do for 
statically linked programs?) Also weird that no other platform calls 
FINALIZE at all.

> 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?

I was wondering myself yesterday, why none of the tests that use FC 
stuff call FcInit() even though the FC documentation says that before 
using any of those you have to call that or one of the other FcInit*() 
functions. I can only guess that some kind of FcInit() is done in 
somewhere in X and so on Unixes you don't need to call it again.

In any case, on OS/2 we do need it, otherwise we won't have any fonts in 
the font list that FC manages.

But even if we move away those to somewhere else, where should we put 
the DisableFPUException call? I know that on my machine it's not an 
issue (probably that's why most of the testsuite runs) but lots of users 
will crash immediately if that isn't there. The comment says this would 
only happen for OS/2 PM APIs but I know that we had similar problems in 
the Mozilla JS library. So I think it's not just relevant for OS/2 
surfaces but probably also the other surface types.

    Peter.


More information about the cairo mailing list