From: Hezekiah M. C. <hez...@us...> - 2009-08-22 21:04:50
|
For anyone interested, I have attached a patch for the Cairo plot driver which speeds up plotting to the xcairo device considerably, with the caveat that the plot contents will not appear in the plot window until a flush occurs by one of: - A call to plflush - The end of the page is reached (e.g., pleop, plenv to start a new page, plend/plend1 to end the plot stream) This patch puts the behavior of the xcairo device somewhere between the xwin driver which updates the plot display as it is made and the qtwidget device which does not display the plot until the end of a page. The rendering speedup is attained by rendering the plot to an off-screen surface and only updating the visible window when requested. With this patch applied, the PLplot examples render as fast or faster on my system (64bit Linux, Cairo 1.8.6) with the xcairo device as they do with the xwin device, without any flickering and with all anti-aliasing enabled. The compiled PLplot examples illustrate the speedup (particularly examples 11, 16 and 20) and flicker-free rendering (example 17) quite nicely. The shortcoming of not seeing the plot updates until a flush becomes most noticeable when using the xcairo driver interactively, say from an interactive Octave, OCaml or Python session. This lack of interactive updates could be worked around with threading similar to the pthread use in the xwin driver. The xwin threading code is quite lengthy and complicated though, so this would likely be a fairly significant task. I have been using this patch locally for about 6 months. I find it makes the xcairo device much more useful for me. The speedup provided by the off-screen rendering allows me to use the xcairo and its improved rendering quality where I would have formerly used xwin due to its impressive speed. All that said, I would like to ask for comments from others on this patch before applying it to PLplot. I had asked a few other developers for comments on a similar patch several months ago, with the main concerns voiced at the time centering around the lack of visible updates as a plot is made unless plflush is called or the plot page ends. This is a significant visible change to how the xcairo device works. I intended to bring the discussion of this on-list at that time, but clearly this was delayed by a few months! Hez -- Hezekiah M. Carty Graduate Research Assistant University of Maryland Department of Atmospheric and Oceanic Science |