mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-20 22:10:30 +01:00
Remove STATUS_OK macro which was not being used universally.
This commit is contained in:
parent
e6eef09115
commit
31dcb954fe
15 changed files with 127 additions and 95 deletions
18
ChangeLog
18
ChangeLog
|
|
@ -1,3 +1,21 @@
|
|||
2005-06-10 Carl Worth <cworth@cworth.org>
|
||||
|
||||
* src/cairoint.h:
|
||||
* src/cairo-font.c:
|
||||
* src/cairo-ft-font.c:
|
||||
* src/cairo-glitz-surface.c:
|
||||
* src/cairo-gstate.c:
|
||||
* src/cairo-image-surface.c:
|
||||
* src/cairo-pattern.c:
|
||||
* src/cairo-pdf-surface.c:
|
||||
* src/cairo-png.c:
|
||||
* src/cairo-surface.c:
|
||||
* src/cairo-win32-font.c:
|
||||
* src/cairo-win32-surface.c:
|
||||
* src/cairo-xcb-surface.c:
|
||||
* src/cairo-xlib-surface.c: Remove STATUS_OK macro which was not
|
||||
being used universally.
|
||||
|
||||
2005-06-09 Carl Worth <cworth@cworth.org>
|
||||
|
||||
* src/cairo.h: Remove trailing comma from enum values which gcc
|
||||
|
|
|
|||
|
|
@ -405,7 +405,7 @@ _cairo_simple_font_face_create (const char *family,
|
|||
return NULL;
|
||||
}
|
||||
status = _cairo_cache_lookup (cache, &key, (void **) &entry, &created_entry);
|
||||
if (STATUS_OK (status) && !created_entry)
|
||||
if (status == CAIRO_STATUS_SUCCESS && !created_entry)
|
||||
cairo_font_face_reference (&entry->font_face->base);
|
||||
|
||||
_unlock_global_simple_cache ();
|
||||
|
|
@ -596,7 +596,7 @@ _cairo_outer_font_cache_create_entry (void *cache,
|
|||
}
|
||||
|
||||
status = _cairo_cache_lookup (cache, key, (void **) &inner_entry, &created_entry);
|
||||
if (!STATUS_OK (status)) {
|
||||
if (status) {
|
||||
free (entry);
|
||||
return status;
|
||||
}
|
||||
|
|
@ -646,7 +646,7 @@ _cairo_inner_font_cache_create_entry (void *cache,
|
|||
k->font_matrix,
|
||||
k->ctm,
|
||||
&entry->scaled_font);
|
||||
if (!STATUS_OK (status)) {
|
||||
if (status) {
|
||||
free (entry);
|
||||
return status;
|
||||
}
|
||||
|
|
@ -737,11 +737,11 @@ cairo_scaled_font_create (cairo_font_face_t *font_face,
|
|||
}
|
||||
|
||||
status = _cairo_cache_lookup (cache, &key, (void **) &entry, NULL);
|
||||
if (STATUS_OK (status))
|
||||
if (status == CAIRO_STATUS_SUCCESS)
|
||||
cairo_scaled_font_reference (entry->scaled_font);
|
||||
|
||||
_unlock_global_font_cache ();
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return NULL;
|
||||
|
||||
return entry->scaled_font;
|
||||
|
|
@ -958,7 +958,7 @@ cairo_scaled_font_extents (cairo_scaled_font_t *scaled_font,
|
|||
|
||||
status = _cairo_scaled_font_font_extents (scaled_font, extents);
|
||||
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
_cairo_matrix_compute_scale_factors (&scaled_font->font_matrix,
|
||||
|
|
|
|||
|
|
@ -338,11 +338,11 @@ _ft_unscaled_font_get_for_pattern (FcPattern *pattern)
|
|||
}
|
||||
|
||||
status = _cairo_cache_lookup (cache, &key, (void **) &entry, &created_entry);
|
||||
if (STATUS_OK (status) && !created_entry)
|
||||
if (status == CAIRO_STATUS_SUCCESS && !created_entry)
|
||||
_cairo_unscaled_font_reference (&entry->unscaled->base);
|
||||
|
||||
_unlock_global_ft_cache ();
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return NULL;
|
||||
|
||||
return entry->unscaled;
|
||||
|
|
@ -866,7 +866,7 @@ _cairo_ft_scaled_font_text_to_glyphs (void *abstract_font,
|
|||
_cairo_ft_scaled_font_get_glyph_cache_key (scaled_font, &key);
|
||||
|
||||
status = _cairo_utf8_to_ucs4 ((unsigned char*)utf8, -1, &ucs4, num_glyphs);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
face = cairo_ft_scaled_font_lock_face (&scaled_font->base);
|
||||
|
|
|
|||
|
|
@ -1390,6 +1390,8 @@ _cairo_glitz_area_find (cairo_glitz_area_t *area,
|
|||
cairo_bool_t kick_out,
|
||||
void *closure)
|
||||
{
|
||||
cairo_status_t status;
|
||||
|
||||
if (area->width < width || area->height < height)
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
|
||||
|
|
@ -1450,9 +1452,10 @@ _cairo_glitz_area_find (cairo_glitz_area_t *area,
|
|||
|
||||
area->state = CAIRO_GLITZ_AREA_DIVIDED;
|
||||
|
||||
if (STATUS_OK (_cairo_glitz_area_find (area->area[0],
|
||||
width, height,
|
||||
kick_out, closure)))
|
||||
status = _cairo_glitz_area_find (area->area[0],
|
||||
width, height,
|
||||
kick_out, closure);
|
||||
if (status == CAIRO_STATUS_SUCCESS)
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
} break;
|
||||
|
|
@ -1467,9 +1470,10 @@ _cairo_glitz_area_find (cairo_glitz_area_t *area,
|
|||
if (area->area[i]->width >= width &&
|
||||
area->area[i]->height >= height)
|
||||
{
|
||||
if (STATUS_OK (_cairo_glitz_area_find (area->area[i],
|
||||
width, height,
|
||||
kick_out, closure)))
|
||||
status = _cairo_glitz_area_find (area->area[i],
|
||||
width, height,
|
||||
kick_out, closure);
|
||||
if (status == CAIRO_STATUS_SUCCESS)
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
rejected = TRUE;
|
||||
|
|
@ -1502,8 +1506,10 @@ _cairo_glitz_area_find (cairo_glitz_area_t *area,
|
|||
|
||||
area->closure = NULL;
|
||||
area->state = CAIRO_GLITZ_AREA_AVAILABLE;
|
||||
if (STATUS_OK (_cairo_glitz_area_find (area, width, height,
|
||||
TRUE, closure)))
|
||||
|
||||
status = _cairo_glitz_area_find (area, width, height,
|
||||
TRUE, closure);
|
||||
if (status == CAIRO_STATUS_SUCCESS)
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
} break;
|
||||
|
|
|
|||
|
|
@ -345,7 +345,7 @@ _cairo_gstate_get_clip_extents (cairo_gstate_t *gstate,
|
|||
cairo_status_t status;
|
||||
|
||||
status = _cairo_surface_get_extents (gstate->target, rectangle);
|
||||
if (!STATUS_OK(status))
|
||||
if (status)
|
||||
return status;
|
||||
/* check path extents here */
|
||||
|
||||
|
|
@ -714,11 +714,11 @@ _cairo_gstate_paint (cairo_gstate_t *gstate)
|
|||
cairo_traps_t traps;
|
||||
|
||||
status = _cairo_gstate_set_clip (gstate);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
status = _cairo_gstate_get_clip_extents (gstate, &rectangle);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
box.p1.x = _cairo_fixed_from_int (rectangle.x);
|
||||
|
|
@ -726,7 +726,7 @@ _cairo_gstate_paint (cairo_gstate_t *gstate)
|
|||
box.p2.x = _cairo_fixed_from_int (rectangle.x + rectangle.width);
|
||||
box.p2.y = _cairo_fixed_from_int (rectangle.y + rectangle.height);
|
||||
status = _cairo_traps_init_box (&traps, &box);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
_cairo_gstate_clip_and_composite_trapezoids (gstate,
|
||||
|
|
@ -814,7 +814,7 @@ _cairo_gstate_intersect_clip (cairo_gstate_t *gstate,
|
|||
cairo_status_t status;
|
||||
|
||||
status = _region_new_from_rect (&gstate->clip.surface_rect, &clip_rect);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
if (pixman_region_intersect (region,
|
||||
|
|
@ -824,7 +824,7 @@ _cairo_gstate_intersect_clip (cairo_gstate_t *gstate,
|
|||
|
||||
pixman_region_destroy (clip_rect);
|
||||
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
@ -856,7 +856,7 @@ _cairo_gstate_mask (cairo_gstate_t *gstate,
|
|||
int mask_x, mask_y;
|
||||
|
||||
status = _cairo_gstate_set_clip (gstate);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
_get_mask_extents (gstate, mask, &extents);
|
||||
|
|
@ -880,13 +880,13 @@ _cairo_gstate_mask (cairo_gstate_t *gstate,
|
|||
0, 0,
|
||||
0, 0,
|
||||
extents.width, extents.height);
|
||||
if (!STATUS_OK (status)) {
|
||||
if (status) {
|
||||
cairo_surface_destroy (intermediate);
|
||||
return status;
|
||||
}
|
||||
|
||||
status = _cairo_gstate_combine_clip_surface (gstate, intermediate, &extents);
|
||||
if (!STATUS_OK (status)) {
|
||||
if (status) {
|
||||
cairo_surface_destroy (intermediate);
|
||||
return status;
|
||||
}
|
||||
|
|
@ -931,7 +931,7 @@ _cairo_gstate_stroke (cairo_gstate_t *gstate, cairo_path_fixed_t *path)
|
|||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
status = _cairo_gstate_set_clip (gstate);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
_cairo_pen_init (&gstate->pen_regular, gstate->line_width / 2.0, gstate);
|
||||
|
|
@ -1047,7 +1047,7 @@ _clip_and_compute_extents_region (cairo_gstate_t *gstate,
|
|||
cairo_status_t status;
|
||||
|
||||
status = _cairo_gstate_intersect_clip (gstate, trap_region);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
_region_rect_extents (trap_region, extents);
|
||||
|
|
@ -1073,7 +1073,7 @@ _clip_and_compute_extents_arbitrary (cairo_gstate_t *gstate,
|
|||
cairo_status_t status;
|
||||
|
||||
status = _region_new_from_rect (extents, &intersection);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
if (pixman_region_intersect (intersection,
|
||||
|
|
@ -1089,7 +1089,7 @@ _clip_and_compute_extents_arbitrary (cairo_gstate_t *gstate,
|
|||
|
||||
pixman_region_destroy (intersection);
|
||||
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
@ -1121,14 +1121,14 @@ _composite_trap_region (cairo_gstate_t *gstate,
|
|||
if (num_rects > 1) {
|
||||
|
||||
status = _cairo_surface_can_clip_region (gstate->target);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
clip_serial = _cairo_surface_allocate_clip_serial (gstate->target);
|
||||
status = _cairo_surface_set_clip_region (gstate->target,
|
||||
trap_region,
|
||||
clip_serial);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
@ -1225,11 +1225,11 @@ _composite_traps_intermediate_surface (cairo_gstate_t *gstate,
|
|||
traps->num_traps);
|
||||
_cairo_pattern_fini (&pattern.base);
|
||||
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
goto out;
|
||||
|
||||
status = _cairo_gstate_combine_clip_surface (gstate, intermediate, extents);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
goto out;
|
||||
|
||||
_cairo_pattern_init_for_surface (&intermediate_pattern, intermediate);
|
||||
|
|
@ -1343,7 +1343,7 @@ _cairo_gstate_clip_and_composite_trapezoids (cairo_gstate_t *gstate,
|
|||
return CAIRO_STATUS_NO_TARGET_SURFACE;
|
||||
|
||||
status = _cairo_traps_extract_region (traps, &trap_region);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
if (trap_region)
|
||||
|
|
@ -1351,7 +1351,7 @@ _cairo_gstate_clip_and_composite_trapezoids (cairo_gstate_t *gstate,
|
|||
else
|
||||
status = _clip_and_compute_extents_arbitrary (gstate, traps, &extents);
|
||||
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
goto out;
|
||||
|
||||
if (_cairo_rectangle_empty (&extents))
|
||||
|
|
@ -1407,7 +1407,7 @@ _cairo_gstate_fill (cairo_gstate_t *gstate, cairo_path_fixed_t *path)
|
|||
cairo_traps_t traps;
|
||||
|
||||
status = _cairo_gstate_set_clip (gstate);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
status = _cairo_surface_fill_path (gstate->operator,
|
||||
|
|
@ -1578,7 +1578,7 @@ _cairo_gstate_clip (cairo_gstate_t *gstate, cairo_path_fixed_t *path)
|
|||
|
||||
_cairo_traps_init (&traps);
|
||||
status = _cairo_path_fixed_fill_to_traps (path, gstate, &traps);
|
||||
if (!STATUS_OK (status)) {
|
||||
if (status) {
|
||||
_cairo_traps_fini (&traps);
|
||||
return status;
|
||||
}
|
||||
|
|
@ -1586,13 +1586,13 @@ _cairo_gstate_clip (cairo_gstate_t *gstate, cairo_path_fixed_t *path)
|
|||
status = _cairo_surface_can_clip_region (gstate->target);
|
||||
|
||||
if (status != CAIRO_INT_STATUS_UNSUPPORTED) {
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
/* Check to see if we can represent these traps as a PixRegion. */
|
||||
|
||||
status = _cairo_traps_extract_region (&traps, ®ion);
|
||||
if (!STATUS_OK (status)) {
|
||||
if (status) {
|
||||
_cairo_traps_fini (&traps);
|
||||
return status;
|
||||
}
|
||||
|
|
@ -1662,7 +1662,7 @@ _cairo_gstate_clip (cairo_gstate_t *gstate, cairo_path_fixed_t *path)
|
|||
_cairo_pattern_fini (&pattern.base);
|
||||
_cairo_traps_fini (&traps);
|
||||
|
||||
if (!STATUS_OK (status)) {
|
||||
if (status) {
|
||||
cairo_surface_destroy (surface);
|
||||
return status;
|
||||
}
|
||||
|
|
@ -1687,7 +1687,7 @@ _cairo_gstate_clip (cairo_gstate_t *gstate, cairo_path_fixed_t *path)
|
|||
|
||||
_cairo_pattern_fini (&pattern.base);
|
||||
|
||||
if (!STATUS_OK (status)) {
|
||||
if (status) {
|
||||
cairo_surface_destroy (surface);
|
||||
return status;
|
||||
}
|
||||
|
|
@ -1980,7 +1980,7 @@ _cairo_gstate_show_glyphs (cairo_gstate_t *gstate,
|
|||
cairo_rectangle_t extents;
|
||||
|
||||
status = _cairo_gstate_set_clip (gstate);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
status = _cairo_gstate_ensure_font (gstate);
|
||||
|
|
|
|||
|
|
@ -518,12 +518,12 @@ _cairo_image_surface_composite (cairo_operator_t operator,
|
|||
return status;
|
||||
|
||||
status = _cairo_image_surface_set_attributes (src, &src_attr);
|
||||
if (STATUS_OK (status))
|
||||
if (status == CAIRO_STATUS_SUCCESS)
|
||||
{
|
||||
if (mask)
|
||||
{
|
||||
status = _cairo_image_surface_set_attributes (mask, &mask_attr);
|
||||
if (STATUS_OK (status))
|
||||
if (status == CAIRO_STATUS_SUCCESS)
|
||||
pixman_composite (_pixman_operator (operator),
|
||||
src->pixman_image,
|
||||
mask->pixman_image,
|
||||
|
|
@ -621,7 +621,7 @@ _cairo_image_surface_composite_trapezoids (cairo_operator_t operator,
|
|||
/* XXX: The pixman_trapezoid_t cast is evil and needs to go away
|
||||
* somehow. */
|
||||
status = _cairo_image_surface_set_attributes (src, &attributes);
|
||||
if (STATUS_OK (status))
|
||||
if (status == CAIRO_STATUS_SUCCESS)
|
||||
pixman_composite_trapezoids (_pixman_operator (operator),
|
||||
src->pixman_image,
|
||||
dst->pixman_image,
|
||||
|
|
|
|||
|
|
@ -1039,7 +1039,7 @@ _cairo_pattern_acquire_surface_for_surface (cairo_surface_pattern_t *pattern,
|
|||
status = _cairo_surface_acquire_source_image (pattern->surface,
|
||||
&image,
|
||||
&attr->extra);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
*out = &image->base;
|
||||
|
|
|
|||
|
|
@ -1229,7 +1229,7 @@ _cairo_pdf_surface_composite_image (cairo_pdf_surface_t *dst,
|
|||
|
||||
src = pattern->surface;
|
||||
status = _cairo_surface_acquire_source_image (src, &image, &image_extra);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
id = emit_image_data (dst->document, image);
|
||||
|
|
@ -1404,7 +1404,7 @@ emit_surface_pattern (cairo_pdf_surface_t *dst,
|
|||
}
|
||||
|
||||
status = _cairo_surface_acquire_source_image (pattern->surface, &image, &image_extra);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return;
|
||||
|
||||
_cairo_pdf_document_close_stream (document);
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ cairo_surface_write_to_png (cairo_surface_t *surface,
|
|||
|
||||
status = write_png (surface, stdio_write_func, fp);
|
||||
|
||||
if (fclose (fp) && STATUS_OK (status))
|
||||
if (fclose (fp) && status == CAIRO_STATUS_SUCCESS)
|
||||
status = CAIRO_STATUS_WRITE_ERROR;
|
||||
|
||||
return status;
|
||||
|
|
@ -226,10 +226,12 @@ struct png_write_closure_t {
|
|||
static void
|
||||
stream_write_func (png_structp png, png_bytep data, png_size_t size)
|
||||
{
|
||||
cairo_status_t status;
|
||||
struct png_write_closure_t *png_closure;
|
||||
|
||||
png_closure = png_get_io_ptr (png);
|
||||
if (!STATUS_OK (png_closure->write_func (png_closure->closure, data, size)))
|
||||
status = png_closure->write_func (png_closure->closure, data, size);
|
||||
if (status)
|
||||
png_error(png, "Write Error");
|
||||
}
|
||||
|
||||
|
|
@ -432,10 +434,12 @@ struct png_read_closure_t {
|
|||
static void
|
||||
stream_read_func (png_structp png, png_bytep data, png_size_t size)
|
||||
{
|
||||
cairo_status_t status;
|
||||
struct png_read_closure_t *png_closure;
|
||||
|
||||
png_closure = png_get_io_ptr (png);
|
||||
if (!STATUS_OK (png_closure->read_func (png_closure->closure, data, size)))
|
||||
status = png_closure->read_func (png_closure->closure, data, size);
|
||||
if (status)
|
||||
png_error(png, "Read Error");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -472,7 +472,7 @@ _fallback_composite (cairo_operator_t operator,
|
|||
cairo_status_t status;
|
||||
|
||||
status = _fallback_init (&state, dst, dst_x, dst_y, width, height);
|
||||
if (!STATUS_OK (status) || !state.image)
|
||||
if (status || !state.image)
|
||||
return status;
|
||||
|
||||
state.image->base.backend->composite (operator, src, mask,
|
||||
|
|
@ -584,7 +584,7 @@ _fallback_fill_rectangles (cairo_surface_t *surface,
|
|||
}
|
||||
|
||||
status = _fallback_init (&state, surface, x1, y1, x2 - x1, y2 - y1);
|
||||
if (!STATUS_OK (status) || !state.image)
|
||||
if (status || !state.image)
|
||||
return status;
|
||||
|
||||
/* If the fetched image isn't at 0,0, we need to offset the rectangles */
|
||||
|
|
@ -677,7 +677,7 @@ _fallback_composite_trapezoids (cairo_operator_t operator,
|
|||
int i;
|
||||
|
||||
status = _fallback_init (&state, dst, dst_x, dst_y, width, height);
|
||||
if (!STATUS_OK (status) || !state.image)
|
||||
if (status || !state.image)
|
||||
return status;
|
||||
|
||||
/* If the destination image isn't at 0,0, we need to offset the trapezoids */
|
||||
|
|
@ -842,13 +842,13 @@ _cairo_surface_reset_clip (cairo_surface_t *surface)
|
|||
#if 0
|
||||
if (surface->backend->clip_path) {
|
||||
status = surface->backend->clip_path (surface, NULL);
|
||||
if (!STATUS_OK(status))
|
||||
if (status)
|
||||
return status;
|
||||
}
|
||||
#endif
|
||||
if (surface->backend->set_clip_region != NULL) {
|
||||
status = surface->backend->set_clip_region (surface, NULL);
|
||||
if (!STATUS_OK(status))
|
||||
if (status)
|
||||
return status;
|
||||
}
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
|
|
|||
|
|
@ -104,6 +104,8 @@ static void
|
|||
_compute_transform (cairo_win32_scaled_font_t *scaled_font,
|
||||
cairo_matrix_t *sc)
|
||||
{
|
||||
cairo_status_t status;
|
||||
|
||||
if (NEARLY_ZERO (sc->yx) && NEARLY_ZERO (sc->xy)) {
|
||||
scaled_font->preserve_axes = TRUE;
|
||||
scaled_font->x_scale = sc->xx;
|
||||
|
|
@ -154,8 +156,10 @@ _compute_transform (cairo_win32_scaled_font_t *scaled_font,
|
|||
1.0 / scaled_font->logical_scale, 1.0 / scaled_font->logical_scale);
|
||||
|
||||
scaled_font->device_to_logical = scaled_font->logical_to_device;
|
||||
if (!STATUS_OK (cairo_matrix_invert (&scaled_font->device_to_logical)))
|
||||
cairo_matrix_init_identity (&scaled_font->device_to_logical);
|
||||
|
||||
status = cairo_matrix_invert (&scaled_font->device_to_logical);
|
||||
if (status)
|
||||
cairo_matrix_init_identity (&scaled_font->device_to_logical);
|
||||
}
|
||||
|
||||
static BYTE
|
||||
|
|
@ -368,7 +372,7 @@ _cairo_win32_scaled_font_select_unscaled_font (cairo_scaled_font_t *scaled_font,
|
|||
return _cairo_win32_print_gdi_error ("_cairo_win32_scaled_font_select_unscaled_font");
|
||||
|
||||
status = _win32_scaled_font_set_identity_transform (hdc);
|
||||
if (!STATUS_OK (status)) {
|
||||
if (status) {
|
||||
SelectObject (hdc, old_hfont);
|
||||
return status;
|
||||
}
|
||||
|
|
@ -400,7 +404,7 @@ _cairo_win32_scaled_font_create (const char *family,
|
|||
cairo_status_t status;
|
||||
|
||||
status = _cairo_utf8_to_utf16 (family, -1, &face_name, &face_name_len);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
if (face_name_len > LF_FACESIZE - 1) {
|
||||
|
|
@ -500,7 +504,7 @@ _cairo_win32_scaled_font_text_to_glyphs (void *abstract_font,
|
|||
HDC hdc = NULL;
|
||||
|
||||
status = _cairo_utf8_to_utf16 (utf8, -1, &utf16, &n16);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
gcp_results.lStructSize = sizeof (GCP_RESULTS);
|
||||
|
|
@ -522,7 +526,7 @@ _cairo_win32_scaled_font_text_to_glyphs (void *abstract_font,
|
|||
}
|
||||
|
||||
status = cairo_win32_scaled_font_select_font (&scaled_font->base, hdc);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
goto FAIL1;
|
||||
|
||||
while (TRUE) {
|
||||
|
|
@ -614,7 +618,7 @@ _cairo_win32_scaled_font_font_extents (void *abstract_font,
|
|||
* from the GDI in logical space, then convert back to font space
|
||||
*/
|
||||
status = cairo_win32_scaled_font_select_font (&scaled_font->base, hdc);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
GetTextMetrics (hdc, &metrics);
|
||||
cairo_win32_scaled_font_done_font (&scaled_font->base);
|
||||
|
|
@ -633,7 +637,7 @@ _cairo_win32_scaled_font_font_extents (void *abstract_font,
|
|||
* avoid them.
|
||||
*/
|
||||
status = _cairo_win32_scaled_font_select_unscaled_font (&scaled_font->base, hdc);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
GetTextMetrics (hdc, &metrics);
|
||||
_cairo_win32_scaled_font_done_unscaled_font (&scaled_font->base);
|
||||
|
|
@ -676,7 +680,7 @@ _cairo_win32_scaled_font_glyph_extents (void *abstract_font,
|
|||
* from the GDI in device space and convert to font space.
|
||||
*/
|
||||
status = cairo_win32_scaled_font_select_font (&scaled_font->base, hdc);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
GetGlyphOutlineW (hdc, glyphs[0].index, GGO_METRICS | GGO_GLYPH_INDEX,
|
||||
&metrics, 0, NULL, &matrix);
|
||||
|
|
@ -749,7 +753,7 @@ _cairo_win32_scaled_font_glyph_bbox (void *abstract_font,
|
|||
return CAIRO_STATUS_NO_MEMORY;
|
||||
|
||||
status = cairo_win32_scaled_font_select_font (&scaled_font->base, hdc);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
for (i = 0; i < num_glyphs; i++) {
|
||||
|
|
@ -848,7 +852,7 @@ _add_glyph (cairo_glyph_state_t *state,
|
|||
|
||||
if (logical_y != state->last_y) {
|
||||
cairo_status_t status = _flush_glyphs (state);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
return status;
|
||||
state->start_x = logical_x;
|
||||
}
|
||||
|
|
@ -894,7 +898,7 @@ _draw_glyphs_on_surface (cairo_win32_surface_t *surface,
|
|||
return _cairo_win32_print_gdi_error ("_draw_glyphs_on_surface:SaveDC");
|
||||
|
||||
status = cairo_win32_scaled_font_select_font (&scaled_font->base, surface->dc);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
goto FAIL1;
|
||||
|
||||
SetTextColor (surface->dc, color);
|
||||
|
|
@ -906,7 +910,7 @@ _draw_glyphs_on_surface (cairo_win32_surface_t *surface,
|
|||
for (i = 0; i < num_glyphs; i++) {
|
||||
status = _add_glyph (&state, glyphs[i].index,
|
||||
glyphs[i].x - x_offset, glyphs[i].y - y_offset);
|
||||
if (!STATUS_OK (status))
|
||||
if (status)
|
||||
goto FAIL2;
|
||||
}
|
||||
|
||||
|
|
@ -1235,7 +1239,7 @@ cairo_win32_scaled_font_select_font (cairo_scaled_font_t *scaled_font,
|
|||
}
|
||||
|
||||
status = _win32_scaled_font_set_world_transform ((cairo_win32_scaled_font_t *)scaled_font, hdc);
|
||||
if (!STATUS_OK (status)) {
|
||||
if (status) {
|
||||
SetGraphicsMode (hdc, old_mode);
|
||||
SelectObject (hdc, old_hfont);
|
||||
return status;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* Cairo - a vector graphics library with display and print output
|
||||
*
|
||||
* Copyright <EFBFBD>Â<EFBFBD>© 2005 Red Hat, Inc.
|
||||
* Copyright © 2005 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it either under the terms of the GNU Lesser General Public
|
||||
|
|
@ -404,12 +404,13 @@ _cairo_win32_surface_acquire_source_image (void *abstract_sur
|
|||
status = _cairo_win32_surface_get_subimage (abstract_surface, 0, 0,
|
||||
surface->clip_rect.width,
|
||||
surface->clip_rect.height, &local);
|
||||
if (STATUS_OK (status)) {
|
||||
*image_out = (cairo_image_surface_t *)local->image;
|
||||
*image_extra = local;
|
||||
}
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
return status;
|
||||
*image_out = (cairo_image_surface_t *)local->image;
|
||||
*image_extra = local;
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -475,17 +476,18 @@ _cairo_win32_surface_acquire_dest_image (void *abstract_surfa
|
|||
status = _cairo_win32_surface_get_subimage (abstract_surface,
|
||||
x1, y1, x2 - x1, y2 - y1,
|
||||
&local);
|
||||
if (STATUS_OK (status)) {
|
||||
*image_out = (cairo_image_surface_t *)local->image;
|
||||
*image_extra = local;
|
||||
|
||||
image_rect->x = x1;
|
||||
image_rect->y = y1;
|
||||
image_rect->width = x2 - x1;
|
||||
image_rect->height = y2 - y1;
|
||||
}
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
return status;
|
||||
*image_out = (cairo_image_surface_t *)local->image;
|
||||
*image_extra = local;
|
||||
|
||||
image_rect->x = x1;
|
||||
image_rect->y = y1;
|
||||
image_rect->width = x2 - x1;
|
||||
image_rect->height = y2 - y1;
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -850,12 +850,12 @@ _cairo_xcb_surface_composite (cairo_operator_t operator,
|
|||
return status;
|
||||
|
||||
status = _cairo_xcb_surface_set_attributes (src, &src_attr);
|
||||
if (STATUS_OK (status))
|
||||
if (status == CAIRO_STATUS_SUCCESS)
|
||||
{
|
||||
if (mask)
|
||||
{
|
||||
status = _cairo_xcb_surface_set_attributes (mask, &mask_attr);
|
||||
if (STATUS_OK (status))
|
||||
if (status == CAIRO_STATUS_SUCCESS)
|
||||
XCBRenderComposite (dst->dpy,
|
||||
_render_operator (operator),
|
||||
src->picture,
|
||||
|
|
@ -966,7 +966,7 @@ _cairo_xcb_surface_composite_trapezoids (cairo_operator_t operator,
|
|||
/* XXX: _format_from_cairo is slow. should cache something. */
|
||||
render_format = _format_from_cairo (dst->dpy, CAIRO_FORMAT_A8),
|
||||
status = _cairo_xcb_surface_set_attributes (src, &attributes);
|
||||
if (STATUS_OK (status))
|
||||
if (status == CAIRO_STATUS_SUCCESS)
|
||||
XCBRenderTrapezoids (dst->dpy,
|
||||
_render_operator (operator),
|
||||
src->picture, dst->picture,
|
||||
|
|
|
|||
|
|
@ -820,11 +820,11 @@ _cairo_xlib_surface_composite (cairo_operator_t operator,
|
|||
|
||||
status = _cairo_xlib_surface_set_attributes (src, &src_attr);
|
||||
|
||||
if (STATUS_OK (status)) {
|
||||
if (status == CAIRO_STATUS_SUCCESS) {
|
||||
_cairo_xlib_surface_ensure_dst_picture (dst);
|
||||
if (mask) {
|
||||
status = _cairo_xlib_surface_set_attributes (mask, &mask_attr);
|
||||
if (STATUS_OK (status))
|
||||
if (status == CAIRO_STATUS_SUCCESS)
|
||||
XRenderComposite (dst->dpy,
|
||||
_render_operator (operator),
|
||||
src->src_picture,
|
||||
|
|
@ -930,7 +930,7 @@ _cairo_xlib_surface_composite_trapezoids (cairo_operator_t operator,
|
|||
/* XXX: The XTrapezoid cast is evil and needs to go away somehow. */
|
||||
_cairo_xlib_surface_ensure_dst_picture (dst);
|
||||
status = _cairo_xlib_surface_set_attributes (src, &attributes);
|
||||
if (STATUS_OK (status))
|
||||
if (status == CAIRO_STATUS_SUCCESS)
|
||||
XRenderCompositeTrapezoids (dst->dpy,
|
||||
_render_operator (operator),
|
||||
src->src_picture, dst->dst_picture,
|
||||
|
|
|
|||
|
|
@ -191,8 +191,6 @@ typedef enum cairo_int_status {
|
|||
CAIRO_INT_STATUS_UNSUPPORTED
|
||||
} cairo_int_status_t;
|
||||
|
||||
#define STATUS_OK(status) ((status) == CAIRO_STATUS_SUCCESS)
|
||||
|
||||
typedef enum cairo_direction {
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
CAIRO_DIRECTION_REVERSE
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue