Hi Pranav,

On Wed, 2015-07-15 at 23:48 +0530, Pranav Kant wrote:
> One important function that I am still not able to call in separate
> thread is drawing the tiles on the screen. The gtk passes the cairo
> contexts whenever 'draw' signal is emitted. The drawing works fine if
> I use this cairo contexts in a synchronous way, 

        Ho hum =) this is not possible. The Cairo context is (by design) only
live for the scope of the 'draw' signal - this is a feature heavily tied
to double buffering, and the gtk+ rendering infrastructure and it is a
'good thing' (TM) =)

        I would recommend instead rendering the tile content asynchronously,
and if we have no tile rendering something else ;-) ( a scaled version
of what was there, or a white background).

        LibreOffice can render its tiles asynchronously rather nicely - and
when they show up - just call the gtk+ equivalent of invalidate:
gtk_widget_queue_draw_area() and in a few microseconds you should get
the callback with the cairo context that you want =)

        Hope that helps ! =)

        ATB,

                Michael.

-- 
 michael.me...@collabora.com  <><, Pseudo Engineer, itinerant idiot

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to