DirectFB 2.0: Cairo Support

From DirectFB

Jump to: navigation, search

Contents

Cairo and DirectFB 2.0

Intrinsic support for Cairo the new opensource 2D graphics library is a major goal of DirectFB2.0. The implementation of Water will use Cairo for the high level api and Cairo itself will be implemented using the same core rendering as the low level Water api.

A obvious question is why Water when you have Cairo ?

First cairo provides a high level rendering api and hides the low level rasterazation with water one of the goals is to make this form public via WaterBasicElement. These are opposite design decisions. Next water is focused on supporting retained mode drawing not immediate mode as with cairo. However with these differences Waters high level elements can be implemented on top of cairo and cairo's tesselator can be used to generate the WaterBasicElement. So you can see that Water and Cairo will be taking advantage of each other's api in a synergistic way.

WaterBasicElement and Cairo

The first implementatation of WaterBasicElement WaterBasicElement will focus on the parts needed to implement cairos backend interface.

This is defined in Cairo's _cairo_surface_backend_t structure which can be found in the cairo source code. In particular this means support for composite_trapezoids which is mapped to WBE_TRAPEZOID. The next important support issue is integration of surface locking for direct access with our surface pool implementation .

A bazillion Pixel Formats and Cairo

One of the big differences between the cairo implementation for DirectFB 1.0 and DirectFB 2.0 is that providing all the operations that directly address pixels for cairo we will be able to use the cairo api for all pixel formats supported by DirectFB notably YUV formats.

To accomplish this means that the rendering backed for cairo cannot fallback to libpixman . This means implementing the cairo backend api completely. However we probably will also look into allowing cairo to fallback to libpixman and simply add hooks at this level to use DirectFB blitting capabilities instead of the limited pixel format support built into libpixman. Libpixman is external in the latest cairo releases and we will work with the Cairo developers on the best way to make Cairo agnostic to pixel formats. This should result in Cairo supporting pluggable pixel manipulation libraries this is of interest outside of DirectFB.


Pluggable Tessellator

As DirectFB 2.0 evolves over time we are also interested in pluggable tessellator for both cairo and water. A new accelerated rendering core

Personal tools