cairo/meson.options
Alberto Ruiz 543c14a8b1 Add GBM surface backend for zero-copy GPU buffer sharing
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
2026-03-23 23:00:26 +00:00

31 lines
1.2 KiB
Text

# Cairo font backends
option('dwrite', type : 'feature', value : 'auto')
option('fontconfig', type : 'feature', value : 'auto')
option('freetype', type : 'feature', value : 'auto')
# Cairo surface backends
option('gbm', type : 'feature', value : 'auto')
option('png', type : 'feature', value : 'auto') # png and svg surfaces
option('quartz', type : 'feature', value : 'auto')
option('tee', type : 'feature', value : 'auto')
option('xcb', type : 'feature', value : 'auto')
option('xlib', type : 'feature', value : 'auto')
option('xlib-xcb', type : 'feature', value : 'disabled')
option('zlib', type : 'feature', value : 'auto') # script, ps, pdf, xml surfaces
# Tests
option('tests', type : 'feature', value : 'auto')
# Util deps
option('lzo', type : 'feature', value : 'auto')
option('gtk2-utils', type : 'feature', value : 'disabled')
# Misc deps
option('glib', type : 'feature', value : 'auto')
option('spectre', type : 'feature', value : 'auto')
option('symbol-lookup', type: 'feature', value : 'auto',
description: 'Symbol lookup in debug utils via binutils/bfd')
# Documentation
option('gtk_doc', type : 'boolean', value : false,
description: 'Build the Cairo API reference (depends on gtk-doc)')