mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-09 07:18:04 +02:00
Assert that cairo_matrix_invert succeeds rather than ignoring tis return value
This assertion is safe as an internal consistency check thanks to the recent checks added to cairo_pattern_set_matrix.
This commit is contained in:
parent
bd0b328f7e
commit
01ac5f1aea
2 changed files with 7 additions and 2 deletions
|
|
@ -983,7 +983,9 @@ _cairo_pdf_surface_emit_surface_pattern (cairo_pdf_surface_t *surface,
|
||||||
* pattern cell.
|
* pattern cell.
|
||||||
*/
|
*/
|
||||||
cairo_p2d = pattern->base.matrix;
|
cairo_p2d = pattern->base.matrix;
|
||||||
cairo_matrix_invert (&cairo_p2d);
|
status = cairo_matrix_invert (&cairo_p2d);
|
||||||
|
/* cairo_pattern_set_matrix ensures the matrix is invertible */
|
||||||
|
assert (status == CAIRO_STATUS_SUCCESS);
|
||||||
|
|
||||||
cairo_matrix_init_identity (&pdf_p2d);
|
cairo_matrix_init_identity (&pdf_p2d);
|
||||||
cairo_matrix_translate (&pdf_p2d, 0.0, surface_extents.height);
|
cairo_matrix_translate (&pdf_p2d, 0.0, surface_extents.height);
|
||||||
|
|
|
||||||
|
|
@ -1726,11 +1726,14 @@ static void
|
||||||
_cairo_ps_surface_emit_surface_pattern (cairo_ps_surface_t *surface,
|
_cairo_ps_surface_emit_surface_pattern (cairo_ps_surface_t *surface,
|
||||||
cairo_surface_pattern_t *pattern)
|
cairo_surface_pattern_t *pattern)
|
||||||
{
|
{
|
||||||
|
cairo_status_t status;
|
||||||
double bbox_width, bbox_height;
|
double bbox_width, bbox_height;
|
||||||
double xstep, ystep;
|
double xstep, ystep;
|
||||||
cairo_matrix_t inverse = pattern->base.matrix;
|
cairo_matrix_t inverse = pattern->base.matrix;
|
||||||
|
|
||||||
cairo_matrix_invert (&inverse);
|
status = cairo_matrix_invert (&inverse);
|
||||||
|
/* cairo_pattern_set_matrix ensures the matrix is invertible */
|
||||||
|
assert (status == CAIRO_STATUS_SUCCESS);
|
||||||
|
|
||||||
if (_cairo_surface_is_meta (pattern->surface)) {
|
if (_cairo_surface_is_meta (pattern->surface)) {
|
||||||
_cairo_output_stream_printf (surface->stream, "/MyPattern {\n");
|
_cairo_output_stream_printf (surface->stream, "/MyPattern {\n");
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue