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:
Carl Worth 2007-04-11 01:35:11 -07:00
parent bd0b328f7e
commit 01ac5f1aea
2 changed files with 7 additions and 2 deletions

View file

@ -983,7 +983,9 @@ _cairo_pdf_surface_emit_surface_pattern (cairo_pdf_surface_t *surface,
* pattern cell.
*/
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_translate (&pdf_p2d, 0.0, surface_extents.height);

View file

@ -1726,11 +1726,14 @@ static void
_cairo_ps_surface_emit_surface_pattern (cairo_ps_surface_t *surface,
cairo_surface_pattern_t *pattern)
{
cairo_status_t status;
double bbox_width, bbox_height;
double xstep, ystep;
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)) {
_cairo_output_stream_printf (surface->stream, "/MyPattern {\n");