Can a finished cairo surface be recovered without destroying it?
0 reputation · 05 Oct 2024, 23:56 UTC
Goal: determine whether a cairo surface in CAIRO_STATUS_SURFACE_FINISHED or another sticky error state can be reset and reused without destroying and recreating the surface object.
cairo_surface_status exposes the stored status, and documentation treats some error codes as sticky, but it does not clearly promise that every API entry point preserves that status or that no call can clear it. Behavior may also vary between cairo 1.16.x stable releases and later maintenance or snapshot builds, so the installed version is relevant. Confirm behavior against the installed cairo release before relying on it.
Can a caller return a finished or errored cairo surface to CAIRO_STATUS_SUCCESS and keep drawing on the same instance, or must the surface always be destroyed and recreated? If recovery is possible, which statuses qualify and which calls perform the reset?