GNOME Bugzilla – Bug 329860
Make Cairo renderer an interactive renderer
Last modified: 2007-10-06 20:42:01 UTC
This patch move DiaCairoRenderer from cairo plugin to lib/diacairorenderer.[ch], making it another anti-alias renderer in addition to libart renderer. Most of DiaCairoRenderer is the same as the original one in the plugin except three things: 1. blackground cleaning code in begin_render was removed (I added another code in cairo plugin). 2. A workaround is added to set_linewidth to treat "linewidth 0" case (used by bezier_conn.c) 3. zoom, with_alpha, dia were removed from struct _DiaCairoRenderer DiaInteractiveRendererInterface code was borrowed from render_gdk.c If cairo is built, then cairo renderer will be chosen for anti-alias mode instead of libart renderer. This way i think we can improve pdf/ps export plugin easier and perhaps make it the default anti-alias renderer sometime in future. So far i've had some problems with arc and ellipse tools, it either not render correctly (ellipse's width too small) or not render at all (arc sometimes). Of course please not consider this patch till you get 0.95 out :)
Created attachment 58692 [details] [review] diacairorenderer patch
Comment on attachment 58692 [details] [review] diacairorenderer patch Rather than moving more renderers into the core I'd like to extend the plug-in interface to allow interactive renderers outside. Before cairo can be the new main renderer quite some things need to happen: - proper cross platform support of PS/PDF in cairo - remove PNG/libart renderer from the core - remove PS renderer from the core - depend on gtk>=2.8 (will not happen too soon to allow for e.g dia-hildon, which only has gtk+-2.6 available atm) - general performance boost of cairo - use pango/cairo to render text - ... For most of the issues separate bugs should be opened. But making the cairo renderer provide the DiaInteractiveRenderer interface should certainly be possible as plug-in. Thus giving us the benefit of manageable patch size.
Created attachment 58703 [details] [review] new dia cairo renderer patch Thanks for the hint, i merged all files in diacairo.c again. The patch size reduced a lot. Now only four files in /app are touched: display.c, renderer_libart.[ch] and menus.c. I don't know how to make a DiaInteractiveRenderer interface properly from a plug-in. My approach is a bit dirty.
Created attachment 58704 [details] [review] diacairorenderer patch Updated the patch to catch more #ifdef HAVE_LIBART that should be #if defined(HAVE_LIBART )|| defined(HAVE_CAIRO)
sorry for the long delay, I've now applied something based on your work. 2007-10-06 Hans Breuer <hans@breuer.org> * plug-ins/cairo/diacairo-interactive.c : based on a patch from Nguyen Thai Ngoc Duy (bug #329860) there is an interactive renderer based on cairo now. After some work in the cairo renderer base class (pango_cairo, hairlines, ...) this should finally allow us to get rid of the libart depedency * plug-ins/cairo/diacairo.c app/display.c : HACK to select the DiaCairoInteractiveRenderer for antialiased rendering. If the points mentioned above are not fixed for the next release it should be disabled again in app/display.c(new_aa_renderer) * plug-ins/cairo/diacairo-print.c : almost empty, should become the place for GtkPrint/Cairo based printing. * plug-ins/cairo/Makefile.am plug-ins/makefile.msc : adapted