mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-08 04:28:02 +02:00
Rename CAIRO_OK to STATUS_OK. No intended changes in functionality.
This commit is contained in:
parent
045ba795da
commit
c56938e568
15 changed files with 90 additions and 72 deletions
18
ChangeLog
18
ChangeLog
|
|
@ -1,3 +1,21 @@
|
|||
2005-06-01 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: Rename CAIRO_OK to STATUS_OK. No
|
||||
intended changes in functionality.
|
||||
|
||||
2005-06-01 Carl Worth <cworth@cworth.org>
|
||||
|
||||
* src/cairo-gstate-private.h:
|
||||
|
|
|
|||
|
|
@ -395,7 +395,7 @@ _cairo_simple_font_face_create (const char *family,
|
|||
return NULL;
|
||||
}
|
||||
status = _cairo_cache_lookup (cache, &key, (void **) &entry, &created_entry);
|
||||
if (CAIRO_OK (status) && !created_entry)
|
||||
if (STATUS_OK (status) && !created_entry)
|
||||
cairo_font_face_reference (&entry->font_face->base);
|
||||
|
||||
_unlock_global_simple_cache ();
|
||||
|
|
@ -586,7 +586,7 @@ _cairo_outer_font_cache_create_entry (void *cache,
|
|||
}
|
||||
|
||||
status = _cairo_cache_lookup (cache, key, (void **) &inner_entry, &created_entry);
|
||||
if (!CAIRO_OK (status)) {
|
||||
if (!STATUS_OK (status)) {
|
||||
free (entry);
|
||||
return status;
|
||||
}
|
||||
|
|
@ -636,7 +636,7 @@ _cairo_inner_font_cache_create_entry (void *cache,
|
|||
k->font_matrix,
|
||||
k->ctm,
|
||||
&entry->scaled_font);
|
||||
if (!CAIRO_OK (status)) {
|
||||
if (!STATUS_OK (status)) {
|
||||
free (entry);
|
||||
return status;
|
||||
}
|
||||
|
|
@ -727,11 +727,11 @@ cairo_scaled_font_create (cairo_font_face_t *font_face,
|
|||
}
|
||||
|
||||
status = _cairo_cache_lookup (cache, &key, (void **) &entry, NULL);
|
||||
if (CAIRO_OK (status))
|
||||
if (STATUS_OK (status))
|
||||
cairo_scaled_font_reference (entry->scaled_font);
|
||||
|
||||
_unlock_global_font_cache ();
|
||||
if (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return NULL;
|
||||
|
||||
return entry->scaled_font;
|
||||
|
|
@ -935,7 +935,7 @@ cairo_scaled_font_extents (cairo_scaled_font_t *scaled_font,
|
|||
|
||||
status = _cairo_scaled_font_font_extents (scaled_font, extents);
|
||||
|
||||
if (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return status;
|
||||
|
||||
_cairo_matrix_compute_scale_factors (&scaled_font->font_matrix,
|
||||
|
|
|
|||
|
|
@ -337,11 +337,11 @@ _ft_unscaled_font_get_for_pattern (FcPattern *pattern)
|
|||
}
|
||||
|
||||
status = _cairo_cache_lookup (cache, &key, (void **) &entry, &created_entry);
|
||||
if (CAIRO_OK (status) && !created_entry)
|
||||
if (STATUS_OK (status) && !created_entry)
|
||||
_cairo_unscaled_font_reference (&entry->unscaled->base);
|
||||
|
||||
_unlock_global_ft_cache ();
|
||||
if (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return NULL;
|
||||
|
||||
return entry->unscaled;
|
||||
|
|
@ -863,7 +863,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 (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return status;
|
||||
|
||||
face = cairo_ft_scaled_font_lock_face (&scaled_font->base);
|
||||
|
|
|
|||
|
|
@ -1449,7 +1449,7 @@ _cairo_glitz_area_find (cairo_glitz_area_t *area,
|
|||
|
||||
area->state = CAIRO_GLITZ_AREA_DIVIDED;
|
||||
|
||||
if (CAIRO_OK (_cairo_glitz_area_find (area->area[0],
|
||||
if (STATUS_OK (_cairo_glitz_area_find (area->area[0],
|
||||
width, height,
|
||||
kick_out, closure)))
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
|
@ -1466,7 +1466,7 @@ _cairo_glitz_area_find (cairo_glitz_area_t *area,
|
|||
if (area->area[i]->width >= width &&
|
||||
area->area[i]->height >= height)
|
||||
{
|
||||
if (CAIRO_OK (_cairo_glitz_area_find (area->area[i],
|
||||
if (STATUS_OK (_cairo_glitz_area_find (area->area[i],
|
||||
width, height,
|
||||
kick_out, closure)))
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
|
@ -1500,7 +1500,7 @@ _cairo_glitz_area_find (cairo_glitz_area_t *area,
|
|||
|
||||
area->closure = NULL;
|
||||
area->state = CAIRO_GLITZ_AREA_AVAILABLE;
|
||||
if (CAIRO_OK (_cairo_glitz_area_find (area, width, height,
|
||||
if (STATUS_OK (_cairo_glitz_area_find (area, width, height,
|
||||
TRUE, closure)))
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
|
|
|
|||
|
|
@ -364,7 +364,7 @@ _cairo_gstate_get_clip_extents (cairo_gstate_t *gstate,
|
|||
cairo_status_t status;
|
||||
|
||||
status = _cairo_surface_get_extents (gstate->target, rectangle);
|
||||
if (!CAIRO_OK(status))
|
||||
if (!STATUS_OK(status))
|
||||
return status;
|
||||
/* check path extents here */
|
||||
|
||||
|
|
@ -784,11 +784,11 @@ _cairo_gstate_paint (cairo_gstate_t *gstate)
|
|||
cairo_traps_t traps;
|
||||
|
||||
status = _cairo_gstate_set_clip (gstate);
|
||||
if (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return status;
|
||||
|
||||
status = _cairo_gstate_get_clip_extents (gstate, &rectangle);
|
||||
if (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return status;
|
||||
|
||||
box.p1.x = _cairo_fixed_from_int (rectangle.x);
|
||||
|
|
@ -796,7 +796,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 (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return status;
|
||||
|
||||
_cairo_gstate_clip_and_composite_trapezoids (gstate,
|
||||
|
|
@ -884,7 +884,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 (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return status;
|
||||
|
||||
if (pixman_region_intersect (region,
|
||||
|
|
@ -894,7 +894,7 @@ _cairo_gstate_intersect_clip (cairo_gstate_t *gstate,
|
|||
|
||||
pixman_region_destroy (clip_rect);
|
||||
|
||||
if (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
@ -926,7 +926,7 @@ _cairo_gstate_mask (cairo_gstate_t *gstate,
|
|||
int mask_x, mask_y;
|
||||
|
||||
status = _cairo_gstate_set_clip (gstate);
|
||||
if (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return status;
|
||||
|
||||
_get_mask_extents (gstate, mask, &extents);
|
||||
|
|
@ -950,13 +950,13 @@ _cairo_gstate_mask (cairo_gstate_t *gstate,
|
|||
0, 0,
|
||||
0, 0,
|
||||
extents.width, extents.height);
|
||||
if (!CAIRO_OK (status)) {
|
||||
if (!STATUS_OK (status)) {
|
||||
cairo_surface_destroy (intermediate);
|
||||
return status;
|
||||
}
|
||||
|
||||
status = _cairo_gstate_combine_clip_surface (gstate, intermediate, &extents);
|
||||
if (!CAIRO_OK (status)) {
|
||||
if (!STATUS_OK (status)) {
|
||||
cairo_surface_destroy (intermediate);
|
||||
return status;
|
||||
}
|
||||
|
|
@ -1001,7 +1001,7 @@ _cairo_gstate_stroke (cairo_gstate_t *gstate, cairo_path_fixed_t *path)
|
|||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
status = _cairo_gstate_set_clip (gstate);
|
||||
if (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return status;
|
||||
|
||||
_cairo_pen_init (&gstate->pen_regular, gstate->line_width / 2.0, gstate);
|
||||
|
|
@ -1117,7 +1117,7 @@ _clip_and_compute_extents_region (cairo_gstate_t *gstate,
|
|||
cairo_status_t status;
|
||||
|
||||
status = _cairo_gstate_intersect_clip (gstate, trap_region);
|
||||
if (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return status;
|
||||
|
||||
_region_rect_extents (trap_region, extents);
|
||||
|
|
@ -1143,7 +1143,7 @@ _clip_and_compute_extents_arbitrary (cairo_gstate_t *gstate,
|
|||
cairo_status_t status;
|
||||
|
||||
status = _region_new_from_rect (extents, &intersection);
|
||||
if (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return status;
|
||||
|
||||
if (pixman_region_intersect (intersection,
|
||||
|
|
@ -1155,7 +1155,7 @@ _clip_and_compute_extents_arbitrary (cairo_gstate_t *gstate,
|
|||
|
||||
pixman_region_destroy (intersection);
|
||||
|
||||
if (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
@ -1187,14 +1187,14 @@ _composite_trap_region (cairo_gstate_t *gstate,
|
|||
if (num_rects > 1) {
|
||||
|
||||
status = _cairo_surface_can_clip_region (gstate->target);
|
||||
if (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (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 (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
@ -1291,11 +1291,11 @@ _composite_traps_intermediate_surface (cairo_gstate_t *gstate,
|
|||
traps->num_traps);
|
||||
_cairo_pattern_fini (&pattern.base);
|
||||
|
||||
if (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
goto out;
|
||||
|
||||
status = _cairo_gstate_combine_clip_surface (gstate, intermediate, extents);
|
||||
if (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
goto out;
|
||||
|
||||
_cairo_pattern_init_for_surface (&intermediate_pattern, intermediate);
|
||||
|
|
@ -1409,7 +1409,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 (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return status;
|
||||
|
||||
if (trap_region)
|
||||
|
|
@ -1417,7 +1417,7 @@ _cairo_gstate_clip_and_composite_trapezoids (cairo_gstate_t *gstate,
|
|||
else
|
||||
status = _clip_and_compute_extents_arbitrary (gstate, traps, &extents);
|
||||
|
||||
if (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
goto out;
|
||||
|
||||
if (_cairo_rectangle_empty (&extents))
|
||||
|
|
@ -1473,7 +1473,7 @@ _cairo_gstate_fill (cairo_gstate_t *gstate, cairo_path_fixed_t *path)
|
|||
cairo_traps_t traps;
|
||||
|
||||
status = _cairo_gstate_set_clip (gstate);
|
||||
if (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return status;
|
||||
|
||||
status = _cairo_surface_fill_path (gstate->operator,
|
||||
|
|
@ -1642,7 +1642,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 (!CAIRO_OK (status)) {
|
||||
if (!STATUS_OK (status)) {
|
||||
_cairo_traps_fini (&traps);
|
||||
return status;
|
||||
}
|
||||
|
|
@ -1650,13 +1650,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 (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return status;
|
||||
|
||||
/* Check to see if we can represent these traps as a PixRegion. */
|
||||
|
||||
status = _cairo_traps_extract_region (&traps, ®ion);
|
||||
if (!CAIRO_OK (status)) {
|
||||
if (!STATUS_OK (status)) {
|
||||
_cairo_traps_fini (&traps);
|
||||
return status;
|
||||
}
|
||||
|
|
@ -2001,7 +2001,7 @@ _cairo_gstate_show_glyphs (cairo_gstate_t *gstate,
|
|||
cairo_rectangle_t extents;
|
||||
|
||||
status = _cairo_gstate_set_clip (gstate);
|
||||
if (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (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 (CAIRO_OK (status))
|
||||
if (STATUS_OK (status))
|
||||
{
|
||||
if (mask)
|
||||
{
|
||||
status = _cairo_image_surface_set_attributes (mask, &mask_attr);
|
||||
if (CAIRO_OK (status))
|
||||
if (STATUS_OK (status))
|
||||
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 (CAIRO_OK (status))
|
||||
if (STATUS_OK (status))
|
||||
pixman_composite_trapezoids (_pixman_operator (operator),
|
||||
src->pixman_image,
|
||||
dst->pixman_image,
|
||||
|
|
|
|||
|
|
@ -1038,7 +1038,7 @@ _cairo_pattern_acquire_surface_for_surface (cairo_surface_pattern_t *pattern,
|
|||
status = _cairo_surface_acquire_source_image (pattern->surface,
|
||||
&image,
|
||||
&attr->extra);
|
||||
if (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return status;
|
||||
|
||||
*out = &image->base;
|
||||
|
|
|
|||
|
|
@ -1225,7 +1225,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 (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return status;
|
||||
|
||||
id = emit_image_data (dst->document, image);
|
||||
|
|
@ -1400,7 +1400,7 @@ emit_surface_pattern (cairo_pdf_surface_t *dst,
|
|||
}
|
||||
|
||||
status = _cairo_surface_acquire_source_image (pattern->surface, &image, &image_extra);
|
||||
if (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (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) && CAIRO_OK (status))
|
||||
if (fclose (fp) && STATUS_OK (status))
|
||||
status = CAIRO_STATUS_WRITE_ERROR;
|
||||
|
||||
return status;
|
||||
|
|
@ -229,7 +229,7 @@ stream_write_func (png_structp png, png_bytep data, png_size_t size)
|
|||
struct png_write_closure_t *png_closure;
|
||||
|
||||
png_closure = png_get_io_ptr (png);
|
||||
if (!CAIRO_OK (png_closure->write_func (png_closure->closure, data, size)))
|
||||
if (!STATUS_OK (png_closure->write_func (png_closure->closure, data, size)))
|
||||
png_error(png, "Write Error");
|
||||
}
|
||||
|
||||
|
|
@ -435,7 +435,7 @@ stream_read_func (png_structp png, png_bytep data, png_size_t size)
|
|||
struct png_read_closure_t *png_closure;
|
||||
|
||||
png_closure = png_get_io_ptr (png);
|
||||
if (!CAIRO_OK (png_closure->read_func (png_closure->closure, data, size)))
|
||||
if (!STATUS_OK (png_closure->read_func (png_closure->closure, data, size)))
|
||||
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 (!CAIRO_OK (status) || !state.image)
|
||||
if (!STATUS_OK (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 (!CAIRO_OK (status) || !state.image)
|
||||
if (!STATUS_OK (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 (!CAIRO_OK (status) || !state.image)
|
||||
if (!STATUS_OK (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 (!CAIRO_OK(status))
|
||||
if (!STATUS_OK(status))
|
||||
return status;
|
||||
}
|
||||
#endif
|
||||
if (surface->backend->set_clip_region != NULL) {
|
||||
status = surface->backend->set_clip_region (surface, NULL);
|
||||
if (!CAIRO_OK(status))
|
||||
if (!STATUS_OK(status))
|
||||
return status;
|
||||
}
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ _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 (!CAIRO_OK (cairo_matrix_invert (&scaled_font->device_to_logical)))
|
||||
if (!STATUS_OK (cairo_matrix_invert (&scaled_font->device_to_logical)))
|
||||
cairo_matrix_init_identity (&scaled_font->device_to_logical);
|
||||
}
|
||||
|
||||
|
|
@ -367,7 +367,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 (!CAIRO_OK (status)) {
|
||||
if (!STATUS_OK (status)) {
|
||||
SelectObject (hdc, old_hfont);
|
||||
return status;
|
||||
}
|
||||
|
|
@ -399,7 +399,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 (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return status;
|
||||
|
||||
if (face_name_len > LF_FACESIZE - 1) {
|
||||
|
|
@ -496,7 +496,7 @@ _cairo_win32_scaled_font_text_to_glyphs (void *abstract_font,
|
|||
HDC hdc = NULL;
|
||||
|
||||
status = _cairo_utf8_to_utf16 (utf8, -1, &utf16, &n16);
|
||||
if (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return status;
|
||||
|
||||
gcp_results.lStructSize = sizeof (GCP_RESULTS);
|
||||
|
|
@ -518,7 +518,7 @@ _cairo_win32_scaled_font_text_to_glyphs (void *abstract_font,
|
|||
}
|
||||
|
||||
status = cairo_win32_scaled_font_select_font (&scaled_font->base, hdc);
|
||||
if (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
goto FAIL1;
|
||||
|
||||
while (TRUE) {
|
||||
|
|
@ -610,7 +610,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 (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return status;
|
||||
GetTextMetrics (hdc, &metrics);
|
||||
cairo_win32_scaled_font_done_font (&scaled_font->base);
|
||||
|
|
@ -629,7 +629,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 (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return status;
|
||||
GetTextMetrics (hdc, &metrics);
|
||||
_cairo_win32_scaled_font_done_unscaled_font (&scaled_font->base);
|
||||
|
|
@ -672,7 +672,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 (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return status;
|
||||
GetGlyphOutlineW (hdc, glyphs[0].index, GGO_METRICS | GGO_GLYPH_INDEX,
|
||||
&metrics, 0, NULL, &matrix);
|
||||
|
|
@ -745,7 +745,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 (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return status;
|
||||
|
||||
for (i = 0; i < num_glyphs; i++) {
|
||||
|
|
@ -844,7 +844,7 @@ _add_glyph (cairo_glyph_state_t *state,
|
|||
|
||||
if (logical_y != state->last_y) {
|
||||
cairo_status_t status = _flush_glyphs (state);
|
||||
if (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
return status;
|
||||
state->start_x = logical_x;
|
||||
}
|
||||
|
|
@ -890,7 +890,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 (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
goto FAIL1;
|
||||
|
||||
SetTextColor (surface->dc, color);
|
||||
|
|
@ -902,7 +902,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 (!CAIRO_OK (status))
|
||||
if (!STATUS_OK (status))
|
||||
goto FAIL2;
|
||||
}
|
||||
|
||||
|
|
@ -1231,7 +1231,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 (!CAIRO_OK (status)) {
|
||||
if (!STATUS_OK (status)) {
|
||||
SetGraphicsMode (hdc, old_mode);
|
||||
SelectObject (hdc, old_hfont);
|
||||
return status;
|
||||
|
|
|
|||
|
|
@ -404,7 +404,7 @@ _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 (CAIRO_OK (status)) {
|
||||
if (STATUS_OK (status)) {
|
||||
*image_out = (cairo_image_surface_t *)local->image;
|
||||
*image_extra = local;
|
||||
}
|
||||
|
|
@ -475,7 +475,7 @@ _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 (CAIRO_OK (status)) {
|
||||
if (STATUS_OK (status)) {
|
||||
*image_out = (cairo_image_surface_t *)local->image;
|
||||
*image_extra = local;
|
||||
|
||||
|
|
|
|||
|
|
@ -850,12 +850,12 @@ _cairo_xcb_surface_composite (cairo_operator_t operator,
|
|||
return status;
|
||||
|
||||
status = _cairo_xcb_surface_set_attributes (src, &src_attr);
|
||||
if (CAIRO_OK (status))
|
||||
if (STATUS_OK (status))
|
||||
{
|
||||
if (mask)
|
||||
{
|
||||
status = _cairo_xcb_surface_set_attributes (mask, &mask_attr);
|
||||
if (CAIRO_OK (status))
|
||||
if (STATUS_OK (status))
|
||||
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 (CAIRO_OK (status))
|
||||
if (STATUS_OK (status))
|
||||
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 (CAIRO_OK (status)) {
|
||||
if (STATUS_OK (status)) {
|
||||
_cairo_xlib_surface_ensure_dst_picture (dst);
|
||||
if (mask) {
|
||||
status = _cairo_xlib_surface_set_attributes (mask, &mask_attr);
|
||||
if (CAIRO_OK (status))
|
||||
if (STATUS_OK (status))
|
||||
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 (CAIRO_OK (status))
|
||||
if (STATUS_OK (status))
|
||||
XRenderCompositeTrapezoids (dst->dpy,
|
||||
_render_operator (operator),
|
||||
src->src_picture, dst->dst_picture,
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ typedef enum cairo_int_status {
|
|||
CAIRO_INT_STATUS_UNSUPPORTED
|
||||
} cairo_int_status_t;
|
||||
|
||||
#define CAIRO_OK(status) ((status) == CAIRO_STATUS_SUCCESS)
|
||||
#define STATUS_OK(status) ((status) == CAIRO_STATUS_SUCCESS)
|
||||
|
||||
typedef enum cairo_direction {
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue