Issue 69066 - initial OOo CairoCanvas port to Mac OS X/Quartz
Summary: initial OOo CairoCanvas port to Mac OS X/Quartz
Status: CLOSED FIXED
Alias: None
Product: porting
Classification: Code
Component: MacOSX (show other issues)
Version: OOo 2.2
Hardware: Mac Mac OS X, all
: P3 Trivial (vote)
Target Milestone: OOo 3.0
Assignee: thb
QA Contact: issues@porting
URL:
Keywords: aqua
Depends on: 70519 74170
Blocks:
  Show dependency tree
 
Reported: 2006-08-29 16:10 UTC by moxfox
Modified: 2008-08-05 13:13 UTC (History)
7 users (show)

See Also:
Issue Type: ENHANCEMENT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Patch against cws aquavcl01, although it probably applies cleanly to m181 (16.87 KB, patch)
2006-08-29 16:12 UTC, moxfox
no flags Details | Diff
Work-in-progress patch - port of cairocanvas to quartz (25.56 KB, patch)
2006-11-02 12:43 UTC, moxfox
no flags Details | Diff
The related work-in-progress patch for changes in vcl headers (2.29 KB, patch)
2006-11-02 13:19 UTC, moxfox
no flags Details | Diff
Work-in-progress patch - port of cairocanvas to quartz, version 5 (25.34 KB, patch)
2006-11-03 14:32 UTC, moxfox
no flags Details | Diff
configure.in patch to enable building cairo on Mac OS X (284 bytes, patch)
2007-01-07 14:47 UTC, moxfox
no flags Details | Diff
The cairo canvas patch ready for integration in cws aquavcl01 (24.53 KB, patch)
2007-01-07 15:00 UTC, moxfox
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description moxfox 2006-08-29 16:10:21 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.
Comment 1 moxfox 2006-08-29 16:12:19 UTC
Created attachment 38833 [details]
Patch against cws aquavcl01, although it probably applies cleanly to m181
Comment 2 moxfox 2006-08-29 16:21:08 UTC
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...
Comment 3 pavel 2006-08-30 20:29:41 UTC
Hi mox,

unfortunately my knowledge of cairo is *very limited* so i probably can't help here.
Comment 4 radekdoulik 2006-08-31 13:52:11 UTC
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
Comment 5 eric.bachard 2006-10-14 13:06:39 UTC
Issue reassigned to Mox
Comment 6 moxfox 2006-11-02 12:43:15 UTC
Created attachment 40251 [details]
Work-in-progress patch - port of cairocanvas to quartz
Comment 7 moxfox 2006-11-02 12:50:40 UTC
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.
Comment 8 moxfox 2006-11-02 13:19:36 UTC
Created attachment 40252 [details]
The related work-in-progress patch for changes in vcl headers
Comment 9 moxfox 2006-11-03 14:32:36 UTC
Created attachment 40297 [details]
Work-in-progress patch - port of cairocanvas to quartz, version 5
Comment 10 moxfox 2006-11-03 14:36:13 UTC
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?
Comment 11 radekdoulik 2006-11-03 16:50:57 UTC
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.
Comment 12 moxfox 2007-01-07 14:47:50 UTC
Created attachment 41971 [details]
configure.in patch to enable building cairo on Mac OS X
Comment 13 moxfox 2007-01-07 15:00:59 UTC
Created attachment 41972 [details]
The cairo canvas patch ready for integration in cws aquavcl01
Comment 14 thb 2007-01-09 02:26:44 UTC
.
Comment 15 moxfox 2007-01-28 13:40:18 UTC
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.
Comment 16 moxfox 2007-05-24 21:28:32 UTC
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)
Comment 17 thb 2007-05-25 09:35:54 UTC
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?
Comment 18 tml 2007-05-26 04:20:01 UTC
Binning CWS wincairo is fine with me.
Comment 19 thb 2007-05-29 09:11:30 UTC
@tml: ok, further cairo work then in CWS cairoquartz01
Comment 20 moxfox 2007-06-20 16:21:19 UTC
code complete version of Cairo canvas's Quartz backend exists in the CWS. Remaining bugs will be 
handled as separate issues. Marking this fixed.
Comment 21 eric.bachard 2007-06-24 15:34:40 UTC
Removing aqua keyword.

This issue has nothing todo with current aqua port.
Comment 22 thb 2007-06-25 08:44:47 UTC
@ericb2: oh yes, it does. this is about the carbon cairo backend.

Added back aqua keyword
Comment 23 moxfox 2007-10-20 11:14:51 UTC
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.
Comment 24 moxfox 2007-10-20 11:15:28 UTC
.
Comment 25 moxfox 2008-03-08 17:13:41 UTC
should be able to get the initial port into 3.0...
Comment 26 moxfox 2008-03-10 22:56:17 UTC
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.
Comment 27 thb 2008-03-27 22:59:40 UTC
Reassigning for QA
Comment 28 thb 2008-03-27 23:05:29 UTC
Verified.
Comment 29 Raphael Bircher 2008-08-05 10:47:53 UTC
rbircher -> thb

This issue can be closed?

Set myself to cc
Comment 30 moxfox 2008-08-05 13:13:28 UTC
Closing. cws cairoquartz01 has been integrated since DEV300_m6