[Spice-devel] [PATCH 00/30] Convert cairo canvas to use pixman

Alexander Larsson alexl at redhat.com
Thu Feb 18 12:58:26 PST 2010


This series converts the software based canvas "cairo_canvas" to use
pixman for rendering instead of cairo. It uses the upstream pixman
(the latest version, 0.7.16 is needed) thus dropping the dependencies
on qcairo and qpixman (and additionally cairo is not linked into the
server at all).

After the whole series is applied its possible to build spice with
upstream cairo and pixman 0.7.16. However, if you want to compile and
run intermediate steps (for instance when bisecting) you need to do
some extra work:

Apply this patch to pixman 0.7.16:
http://people.gnome.org/~alexl/pixman-rops.patch

Apply this patch to qcairo to use the patchef pixman from above
instead of qpixman:
http://people.gnome.org/~alexl/qcairo-noqpixman.patch

There are a few features missing from this implementation:

* Wide paths are not supported (including joins and caps)
This is not a problem because no driver generates them atm

* Clip paths (i.e. not rect-lists) are not supported
The win32 driver can theoretically produce these, but i've never
seen it do so. We should remove that from the win32 driver.

* Bezier paths are not yet working
This just needs some work to subdivide them, but i'm not sure we
actually want to send beziers. It would probably be better to
subdivide them in the driver so that we get the same subdivision
as GDI does, if some paths use software fallback and some not.

In addition to the pixman facilities (compositing, regions, blending,
scaling, etc) this code adds a bunch of helpers for doing raster
operations (ROPs), tiling, etc.

Also, the line drawing is done using the X11 (mi) line rasterizer
which has been imported and converted for our use.

Alexander Larsson (30):
  Fix delete vs delete[] mismatches
  Add pixman utilities
  Add line rasterizer
  Add emacs settings for indent according to spice styleguide
  Add pixman_image_t referencing the cairo_canvas bits
  Add optional templated base class to Cache and SharedCache
  Turn image and palette cache into c style dynamic interface
  Use pixman_image_t instead of cairo_surface_t as the generic pixman
    container
  Add possibility to not invert bitmask in canvas_get_mask()
  Convert cairo canvas draw_fill() to using pixman
  Convert cairo canvas draw_opaque() to using pixman
  Convert cairo canvas draw_blend() to using pixman
  Convert cairo canvas draw_copy() to using pixman
  Convert cairo canvas copy bits to pixman
  Convert cairo canvas draw_text to using pixman
  Convert cairo canvas alpha_blend to using pixman
  Convert draw_blackness/whiteness/invers to using pixman
  Convert cairo canvas draw_rop3 to using pixman
  Convert cairo canvas draw_transparent to use pixman
  Convert cairo canvas to use pixman for draw_stroke
  Remove unused cairo helper functions
  Convert cairo canvas read_bits() to pixman
  Convert cairo canvas group_start/end to pixman
  Convert cairo canvas clear() to pixman
  Replace custom region implementation with pixman_region32_t
  Covert cairo canvas put_image() to pixman
  Remove cairo_t from cairo canvas
  Remove last cairo use from canvas_base
  Remove no longer needed CAIRO_CANVAS_CACH_IS_SHARED define and code
  Require cairo instead of qcairo, only use pixman in server

 client/Makefile.am              |    2 +
 client/application.cpp          |   28 +-
 client/cache.hpp                |    4 +-
 client/canvas.cpp               |   30 -
 client/canvas.h                 |  101 +-
 client/cursor_channel.cpp       |   14 +-
 client/glz_decoder_window.cpp   |    4 +-
 client/gui/gui.cpp              |   26 +-
 client/lines.cpp                |   24 +
 client/pixman_utils.cpp         |   25 +
 client/red_cairo_canvas.cpp     |   43 +-
 client/red_gdi_canvas.cpp       |    6 +-
 client/red_gl_canvas.cpp        |   25 +-
 client/screen.cpp               |   50 +-
 client/screen_layer.cpp         |   21 +-
 client/shared_cache.hpp         |    4 +-
 client/utils.h                  |    3 +
 client/windows/redc.vcproj      |    4 +-
 client/x11/Makefile.am          |    7 +-
 client/x11/red_pixmap_cairo.cpp |    2 +-
 client/x11/red_window.cpp       |    5 +-
 common/Makefile.am              |    4 +
 common/cairo_canvas.c           | 2878 ++++++++++++++++++--------------
 common/cairo_canvas.h           |   21 +-
 common/canvas_base.c            |  381 ++---
 common/canvas_base.h            |   39 +-
 common/canvas_utils.c           |  151 +-
 common/canvas_utils.h           |   30 +-
 common/gdi_canvas.c             |  180 +-
 common/gdi_canvas.h             |    8 +-
 common/gl_canvas.c              |  234 ++--
 common/gl_canvas.h              |   15 +-
 common/lines.c                  | 3632 +++++++++++++++++++++++++++++++++++++++
 common/lines.h                  |  128 ++
 common/pixman_utils.c           | 1286 ++++++++++++++
 common/pixman_utils.h           |  112 ++
 common/region.c                 |  942 ++---------
 common/region.h                 |   20 +-
 common/rop3.c                   |   56 +-
 common/rop3.h                   |    8 +-
 configure.ac                    |   17 +-
 server/Makefile.am              |    6 +-
 server/red_worker.c             |  104 +-
 43 files changed, 7836 insertions(+), 2844 deletions(-)
 create mode 100644 client/lines.cpp
 create mode 100644 client/pixman_utils.cpp
 create mode 100644 common/lines.c
 create mode 100644 common/lines.h
 create mode 100644 common/pixman_utils.c
 create mode 100644 common/pixman_utils.h



More information about the Spice-devel mailing list