Roadmap Scratchpad:cairo

From MozillaWiki
Jump to: navigation, search

This page describes the work items required to convert our rendering to use the cairo graphics library, as wrapped by thebes.

Major dependencies

The graphics plan currently has a pair of large and poorly-understood dependencies related to Mac development. There is also a significant unknown regarding the extent to which we wish to support arbitrarily-transformed content.

Mac issues

If these issues are not resolved, we may still wish to go ahead with turning on cairo graphics by default for Windows and Linux, so as to get test coverage on common and Win/Lin code while waiting for Mac to catch up. We would like to avoid that, though, if at all possible, because it may delay the discovery of invasive architectural issues until quite late in the refinement process.

Quartz back end for cairo

We will need a developer to build a cairo back end for the Mac platform from scratch, using Quartz and ATSUI. We do not have a credible estimate of the time required for this to reach basic functionality or ship-ready completeness.

Cocoa widgets

Though it is possible to make cairo-based graphics work with a Carbon Mac widget layer, Cocoa widgets have already been identified as a needed item for Gecko 1.9, and we would greatly prefer to avoid writing Carbon widget code only to discard it before a beta anyway.

Transformed content

Two issues related to transformed content which may affect schedule materially, if we decide to support these cases fully:

  1. Transformation of windowless plugins
  2. Native-theme fidelity for transformed content

Work-unit sketch

There are two categories of items here: those required before the default rendering is switched to cairo/thebes (marked with "TO"), and those required before we can ship a beta build for wider consumption (marked with "19B").

The work items for cairo tend to be loosely interdependent, so the ordering of the two sets of items below does not necessarily indicate any strict constraints on the order of work. This should make it easier to incorporate additional, per-task contributions from developers other than Vlad and Pavlov (the owners of record for this work).

Required for default-on

  • Font selection:
    • Win: 2-3w
    • Lin: 1-2w
  • Thebes debug/polish: 1w
  • nsIDeviceContext -> widget: 1w
  • nsIPrint* -> widget: 2w
  • cairo maintenance/improvement:
    • Common: 1w
  • minimal SVG thebification: 1w
  • Printing
    • Common: 2-4w
  • Image perf:
    • Win: 1w
    • Lin: 1w
    • Common: 1w


  • Windows-specific: 3-4w
  • Linux-specific: 2-3w
  • Everything: 14-18w

Required for beta

  • Font API (textrun): 1-2w
  • XFT back-end (Lin): 1w
  • Thebes debug/polish: 2w
  • gfx removal and full thebification: 5w
  • cairo maintenance/improvement:
    • Win: 1w
    • Common: 1w
  • additional SVG thebification: 2w
  • Printing:
    • Win (GDI): 4w
  • Plugins:
    • Win: 1w
    • Lin: 1w
    • Common: 4w
  • imagelib API conversion: 2w
  • glitzification:
    • Win: 1w
    • Lin: 1w
    • Common: 2w
  • Text performance:
    • Win: 1w
    • Lin: 2w
    • Common: 1w
  • DirectX back end for cairo: 2w
  • removal of old gfx/full thebification: 5w


  • Windows-specific: 10w
  • Linux-specific: 5w
  • Everything: 40-42w