Date: prev next · Thread: first prev next last
2015 Archives by date, by thread · List index


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.meeks@collabora.com  <><, Pseudo Engineer, itinerant idiot


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.