Difference between revisions of "Mac OS X Porting - Canvas"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Tasks)
(Status)
Line 63: Line 63:
  
 
As of Apr 2008, the Quartz cairo canvas for OOo Mac OS X is implemented, but not fully working. All the text is not visible, although actual rendering works ok. There's also a crash when closing down Canvas.
 
As of Apr 2008, the Quartz cairo canvas for OOo Mac OS X is implemented, but not fully working. All the text is not visible, although actual rendering works ok. There's also a crash when closing down Canvas.
 +
 +
DONE
 +
* Cairo canvas code documentation added
 +
* Quartz backend added to Cairo Canvas
  
  

Revision as of 17:39, 22 April 2008

Contributors

  • Mox Soini: Mox

Introduction

The current rendering framework in OpenOffice.org (OOo) is VCL. It is very Windows-oriented API that is hard to port to other platforms. Despite this, there are several ports available, including Unix/X11, Windows and Native Mac OS X port using Cocoa.

The future rendering framework in OpenOffice.org (OOo) is UNO XCanvas rendering framework. The benefits include a well designed API (easier to port, easier to use) and a more strong isolation of the API from the rest of the OOo (One of the big problems of the current VCL is that also the internals of the VCL are used from many places in the OOo code).

Currently the XCanvas implementation has been jump-started by directing text rendering back to VCL.

XCanvas is part of bigger module in OpenOffice, called Drawing Layer. There is initiative to improve the whole module: Drawing Layer/Drawing Primitives

For XCanvas information, see presentations at OOoCon 2006 (PDF, ODP, video/ogg) and OOoCon 2005 (PDF)

Of the OOo applications using VCL, currently (September 2006) OOo Impress slideshow has been converted to XCanvas, with prototypes working in Draw and Impress. Future work will include converting Calc and Writer.


NOTE: this work does not address the problem with native widgets and UI layout, only rendering. The UI Layout is discussed in UI Layout and details are in VCL UI Rework.

Roadmap for Canvas in Mac OS X

Short term: use the VCL implementation of XCanvas.

Long term: create a native implementation of XCanvas. There are two alternative ways to complete this:

  1. Create complete, non-VCL, canvas implementation in OOo (like the Windows implementation, not worked on in Mac OS X)
  2. Create implementation based on Cairo -library (like the Linux implementation, this is the currently chosen alternative for Mac OS X)

The benefits of cairo-based implementation include:

  • Less code in OOo, more shared code with other open source programs
  • Cairo has been already ported to Mac OS X, no need to duplicate that effort for OOo only.
  • Mozilla is using this approach (in Gecko 1.9 / Firefox 3.0) for all of their platforms (The Thebes API, which is a light C++ API on top of Cairo API in C)
  • GTK/Gnome is using this approach for all of their platforms (The new Canvas-widget & rendering, based on Cairo)

Tasks

The main task currently, is to understand and document the various APIs and how they interact with each other. The pieces are there (XCanvas, Cairo, Quartz 2D, Cocoa etc.), but more details are needed to understand how they fit together.

TODO:

  • cairo implementation of XCanvas (in OOo) lacks function documentation
  • quartz implementation of cairo (in Cairo) lacks function documentation (look at other implementations)
  • Create visual explanations of the API structure
  • port the code, in issue 69066. Work started.

PERFORMANCE:

  • OpenOffice.org VCL uses a lot of XOR-based (win32-like, bitmap-oriented) graphics functions. Mac OS X does not have this concept and uses compositing, canvas and layers instead. To get good performance of OOo on Mac OS X, OOo needs to be gotten rid of heavy use of XOR functions
  • 32-bit -images: OOo internally uses non-32bit images, whereas Cocoa/Carbon require 32-bit images for native graphics operations. OOo should be converted to use 32-bit images internally.

DOCS:

Links

Status

As of Apr 2008, the Quartz cairo canvas for OOo Mac OS X is implemented, but not fully working. All the text is not visible, although actual rendering works ok. There's also a crash when closing down Canvas.

DONE

  • Cairo canvas code documentation added
  • Quartz backend added to Cairo Canvas
Personal tools