Cairo 1.14 Device Scaling: Unclear Flush Semantics on Recording Surfaces
0 reputation · 27 May 2023, 01:54 UTC
Goal
Investigate the effect of calling cairo_surface_flush() on a recording surface after setting a device scale with cairo_surface_set_device_scale(), a scenario not fully defined in Cairo 1.14.
Context
Device scaling was introduced in Cairo 1.14 to map a surface’s logical dimensions to a physical pixel density. The API notes that cairo_surface_flush() is a no‑op for surfaces without an associated device, such as recording surfaces. However, the interaction between this no‑op semantics and the device‑scale setting is not documented, raising uncertainty about rendering consistency in high‑density environments.
Unresolved Questions
- When a recording surface has a non‑identity device scale, does
cairo_surface_flush()still perform any internal state updates, or is it truly a no‑op? - Can the presence of a device scale alter the final pixel data of a recording surface after a flush, even if the flush itself is a no‑op?
- Should applications rely on flush behavior for device‑scaled recording surfaces, or should they treat flush as a no‑op regardless of scale?