[PATCH] [cairo-surface] Use cairo_surface_status() instead of open-coding.
Chris Wilson
chris at chris-wilson.co.uk
Fri Feb 22 11:30:46 PST 2008
Use cairo_surface_status() in guards in preference over surface->status.
---
src/cairo-surface.c | 304 +++++++++++++++++++++++++++++++++------------------
1 files changed, 197 insertions(+), 107 deletions(-)
diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index 5f96d1a..ecbc66e 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -140,6 +140,9 @@ _cairo_surface_set_error (cairo_surface_t *surface,
cairo_surface_type_t
cairo_surface_get_type (cairo_surface_t *surface)
{
+ if (cairo_surface_status (surface))
+ return CAIRO_SURFACE_TYPE_IMAGE;
+
/* We don't use surface->backend->type here so that some of the
* special "wrapper" surfaces such as cairo_paginated_surface_t
* can override surface->type with the type of the "child"
@@ -163,6 +166,9 @@ slim_hidden_def (cairo_surface_get_type);
cairo_content_t
cairo_surface_get_content (cairo_surface_t *surface)
{
+ if (cairo_surface_status (surface))
+ return (cairo_content_t) 0;
+
return surface->content;
}
slim_hidden_def(cairo_surface_get_content);
@@ -182,6 +188,9 @@ slim_hidden_def(cairo_surface_get_content);
cairo_status_t
cairo_surface_status (cairo_surface_t *surface)
{
+ if (surface == NULL)
+ return CAIRO_STATUS_NULL_POINTER;
+
return surface->status;
}
slim_hidden_def (cairo_surface_status);
@@ -229,9 +238,11 @@ _cairo_surface_create_similar_scratch (cairo_surface_t *other,
{
cairo_surface_t *surface = NULL;
cairo_font_options_t options;
+ cairo_status_t status;
- if (other->status)
- return _cairo_surface_create_in_error (other->status);
+ status = cairo_surface_status (other);
+ if (status)
+ return _cairo_surface_create_in_error (status);
if (other->backend->create_similar) {
surface = other->backend->create_similar (other, content, width, height);
@@ -290,8 +301,11 @@ cairo_surface_create_similar (cairo_surface_t *other,
int width,
int height)
{
- if (other->status)
- return _cairo_surface_create_in_error (other->status);
+ cairo_status_t status;
+
+ status = cairo_surface_status (other);
+ if (status)
+ return _cairo_surface_create_in_error (status);
if (! CAIRO_CONTENT_VALID (content))
return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_CONTENT));
@@ -374,8 +388,10 @@ cairo_surface_t *
cairo_surface_reference (cairo_surface_t *surface)
{
if (surface == NULL ||
- CAIRO_REFERENCE_COUNT_IS_INVALID (&surface->ref_count))
+ CAIRO_REFERENCE_COUNT_IS_INVALID (&surface->ref_count))
+ {
return surface;
+ }
assert (CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&surface->ref_count));
@@ -397,8 +413,10 @@ void
cairo_surface_destroy (cairo_surface_t *surface)
{
if (surface == NULL ||
- CAIRO_REFERENCE_COUNT_IS_INVALID (&surface->ref_count))
+ CAIRO_REFERENCE_COUNT_IS_INVALID (&surface->ref_count))
+ {
return;
+ }
assert (CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&surface->ref_count));
@@ -425,8 +443,10 @@ cairo_status_t
_cairo_surface_reset (cairo_surface_t *surface)
{
if (surface == NULL ||
- CAIRO_REFERENCE_COUNT_IS_INVALID (&surface->ref_count))
+ CAIRO_REFERENCE_COUNT_IS_INVALID (&surface->ref_count))
+ {
return CAIRO_STATUS_SUCCESS;
+ }
assert (CAIRO_REFERENCE_COUNT_GET_VALUE (&surface->ref_count) == 1);
@@ -458,8 +478,10 @@ unsigned int
cairo_surface_get_reference_count (cairo_surface_t *surface)
{
if (surface == NULL ||
- CAIRO_REFERENCE_COUNT_IS_INVALID (&surface->ref_count))
+ CAIRO_REFERENCE_COUNT_IS_INVALID (&surface->ref_count))
+ {
return 0;
+ }
return CAIRO_REFERENCE_COUNT_GET_VALUE (&surface->ref_count);
}
@@ -503,7 +525,7 @@ cairo_surface_finish (cairo_surface_t *surface)
return;
}
- if (!surface->status && surface->backend->flush) {
+ if (surface->status == CAIRO_STATUS_SUCCESS && surface->backend->flush) {
status = surface->backend->flush (surface);
if (status) {
status = _cairo_surface_set_error (surface, status);
@@ -535,8 +557,7 @@ void *
cairo_surface_get_user_data (cairo_surface_t *surface,
const cairo_user_data_key_t *key)
{
- return _cairo_user_data_array_get_data (&surface->user_data,
- key);
+ return _cairo_user_data_array_get_data (&surface->user_data, key);
}
/**
@@ -591,7 +612,7 @@ _cairo_surface_set_font_options (cairo_surface_t *surface,
assert (! surface->is_snapshot);
- if (surface->status)
+ if (cairo_surface_status (surface))
return;
if (surface->finished) {
@@ -624,15 +645,18 @@ void
cairo_surface_get_font_options (cairo_surface_t *surface,
cairo_font_options_t *options)
{
+ if (cairo_surface_status (surface))
+ return;
+
if (cairo_font_options_status (options))
return;
- if (!surface->has_font_options) {
+ if (! surface->has_font_options) {
surface->has_font_options = TRUE;
_cairo_font_options_init_default (&surface->font_options);
- if (!surface->finished && surface->backend->get_font_options) {
+ if (! surface->finished && surface->backend->get_font_options) {
surface->backend->get_font_options (surface, &surface->font_options);
}
}
@@ -657,7 +681,7 @@ cairo_surface_flush (cairo_surface_t *surface)
{
cairo_status_t status;
- if (surface->status)
+ if (cairo_surface_status (surface))
return;
if (surface->finished) {
@@ -683,6 +707,9 @@ cairo_surface_flush (cairo_surface_t *surface)
void
cairo_surface_mark_dirty (cairo_surface_t *surface)
{
+ if (cairo_surface_status (surface))
+ return;
+
assert (! surface->is_snapshot);
cairo_surface_mark_dirty_rectangle (surface, 0, 0, -1, -1);
@@ -713,11 +740,11 @@ cairo_surface_mark_dirty_rectangle (cairo_surface_t *surface,
{
cairo_status_t status;
- assert (! surface->is_snapshot);
-
- if (surface->status)
+ if (cairo_surface_status (surface))
return;
+ assert (! surface->is_snapshot);
+
if (surface->finished) {
status = _cairo_surface_set_error (surface, CAIRO_STATUS_SURFACE_FINISHED);
return;
@@ -774,11 +801,11 @@ _cairo_surface_set_device_scale (cairo_surface_t *surface,
{
cairo_status_t status;
- assert (! surface->is_snapshot);
-
- if (surface->status)
+ if (cairo_surface_status (surface))
return;
+ assert (! surface->is_snapshot);
+
if (surface->finished) {
status = _cairo_surface_set_error (surface, CAIRO_STATUS_SURFACE_FINISHED);
return;
@@ -816,11 +843,11 @@ cairo_surface_set_device_offset (cairo_surface_t *surface,
{
cairo_status_t status;
- assert (! surface->is_snapshot);
-
- if (surface->status)
+ if (cairo_surface_status (surface))
return;
+ assert (! surface->is_snapshot);
+
if (surface->finished) {
status = _cairo_surface_set_error (surface, CAIRO_STATUS_SURFACE_FINISHED);
return;
@@ -850,6 +877,16 @@ cairo_surface_get_device_offset (cairo_surface_t *surface,
double *x_offset,
double *y_offset)
{
+ if (cairo_surface_status (surface)) {
+ if (x_offset)
+ *x_offset = 0.;
+
+ if (y_offset)
+ *y_offset = 0.;
+
+ return;
+ }
+
if (x_offset)
*x_offset = surface->device_transform.x0;
if (y_offset)
@@ -894,11 +931,11 @@ cairo_surface_set_fallback_resolution (cairo_surface_t *surface,
{
cairo_status_t status;
- assert (! surface->is_snapshot);
-
- if (surface->status)
+ if (cairo_surface_status (surface))
return;
+ assert (! surface->is_snapshot);
+
if (surface->finished) {
status = _cairo_surface_set_error (surface, CAIRO_STATUS_SURFACE_FINISHED);
return;
@@ -912,6 +949,9 @@ slim_hidden_def (cairo_surface_set_fallback_resolution);
cairo_bool_t
_cairo_surface_has_device_transform (cairo_surface_t *surface)
{
+ if (cairo_surface_status (surface))
+ return FALSE;
+
return ! _cairo_matrix_is_identity (&surface->device_transform);
}
@@ -937,10 +977,13 @@ _cairo_surface_acquire_source_image (cairo_surface_t *surface,
cairo_image_surface_t **image_out,
void **image_extra)
{
- assert (!surface->finished);
+ cairo_status_t status;
- if (surface->status)
- return surface->status;
+ status = cairo_surface_status (surface);
+ if (status)
+ return status;
+
+ assert (! surface->finished);
if (surface->backend->acquire_source_image == NULL)
return CAIRO_INT_STATUS_UNSUPPORTED;
@@ -962,7 +1005,7 @@ _cairo_surface_release_source_image (cairo_surface_t *surface,
cairo_image_surface_t *image,
void *image_extra)
{
- assert (!surface->finished);
+ assert (! surface->finished);
if (surface->backend->release_source_image)
surface->backend->release_source_image (surface, image, image_extra);
@@ -1006,10 +1049,13 @@ _cairo_surface_acquire_dest_image (cairo_surface_t *surface,
cairo_rectangle_int_t *image_rect,
void **image_extra)
{
- assert (!surface->finished);
+ cairo_status_t status;
- if (surface->status)
- return surface->status;
+ status = cairo_surface_status (surface);
+ if (status)
+ return status;
+
+ assert (! surface->finished);
if (surface->backend->acquire_dest_image == NULL)
return CAIRO_INT_STATUS_UNSUPPORTED;
@@ -1041,7 +1087,7 @@ _cairo_surface_release_dest_image (cairo_surface_t *surface,
cairo_rectangle_int_t *image_rect,
void *image_extra)
{
- assert (!surface->finished);
+ assert (! surface->finished);
if (surface->backend->release_dest_image)
surface->backend->release_dest_image (surface, interest_rect,
@@ -1077,16 +1123,18 @@ _cairo_surface_clone_similar (cairo_surface_t *surface,
int height,
cairo_surface_t **clone_out)
{
- cairo_status_t status = CAIRO_INT_STATUS_UNSUPPORTED;
+ cairo_status_t status;
cairo_image_surface_t *image;
void *image_extra;
- if (surface->status)
- return surface->status;
+ status = cairo_surface_status (surface);
+ if (status)
+ return status;
if (surface->finished)
return _cairo_error (CAIRO_STATUS_SURFACE_FINISHED);
+ status = CAIRO_INT_STATUS_UNSUPPORTED;
if (surface->backend->clone_similar) {
status = surface->backend->clone_similar (surface, src, src_x, src_y,
width, height, clone_out);
@@ -1146,8 +1194,11 @@ _cairo_surface_clone_similar (cairo_surface_t *surface,
cairo_surface_t *
_cairo_surface_snapshot (cairo_surface_t *surface)
{
- if (surface->status)
- return _cairo_surface_create_in_error (surface->status);
+ cairo_status_t status;
+
+ status = cairo_surface_status (surface);
+ if (status)
+ return _cairo_surface_create_in_error (status);
if (surface->finished)
return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_SURFACE_FINISHED));
@@ -1178,6 +1229,12 @@ _cairo_surface_is_similar (cairo_surface_t *surface_a,
cairo_surface_t *surface_b,
cairo_content_t content)
{
+ if (cairo_surface_status (surface_a))
+ return FALSE;
+
+ if (cairo_surface_status (surface_b))
+ return FALSE;
+
if (surface_a->backend != surface_b->backend)
return FALSE;
@@ -1203,6 +1260,10 @@ _cairo_surface_composite (cairo_operator_t op,
{
cairo_int_status_t status;
+ status = cairo_surface_status (dst);
+ if (status)
+ return status;
+
assert (! dst->is_snapshot);
if (mask) {
@@ -1212,9 +1273,6 @@ _cairo_surface_composite (cairo_operator_t op,
assert (op != CAIRO_OPERATOR_SOURCE && op != CAIRO_OPERATOR_CLEAR);
}
- if (dst->status)
- return dst->status;
-
if (dst->finished)
return _cairo_surface_set_error (dst, CAIRO_STATUS_SURFACE_FINISHED);
@@ -1263,11 +1321,13 @@ _cairo_surface_fill_rectangle (cairo_surface_t *surface,
int height)
{
cairo_rectangle_int_t rect;
+ cairo_status_t status;
- assert (! surface->is_snapshot);
+ status = cairo_surface_status (surface);
+ if (status)
+ return status;
- if (surface->status)
- return surface->status;
+ assert (! surface->is_snapshot);
if (surface->finished)
return _cairo_surface_set_error (surface,CAIRO_STATUS_SURFACE_FINISHED);
@@ -1306,10 +1366,11 @@ _cairo_surface_fill_region (cairo_surface_t *surface,
cairo_status_t status;
int i;
- assert (! surface->is_snapshot);
+ status = cairo_surface_status (surface);
+ if (status)
+ return status;
- if (surface->status)
- return surface->status;
+ assert (! surface->is_snapshot);
num_boxes = _cairo_region_num_boxes (region);
@@ -1325,7 +1386,7 @@ _cairo_surface_fill_region (cairo_surface_t *surface,
if (num_boxes > ARRAY_LENGTH (stack_rects)) {
rects = _cairo_malloc_ab (num_boxes,
sizeof (cairo_rectangle_int_t));
- if (!rects) {
+ if (rects == NULL) {
_cairo_region_boxes_fini (region, boxes);
return _cairo_surface_set_error (surface,
CAIRO_STATUS_NO_MEMORY);
@@ -1378,10 +1439,11 @@ _cairo_surface_fill_rectangles (cairo_surface_t *surface,
{
cairo_int_status_t status;
- assert (! surface->is_snapshot);
+ status = cairo_surface_status (surface);
+ if (status)
+ return status;
- if (surface->status)
- return surface->status;
+ assert (! surface->is_snapshot);
if (surface->finished)
return _cairo_surface_set_error (surface,CAIRO_STATUS_SURFACE_FINISHED);
@@ -1409,10 +1471,11 @@ _cairo_surface_paint (cairo_surface_t *surface,
cairo_status_t status;
cairo_pattern_t *dev_source;
- assert (! surface->is_snapshot);
+ status = cairo_surface_status (surface);
+ if (status)
+ return status;
- if (surface->status)
- return surface->status;
+ assert (! surface->is_snapshot);
status = _cairo_surface_copy_pattern_for_destination (source, surface, &dev_source);
if (status)
@@ -1442,10 +1505,11 @@ _cairo_surface_mask (cairo_surface_t *surface,
cairo_pattern_t *dev_source;
cairo_pattern_t *dev_mask;
- assert (! surface->is_snapshot);
+ status = cairo_surface_status (surface);
+ if (status)
+ return status;
- if (surface->status)
- return surface->status;
+ assert (! surface->is_snapshot);
status = _cairo_surface_copy_pattern_for_destination (source, surface, &dev_source);
if (status)
@@ -1490,8 +1554,9 @@ _cairo_surface_fill_stroke (cairo_surface_t *surface,
{
cairo_status_t status;
- if (surface->status)
- return surface->status;
+ status = cairo_surface_status (surface);
+ if (status)
+ return status;
if (surface->backend->fill_stroke) {
cairo_pattern_t *dev_stroke_source;
@@ -1554,10 +1619,11 @@ _cairo_surface_stroke (cairo_surface_t *surface,
cairo_matrix_t dev_ctm = *ctm;
cairo_matrix_t dev_ctm_inverse = *ctm_inverse;
- assert (! surface->is_snapshot);
+ status = cairo_surface_status (surface);
+ if (status)
+ return status;
- if (surface->status)
- return surface->status;
+ assert (! surface->is_snapshot);
status = _cairo_surface_copy_pattern_for_destination (source, surface, &dev_source);
if (status)
@@ -1598,10 +1664,11 @@ _cairo_surface_fill (cairo_surface_t *surface,
cairo_status_t status;
cairo_pattern_t *dev_source;
- assert (! surface->is_snapshot);
+ status = cairo_surface_status (surface);
+ if (status)
+ return status;
- if (surface->status)
- return surface->status;
+ assert (! surface->is_snapshot);
status = _cairo_surface_copy_pattern_for_destination (source, surface, &dev_source);
if (status)
@@ -1642,6 +1709,10 @@ _cairo_surface_composite_trapezoids (cairo_operator_t op,
{
cairo_int_status_t status;
+ status = cairo_surface_status (dst);
+ if (status)
+ return status;
+
assert (! dst->is_snapshot);
/* These operators aren't interpreted the same way by the backends;
@@ -1649,9 +1720,6 @@ _cairo_surface_composite_trapezoids (cairo_operator_t op,
*/
assert (op != CAIRO_OPERATOR_SOURCE && op != CAIRO_OPERATOR_CLEAR);
- if (dst->status)
- return dst->status;
-
if (dst->finished)
return _cairo_surface_set_error (dst, CAIRO_STATUS_SURFACE_FINISHED);
@@ -1692,11 +1760,11 @@ cairo_surface_copy_page (cairo_surface_t *surface)
{
cairo_status_t status_ignored;
- assert (! surface->is_snapshot);
-
- if (surface->status)
+ if (cairo_surface_status (surface))
return;
+ assert (! surface->is_snapshot);
+
if (surface->finished) {
status_ignored = _cairo_surface_set_error (surface,
CAIRO_STATUS_SURFACE_FINISHED);
@@ -1726,11 +1794,11 @@ cairo_surface_show_page (cairo_surface_t *surface)
{
cairo_status_t status_ignored;
- assert (! surface->is_snapshot);
-
- if (surface->status)
+ if (cairo_surface_status (surface))
return;
+ assert (! surface->is_snapshot);
+
if (surface->finished) {
status_ignored = _cairo_surface_set_error (surface,
CAIRO_STATUS_SURFACE_FINISHED);
@@ -1758,6 +1826,9 @@ slim_hidden_def (cairo_surface_show_page);
unsigned int
_cairo_surface_get_current_clip_serial (cairo_surface_t *surface)
{
+ if (cairo_surface_status (surface))
+ return 0;
+
return surface->current_clip_serial;
}
@@ -1776,7 +1847,7 @@ _cairo_surface_allocate_clip_serial (cairo_surface_t *surface)
{
unsigned int serial;
- if (surface->status)
+ if (cairo_surface_status (surface))
return 0;
if ((serial = ++(surface->next_clip_serial)) == 0)
@@ -1798,8 +1869,9 @@ _cairo_surface_reset_clip (cairo_surface_t *surface)
{
cairo_status_t status;
- if (surface->status)
- return surface->status;
+ status = cairo_surface_status (surface);
+ if (status)
+ return status;
if (surface->finished)
return _cairo_surface_set_error (surface,CAIRO_STATUS_SURFACE_FINISHED);
@@ -1842,8 +1914,9 @@ _cairo_surface_set_clip_region (cairo_surface_t *surface,
{
cairo_status_t status;
- if (surface->status)
- return surface->status;
+ status = cairo_surface_status (surface);
+ if (status)
+ return status;
if (surface->finished)
return _cairo_surface_set_error (surface,CAIRO_STATUS_SURFACE_FINISHED);
@@ -1867,8 +1940,9 @@ _cairo_surface_intersect_clip_path (cairo_surface_t *surface,
cairo_path_fixed_t *dev_path = path;
cairo_status_t status;
- if (surface->status)
- return surface->status;
+ status = cairo_surface_status (surface);
+ if (status)
+ return status;
if (surface->finished)
return _cairo_surface_set_error (surface,CAIRO_STATUS_SURFACE_FINISHED);
@@ -1890,8 +1964,9 @@ _cairo_surface_set_clip_path_recursive (cairo_surface_t *surface,
{
cairo_status_t status;
- if (surface->status)
- return surface->status;
+ status = cairo_surface_status (surface);
+ if (status)
+ return status;
if (clip_path == NULL)
return CAIRO_STATUS_SUCCESS;
@@ -1923,8 +1998,9 @@ _cairo_surface_set_clip_path (cairo_surface_t *surface,
{
cairo_status_t status;
- if (surface->status)
- return surface->status;
+ status = cairo_surface_status (surface);
+ if (status)
+ return status;
if (surface->finished)
return _cairo_surface_set_error (surface,CAIRO_STATUS_SURFACE_FINISHED);
@@ -1964,8 +2040,9 @@ _cairo_surface_set_empty_clip_path (cairo_surface_t *surface,
cairo_path_fixed_t path;
cairo_status_t status;
- if (surface->status)
- return surface->status;
+ status = cairo_surface_status (surface);
+ if (status)
+ return status;
_cairo_path_fixed_init (&path);
@@ -1987,9 +2064,11 @@ cairo_status_t
_cairo_surface_set_clip (cairo_surface_t *surface, cairo_clip_t *clip)
{
unsigned int serial = 0;
+ cairo_status_t status;
- if (surface->status)
- return surface->status;
+ status = cairo_surface_status (surface);
+ if (status)
+ return status;
if (surface->finished)
return _cairo_surface_set_error (surface,CAIRO_STATUS_SURFACE_FINISHED);
@@ -2059,8 +2138,11 @@ cairo_status_t
_cairo_surface_get_extents (cairo_surface_t *surface,
cairo_rectangle_int_t *rectangle)
{
- if (surface->status)
- return surface->status;
+ cairo_status_t status;
+
+ status = cairo_surface_status (surface);
+ if (status)
+ return status;
if (surface->finished)
return _cairo_surface_set_error (surface,CAIRO_STATUS_SURFACE_FINISHED);
@@ -2090,12 +2172,13 @@ _cairo_surface_show_glyphs (cairo_surface_t *surface,
cairo_pattern_t *dev_source;
cairo_matrix_t font_matrix;
- assert (! surface->is_snapshot);
+ status = cairo_surface_status (surface);
+ if (status)
+ return status;
- if (surface->status)
- return surface->status;
+ assert (! surface->is_snapshot);
- if (!num_glyphs)
+ if (! num_glyphs)
return CAIRO_STATUS_SUCCESS;
status = _cairo_surface_copy_pattern_for_destination (source,
@@ -2170,10 +2253,11 @@ _cairo_surface_old_show_glyphs (cairo_scaled_font_t *scaled_font,
{
cairo_status_t status;
- assert (! dst->is_snapshot);
+ status = cairo_surface_status (dst);
+ if (status)
+ return status;
- if (dst->status)
- return dst->status;
+ assert (! dst->is_snapshot);
if (dst->finished)
return _cairo_surface_set_error (dst, CAIRO_STATUS_SURFACE_FINISHED);
@@ -2293,11 +2377,13 @@ _cairo_surface_composite_fixup_unbounded (cairo_surface_t *dst,
cairo_rectangle_int_t src_tmp, mask_tmp;
cairo_rectangle_int_t *src_rectangle = NULL;
cairo_rectangle_int_t *mask_rectangle = NULL;
+ cairo_status_t status;
- assert (! dst->is_snapshot);
+ status = cairo_surface_status (dst);
+ if (status)
+ return status;
- if (dst->status)
- return dst->status;
+ assert (! dst->is_snapshot);
/* The RENDER/libpixman operators are clipped to the bounds of the untransformed,
* non-repeating sources and masks. Other sources and masks can be ignored.
@@ -2371,11 +2457,13 @@ _cairo_surface_composite_shape_fixup_unbounded (cairo_surface_t *dst,
cairo_rectangle_int_t src_tmp, mask_tmp;
cairo_rectangle_int_t *src_rectangle = NULL;
cairo_rectangle_int_t *mask_rectangle = NULL;
+ cairo_status_t status;
- assert (! dst->is_snapshot);
+ status = cairo_surface_status (dst);
+ if (status)
+ return status;
- if (dst->status)
- return dst->status;
+ assert (! dst->is_snapshot);
/* The RENDER/libpixman operators are clipped to the bounds of the untransformed,
* non-repeating sources and masks. Other sources and masks can be ignored.
@@ -2452,7 +2540,7 @@ _cairo_surface_set_resolution (cairo_surface_t *surface,
double x_res,
double y_res)
{
- if (surface->status)
+ if (cairo_surface_status (surface))
return;
surface->x_resolution = x_res;
@@ -2462,6 +2550,8 @@ _cairo_surface_set_resolution (cairo_surface_t *surface,
cairo_surface_t *
_cairo_surface_create_in_error (cairo_status_t status)
{
+ assert (status != CAIRO_STATUS_SUCCESS);
+
switch (status) {
case CAIRO_STATUS_NO_MEMORY:
return (cairo_surface_t *) &_cairo_surface_nil;
--
1.5.3.8
--=-BzpsUfdHqkE+TbB0ojYn
Content-Disposition: attachment; filename=0054-cairo-scaled-font-Use-cairo_scaled_font_status-i.patch
Content-Type: application/mbox; name=0054-cairo-scaled-font-Use-cairo_scaled_font_status-i.patch
Content-Transfer-Encoding: 7bit
More information about the cairo
mailing list