Apache OpenOffice (AOO) Bugzilla – Issue 69066
initial OOo CairoCanvas port to Mac OS X/Quartz
Last modified: 2008-08-05 13:13:28 UTC
Since cairo -library supports already native Mac OS X (Quartz), and the canvas -module in OOo has a cairo backend working with X11, the only thing left is to port that cairo backend to Mac OS X. This allows us to use cairo as the canvas implementation, instead of the VCL. I have already begun the porting work. Although the patch I'm sending does compile (more or less), it will not run properly. Help needed.
Created attachment 38833 [details] Patch against cws aquavcl01, although it probably applies cleanly to m181
Pavel, Radek: I would appreciate comments/thoughts on the patch. It's very broken, I know, but I am a bit lost in what should the (cairo)canvas functions actually do. Is there documentation about it? I'm also thinking that maybe the platform specific stuff, would be better to divide into separate files, specifically: cairo_cairo.cxx -> cairo_quartz.cxx & cairo_xlib.cxx and cairo_helper.cxx -> cairo_helper_quartz.cxx & cairo_helper_xlib.cxx But that's later in the agenda, first the implementation needs fixing...
Hi mox, unfortunately my knowledge of cairo is *very limited* so i probably can't help here.
Hello, great to see cairo canvas ported to other system. Thumbs up :) I looked at the patch and it looks you are going the right way. Few things I noticed: * glitz based surfaces - we don't use them these days, so IIWY I would not bother with them * Surface::getSimilar: the part where we create surface from new drawable, for start you can use cairo_surface_create_similar. You might need to comment out the parts which use drawable on few more places I guess. With cairo_surface_create_similar you might be able to make it work without text rendering. The idea here is that we use vcl for text drawing, vcl (in unix/x11 case) uses drawable for virtual device, which is used for text drawing. On x11 it works so that in cairo canvas we create the drawable, and then ask vcl to create virtual device from it and also cairo to create surface from it. That way we can draw everything but text on cairo surface and text on vcl's virtual device. Both using the same drawable. I think that's all I spotted in your patch. Let me know if you need more help in other areas. Radek
Issue reassigned to Mox
Created attachment 40251 [details] Work-in-progress patch - port of cairocanvas to quartz
The patch above is the latest version of the effort to port the cairocanvas to Mac OS X / Quartz. It also includes the changes in issue 70519 (the windows port of cairocanvas), because it is easier to see what changes are necessary, and to understand the code. radek/others: could you go through the function comments that I've added in the patch and check if they are correct? I have serious difficulties in understanding how to port to Quartz the code that creates a surface based on SystemEnvData. In Mac OS X, it is not possible to get a Graphics Context (GCContextRef) from a Window (WindowRef), but UNX and WNT do this. This patch also requires changes to Mac OS X specific headers in vcl/inc/. Attaching a work-in-progress -patch of those changes as well.
Created attachment 40252 [details] The related work-in-progress patch for changes in vcl headers
Created attachment 40297 [details] Work-in-progress patch - port of cairocanvas to quartz, version 5
The latest patch includes proper code to get CGContext from WindowRef. Thanks to Pavel Janik for the pointer to Apple's mailing lists! The patch is somewhat feature complete, but completely untested. Radek/others: Once I get the stuff to compile, how can I test the canvas? The Mac OS X Aqua port may not be complete enough to test canvas in a full office application... Is there a test app that just uses canvas?
There is canvas/workben/canvasdemo.cxx which might help a bit. It was broken some time ago and Thorsten fixed it recently, I am not sure wheter his cws with the fix was already merged though.
Created attachment 41971 [details] configure.in patch to enable building cairo on Mac OS X
Created attachment 41972 [details] The cairo canvas patch ready for integration in cws aquavcl01
.
A new, slimmed down version has been committed to cws cairoquartz01. It has been succesfully compiled with cws aquavcl01 (native Mac OS X). You'll need cairo libs and setting cairo=yes in config_office/configure Running the cairocanvas (e.g. in Impress fullscreen) has still bugs/crashes, but it works somewhat at least.
This needs aligning with following issues: - prebuilt cairo - win32 cairo implementation - cws presfixes12 - cross-platform cairo canvas rework (have legacy support for old (< 1.2) cairo versions on X11)
I plan to do/help out with consolidation once CWS presfixes12 is integrated. @tml: what about binning CWS wincairo, and finish all cairocanvas-related stuff in one place?
Binning CWS wincairo is fine with me.
@tml: ok, further cairo work then in CWS cairoquartz01
code complete version of Cairo canvas's Quartz backend exists in the CWS. Remaining bugs will be handled as separate issues. Marking this fixed.
Removing aqua keyword. This issue has nothing todo with current aqua port.
@ericb2: oh yes, it does. this is about the carbon cairo backend. Added back aqua keyword
The VCL part of Mac OS X port has been heart-transplanted recently (Carbon -> Cocoa) and as a fallout of that, the changes in cws macosxquicktime01 need to be integrated, before cairo canvas works on Mac OS X. So integration of cws cairoquartz01 will happen after cws macosxquicktime01, but naturally cairoquartz01 is being updated in parallel. Re-opening for updates.
should be able to get the initial port into 3.0...
Initial cairo quartz backend is now done. Works for images and drawings, but text is not shown for unknown reason. Need to get this integrated now, before other large canvas module changes disrupt things again. cairo quartz is not enabled by default. Marking fixed.
Reassigning for QA
Verified.
rbircher -> thb This issue can be closed? Set myself to cc
Closing. cws cairoquartz01 has been integrated since DEV300_m6