Effect of cairo_surface_set_device_scale on already rendered content
0 reputation · 20 Oct 2023, 00:43 UTC
Goal
Determine how the Cairo function cairo_surface_set_device_scale behaves when invoked on a surface that has already received drawing commands, especially in low‑traffic rendering scenarios where DPI adjustments may be applied after initial rendering.
Unresolved behavior
Documentation states that the scale is applied to subsequent drawing operations, but it does not specify whether the pixel data of content already rendered to the surface is affected. This ambiguity matters when a surface is reused or when a low‑traffic application needs to change its device scale on the fly.
Questions
- When
cairo_surface_set_device_scaleis called after drawing, are the existing pixel values automatically rescaled or left unchanged? - Does the function require a
cairo_surface_flushor other operation to propagate the new scale to the surface buffer? - Are there backend‑specific differences in this behavior (e.g., X11, PDF, GPU‑accelerated surfaces) that affect low‑traffic workloads?