cairo: Fix crashes and bugs in 'setup' call.
authorBen Pfaff <blp@cs.stanford.edu>
Fri, 10 Feb 2023 17:25:43 +0000 (09:25 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Fri, 10 Feb 2023 18:57:12 +0000 (10:57 -0800)
commitfb26a85be7049ef91c47dcd58e42c76cf88d8003
tree70c8c9bbdb57c287c8b8dbe7e2fefdf1ef381593
parent29b393e13c61b9e7925493166d0f6b8cf0d30045
cairo: Fix crashes and bugs in 'setup' call.

Changing the page_setup was not properly supported for PNG and SVG output,
because it assert-failed in xr_set_surface_size().  In addition, for all
kinds of output, it didn't account for margins properly in the page size.
This fixes the problem and unifies page setup between initial driver
creation and update.

This wasn't noticed before because output_set_page_setup() wasn't used
much, but it could be triggered with the pspp-output utility, converting
from an SPV file that contained a page_setup.  It will become more
important because an upcoming commit will cause the SPV driver to output
a page_setup every time.
src/output/cairo.c