After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 329860 - Make Cairo renderer an interactive renderer
Make Cairo renderer an interactive renderer
Status: RESOLVED FIXED
Product: dia
Classification: Other
Component: general
CVS head
Other Linux
: Normal enhancement
: 0.97
Assigned To: Dia maintainers
Dia maintainers
Depends on:
Blocks:
 
 
Reported: 2006-02-04 06:04 UTC by Nguyen Thai Ngoc Duy
Modified: 2007-10-06 20:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
diacairorenderer patch (76.84 KB, patch)
2006-02-04 06:04 UTC, Nguyen Thai Ngoc Duy
needs-work Details | Review
new dia cairo renderer patch (28.10 KB, patch)
2006-02-04 15:03 UTC, Nguyen Thai Ngoc Duy
none Details | Review
diacairorenderer patch (29.53 KB, patch)
2006-02-04 15:52 UTC, Nguyen Thai Ngoc Duy
committed Details | Review

Description Nguyen Thai Ngoc Duy 2006-02-04 06:04:13 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 :)
Comment 1 Nguyen Thai Ngoc Duy 2006-02-04 06:04:50 UTC
Created attachment 58692 [details] [review]
diacairorenderer patch
Comment 2 Hans Breuer 2006-02-04 13:01:14 UTC
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.
Comment 3 Nguyen Thai Ngoc Duy 2006-02-04 15:03:31 UTC
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.
Comment 4 Nguyen Thai Ngoc Duy 2006-02-04 15:52:32 UTC
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)
Comment 5 Hans Breuer 2007-10-06 20:42:01 UTC
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