On 13.07.2010, at 02:44, Domingo Alvarez Duarte wrote:
> I've managed to have Fl_Clock printed correctly on generated pdf using a
> flag on fl_vertex.cxx "fl_is_pdf" and changing the angle sign of the
> argument to fl_rotate when generating pdfs.
>
> But doing this I could see that the actual implementation isn't thread
> safe, in fact only one thread can use the fl_vertex.cxx functions at a
> time and should leave the matrix stack as it was before.

I believe that all drawing is not thread safe by design. This is not
intended, and I don't think that it will be possible.

> Probably pdf, postcript and direct printing will be executed as
> background tasks or independent threads on some applications to don't
> block the user interface but the actual implementation doesn't permit it.

I don't think that this is possible. FLTK's "Fl_Device-Philosophy" ;-)
is that there is a static "current device" variable (among others).
Therefore you can't do anything parallel to the main FLTK thread,
because you would need to change the static variables...

> Probably everything on fl_vertex.cxx should be non static members of
> Fl_Graphics_Driver class, this way multithread using different derived
> Fl_Graphics_Driver can work properly.
>
> Can this be made ?

Independent of what I wrote before, such changes might be worth
investigating, but they wouldn't help to make parallel printing
possible, IMHO.  Disclaimer: I didn't check the code so far...

Albrecht
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to