mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-29 19:38:17 +02:00
Add a new surface backend that allocates pixel buffers through GBM (Generic Buffer Manager), allowing Cairo-rendered content to be imported directly by GPU compositors via DMA-BUF file descriptors without an intermediate memory copy. The backend renders on the CPU via pixman (like the image backend) but allocates its buffer through GBM with a linear modifier, making it suitable for zero-copy handoff to GPU-based compositors such as Mutter/Clutter (GNOME) or GSK (GTK 4). New public API (cairo-gbm.h): - cairo_gbm_surface_create() — allocate a new GBM-backed surface - cairo_gbm_surface_create_for_bo() — wrap an existing gbm_bo - cairo_gbm_surface_get_bo() — retrieve the underlying gbm_bo - cairo_gbm_surface_get_dma_buf_fd() — export a DMA-BUF fd for the buffer Build integration: - New 'gbm' meson option (auto-detected via libgbm + libdrm) - CAIRO_HAS_GBM_SURFACE feature flag Test coverage: - Dedicated API + error-path tests (test/gbm-surface.c) - Surface-as-source pattern test (test/gbm-surface-source.c) - GBM boilerplate target for the full test suite - Entries in api-special-cases.c and error-setters.c |
||
|---|---|---|
| .. | ||
| .gitignore | ||
| cairo-boilerplate-gbm.c | ||
| cairo-boilerplate-getopt.c | ||
| cairo-boilerplate-getopt.h | ||
| cairo-boilerplate-pdf.c | ||
| cairo-boilerplate-private.h | ||
| cairo-boilerplate-ps.c | ||
| cairo-boilerplate-quartz.c | ||
| cairo-boilerplate-scaled-font.h | ||
| cairo-boilerplate-script.c | ||
| cairo-boilerplate-svg.c | ||
| cairo-boilerplate-system.c | ||
| cairo-boilerplate-system.h | ||
| cairo-boilerplate-test-surfaces.c | ||
| cairo-boilerplate-win32-printing.c | ||
| cairo-boilerplate-win32.c | ||
| cairo-boilerplate-xcb.c | ||
| cairo-boilerplate-xlib.c | ||
| cairo-boilerplate-xlib.h | ||
| cairo-boilerplate.c | ||
| cairo-boilerplate.h | ||
| make-cairo-boilerplate-constructors.py | ||
| meson.build | ||
| README | ||
This directory provides code that is common to both of cairo's tests suites: * The test suite for correctness in test/ * The test suite for performance in perf/ We call it boilerplate as it consists primarily of the boilerplate code necessary for initializing a backend in order to create a surface for that backend. The code here just might be useful for someone looking to get started writing cairo code to use a particular backend, (but there are no promises that the boilerplate code found here for any particular backend is exemplary).