diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2006-12-11 01:39:51 -0500 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2006-12-11 01:39:51 -0500 |
commit | 5a9642c5746fd677aed35ce620ce90b1029b1a0c (patch) | |
tree | 8b72cfdc3f1048ad582d4303558c9b67847a9c03 | |
parent | 70695f5c62b89b417c1e8b42451470a5a8920bf3 (diff) |
Add/remove const to cairo_glyph_t* arguments consistently
The rule is: cairo_glyph_t* is always passed as const for measurement
purposes. This was not reflected in our public api previously. Fixed
Showing glyphs used to have cairo_glyph_t* always as const. With this
changed, it is only const on cairo_t and cairo_gstate_t operations.
cairo_surface_t, cairo_scaled_font_t, and individual backends receive
cairo_glyph_t* as non-const. The desired semantics is that they may modify
the contents of the array as long as they do not return
CAIRO_STATUS_UNSUPPORTED. This makes it possible to avoid copying the glyph
array again and again, and edit it in-place. Backends are in fact free to use
the array as a generic buffer as they see fit.
-rw-r--r-- | src/cairo-analysis-surface.c | 2 | ||||
-rw-r--r-- | src/cairo-atsui-font.c | 2 | ||||
-rw-r--r-- | src/cairo-directfb-surface.c | 2 | ||||
-rw-r--r-- | src/cairo-glitz-surface.c | 2 | ||||
-rw-r--r-- | src/cairo-gstate.c | 12 | ||||
-rw-r--r-- | src/cairo-meta-surface.c | 2 | ||||
-rw-r--r-- | src/cairo-nquartz-surface.c | 2 | ||||
-rw-r--r-- | src/cairo-paginated-surface.c | 2 | ||||
-rw-r--r-- | src/cairo-pdf-surface.c | 2 | ||||
-rw-r--r-- | src/cairo-ps-surface.c | 2 | ||||
-rwxr-xr-x | src/cairo-scaled-font.c | 4 | ||||
-rw-r--r-- | src/cairo-surface-fallback-private.h | 2 | ||||
-rw-r--r-- | src/cairo-surface-fallback.c | 4 | ||||
-rw-r--r-- | src/cairo-surface.c | 4 | ||||
-rw-r--r-- | src/cairo-svg-surface.c | 2 | ||||
-rw-r--r-- | src/cairo-win32-font.c | 2 | ||||
-rw-r--r-- | src/cairo-win32-surface.c | 2 | ||||
-rw-r--r-- | src/cairo-xcb-surface.c | 4 | ||||
-rw-r--r-- | src/cairo-xlib-surface.c | 4 | ||||
-rw-r--r-- | src/cairo.c | 4 | ||||
-rw-r--r-- | src/cairo.h | 6 | ||||
-rwxr-xr-x | src/cairoint.h | 28 | ||||
-rw-r--r-- | src/test-meta-surface.c | 2 | ||||
-rw-r--r-- | src/test-paginated-surface.c | 2 |
24 files changed, 47 insertions, 53 deletions
diff --git a/src/cairo-analysis-surface.c b/src/cairo-analysis-surface.c index fd764c65c..a89636efa 100644 --- a/src/cairo-analysis-surface.c +++ b/src/cairo-analysis-surface.c @@ -154,7 +154,7 @@ static cairo_int_status_t _cairo_analysis_surface_show_glyphs (void *abstract_surface, cairo_operator_t op, cairo_pattern_t *source, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs, cairo_scaled_font_t *scaled_font) { diff --git a/src/cairo-atsui-font.c b/src/cairo-atsui-font.c index 973160daa..2927caa99 100644 --- a/src/cairo-atsui-font.c +++ b/src/cairo-atsui-font.c @@ -578,7 +578,7 @@ _cairo_atsui_font_old_show_glyphs (void *abstract_font, int dest_y, unsigned int width, unsigned int height, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs) { cairo_atsui_font_t *font = abstract_font; diff --git a/src/cairo-directfb-surface.c b/src/cairo-directfb-surface.c index fc6cbefd9..46a4c7f6a 100644 --- a/src/cairo-directfb-surface.c +++ b/src/cairo-directfb-surface.c @@ -1450,7 +1450,7 @@ static cairo_int_status_t _cairo_directfb_surface_show_glyphs ( void *abstract_dst, cairo_operator_t op, cairo_pattern_t *pattern, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs, cairo_scaled_font_t *scaled_font) { diff --git a/src/cairo-glitz-surface.c b/src/cairo-glitz-surface.c index a57951195..3b2369113 100644 --- a/src/cairo-glitz-surface.c +++ b/src/cairo-glitz-surface.c @@ -1909,7 +1909,7 @@ _cairo_glitz_surface_old_show_glyphs (cairo_scaled_font_t *scaled_font, int dst_y, unsigned int width, unsigned int height, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs) { cairo_glitz_surface_attributes_t attributes; diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c index d04c33281..ab3254559 100644 --- a/src/cairo-gstate.c +++ b/src/cairo-gstate.c @@ -65,7 +65,7 @@ static void _cairo_gstate_transform_glyphs_to_backend (cairo_gstate_t *gstate, const cairo_glyph_t *glyphs, int num_glyphs, - cairo_glyph_t *transformed_glyphs); + cairo_glyph_t *transformed_glyphs); /** * _cairo_gstate_create: @@ -1447,7 +1447,7 @@ _cairo_gstate_set_font_face (cairo_gstate_t *gstate, cairo_status_t _cairo_gstate_glyph_extents (cairo_gstate_t *gstate, - cairo_glyph_t *glyphs, + const cairo_glyph_t *glyphs, int num_glyphs, cairo_text_extents_t *extents) { @@ -1507,10 +1507,10 @@ _cairo_gstate_show_glyphs (cairo_gstate_t *gstate, } cairo_status_t -_cairo_gstate_glyph_path (cairo_gstate_t *gstate, - cairo_glyph_t *glyphs, - int num_glyphs, - cairo_path_fixed_t *path) +_cairo_gstate_glyph_path (cairo_gstate_t *gstate, + const cairo_glyph_t *glyphs, + int num_glyphs, + cairo_path_fixed_t *path) { cairo_status_t status; cairo_glyph_t *transformed_glyphs = NULL; diff --git a/src/cairo-meta-surface.c b/src/cairo-meta-surface.c index d6beaf007..a82ab8fa8 100644 --- a/src/cairo-meta-surface.c +++ b/src/cairo-meta-surface.c @@ -416,7 +416,7 @@ static cairo_int_status_t _cairo_meta_surface_show_glyphs (void *abstract_surface, cairo_operator_t op, cairo_pattern_t *source, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs, cairo_scaled_font_t *scaled_font) { diff --git a/src/cairo-nquartz-surface.c b/src/cairo-nquartz-surface.c index 5e826161e..15b3d61b4 100644 --- a/src/cairo-nquartz-surface.c +++ b/src/cairo-nquartz-surface.c @@ -1304,7 +1304,7 @@ static cairo_int_status_t _cairo_nquartz_surface_show_glyphs (void *abstract_surface, cairo_operator_t op, cairo_pattern_t *source, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs, cairo_scaled_font_t *scaled_font) { diff --git a/src/cairo-paginated-surface.c b/src/cairo-paginated-surface.c index d4977786f..b313ac1f5 100644 --- a/src/cairo-paginated-surface.c +++ b/src/cairo-paginated-surface.c @@ -437,7 +437,7 @@ static cairo_int_status_t _cairo_paginated_surface_show_glyphs (void *abstract_surface, cairo_operator_t op, cairo_pattern_t *source, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs, cairo_scaled_font_t *scaled_font) { diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c index 25d367eed..a59cd99c6 100644 --- a/src/cairo-pdf-surface.c +++ b/src/cairo-pdf-surface.c @@ -2720,7 +2720,7 @@ static cairo_int_status_t _cairo_pdf_surface_show_glyphs (void *abstract_surface, cairo_operator_t op, cairo_pattern_t *source, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs, cairo_scaled_font_t *scaled_font) { diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c index 75fe83e18..6d1afe996 100644 --- a/src/cairo-ps-surface.c +++ b/src/cairo-ps-surface.c @@ -2136,7 +2136,7 @@ static cairo_int_status_t _cairo_ps_surface_show_glyphs (void *abstract_surface, cairo_operator_t op, cairo_pattern_t *source, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs, cairo_scaled_font_t *scaled_font) { diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c index 0b060fdfe..b800cf920 100755 --- a/src/cairo-scaled-font.c +++ b/src/cairo-scaled-font.c @@ -698,7 +698,7 @@ cairo_scaled_font_text_extents (cairo_scaled_font_t *scaled_font, **/ void cairo_scaled_font_glyph_extents (cairo_scaled_font_t *scaled_font, - cairo_glyph_t *glyphs, + const cairo_glyph_t *glyphs, int num_glyphs, cairo_text_extents_t *extents) { @@ -891,7 +891,7 @@ _cairo_scaled_font_show_glyphs (cairo_scaled_font_t *scaled_font, int dest_y, unsigned int width, unsigned int height, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs) { cairo_status_t status; diff --git a/src/cairo-surface-fallback-private.h b/src/cairo-surface-fallback-private.h index 89a11cb6f..e0f83c403 100644 --- a/src/cairo-surface-fallback-private.h +++ b/src/cairo-surface-fallback-private.h @@ -74,7 +74,7 @@ cairo_private cairo_status_t _cairo_surface_fallback_show_glyphs (cairo_surface_t *surface, cairo_operator_t op, cairo_pattern_t *source, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs, cairo_scaled_font_t *scaled_font); diff --git a/src/cairo-surface-fallback.c b/src/cairo-surface-fallback.c index 2d234111c..02033c8c1 100644 --- a/src/cairo-surface-fallback.c +++ b/src/cairo-surface-fallback.c @@ -839,7 +839,7 @@ _cairo_surface_fallback_fill (cairo_surface_t *surface, typedef struct { cairo_scaled_font_t *font; - const cairo_glyph_t *glyphs; + cairo_glyph_t *glyphs; int num_glyphs; } cairo_show_glyphs_info_t; @@ -907,7 +907,7 @@ cairo_status_t _cairo_surface_fallback_show_glyphs (cairo_surface_t *surface, cairo_operator_t op, cairo_pattern_t *source, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs, cairo_scaled_font_t *scaled_font) { diff --git a/src/cairo-surface.c b/src/cairo-surface.c index dfcf39d0a..669097142 100644 --- a/src/cairo-surface.c +++ b/src/cairo-surface.c @@ -1795,7 +1795,7 @@ cairo_status_t _cairo_surface_show_glyphs (cairo_surface_t *surface, cairo_operator_t op, cairo_pattern_t *source, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs, cairo_scaled_font_t *scaled_font) { @@ -1873,7 +1873,7 @@ _cairo_surface_old_show_glyphs (cairo_scaled_font_t *scaled_font, int dest_y, unsigned int width, unsigned int height, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs) { cairo_status_t status; diff --git a/src/cairo-svg-surface.c b/src/cairo-svg-surface.c index 0ca0e72f3..573fb3c06 100644 --- a/src/cairo-svg-surface.c +++ b/src/cairo-svg-surface.c @@ -1608,7 +1608,7 @@ static cairo_int_status_t _cairo_svg_surface_show_glyphs (void *abstract_surface, cairo_operator_t op, cairo_pattern_t *pattern, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs, cairo_scaled_font_t *scaled_font) { diff --git a/src/cairo-win32-font.c b/src/cairo-win32-font.c index 58b4dd1bb..139a73b34 100644 --- a/src/cairo-win32-font.c +++ b/src/cairo-win32-font.c @@ -1151,7 +1151,7 @@ _cairo_win32_scaled_font_show_glyphs (void *abstract_font, int dest_y, unsigned int width, unsigned int height, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs) { cairo_win32_scaled_font_t *scaled_font = abstract_font; diff --git a/src/cairo-win32-surface.c b/src/cairo-win32-surface.c index a90f867a8..8b34549cc 100644 --- a/src/cairo-win32-surface.c +++ b/src/cairo-win32-surface.c @@ -1473,7 +1473,7 @@ static cairo_int_status_t _cairo_win32_surface_show_glyphs (void *surface, cairo_operator_t op, cairo_pattern_t *source, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs, cairo_scaled_font_t *scaled_font) { diff --git a/src/cairo-xcb-surface.c b/src/cairo-xcb-surface.c index 9c34879f9..8b8ba1d5b 100644 --- a/src/cairo-xcb-surface.c +++ b/src/cairo-xcb-surface.c @@ -1574,7 +1574,7 @@ static cairo_int_status_t _cairo_xcb_surface_show_glyphs (void *abstract_dst, cairo_operator_t op, cairo_pattern_t *src_pattern, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs, cairo_scaled_font_t *scaled_font); @@ -2260,7 +2260,7 @@ static cairo_int_status_t _cairo_xcb_surface_show_glyphs (void *abstract_dst, cairo_operator_t op, cairo_pattern_t *src_pattern, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs, cairo_scaled_font_t *scaled_font) { diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c index 4e7f6404c..5482a2f0a 100644 --- a/src/cairo-xlib-surface.c +++ b/src/cairo-xlib-surface.c @@ -69,7 +69,7 @@ static cairo_int_status_t _cairo_xlib_surface_show_glyphs (void *abstract_dst, cairo_operator_t op, cairo_pattern_t *src_pattern, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs, cairo_scaled_font_t *scaled_font); @@ -2689,7 +2689,7 @@ static cairo_int_status_t _cairo_xlib_surface_show_glyphs (void *abstract_dst, cairo_operator_t op, cairo_pattern_t *src_pattern, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs, cairo_scaled_font_t *scaled_font) { diff --git a/src/cairo.c b/src/cairo.c index b8747771d..7546d7a2e 100644 --- a/src/cairo.c +++ b/src/cairo.c @@ -2613,7 +2613,7 @@ cairo_text_extents (cairo_t *cr, **/ void cairo_glyph_extents (cairo_t *cr, - cairo_glyph_t *glyphs, + const cairo_glyph_t *glyphs, int num_glyphs, cairo_text_extents_t *extents) { @@ -2749,7 +2749,7 @@ cairo_text_path (cairo_t *cr, const char *utf8) } void -cairo_glyph_path (cairo_t *cr, cairo_glyph_t *glyphs, int num_glyphs) +cairo_glyph_path (cairo_t *cr, const cairo_glyph_t *glyphs, int num_glyphs) { if (cr->status) return; diff --git a/src/cairo.h b/src/cairo.h index 1b599d541..5e58244d4 100644 --- a/src/cairo.h +++ b/src/cairo.h @@ -954,7 +954,7 @@ cairo_text_extents (cairo_t *cr, cairo_public void cairo_glyph_extents (cairo_t *cr, - cairo_glyph_t *glyphs, + const cairo_glyph_t *glyphs, int num_glyphs, cairo_text_extents_t *extents); @@ -962,7 +962,7 @@ cairo_public void cairo_text_path (cairo_t *cr, const char *utf8); cairo_public void -cairo_glyph_path (cairo_t *cr, cairo_glyph_t *glyphs, int num_glyphs); +cairo_glyph_path (cairo_t *cr, const cairo_glyph_t *glyphs, int num_glyphs); /* Generic identifier for a font style */ @@ -1062,7 +1062,7 @@ cairo_scaled_font_text_extents (cairo_scaled_font_t *scaled_font, cairo_public void cairo_scaled_font_glyph_extents (cairo_scaled_font_t *scaled_font, - cairo_glyph_t *glyphs, + const cairo_glyph_t *glyphs, int num_glyphs, cairo_text_extents_t *extents); diff --git a/src/cairoint.h b/src/cairoint.h index e996a1c4d..b481d4594 100755 --- a/src/cairoint.h +++ b/src/cairoint.h @@ -632,7 +632,7 @@ struct _cairo_scaled_font_backend { int dest_y, unsigned int width, unsigned int height, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs); cairo_int_status_t @@ -855,7 +855,7 @@ struct _cairo_surface_backend { int dest_y, unsigned int width, unsigned int height, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs); void @@ -917,7 +917,7 @@ struct _cairo_surface_backend { (*show_glyphs) (void *surface, cairo_operator_t op, cairo_pattern_t *source, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs, cairo_scaled_font_t *scaled_font); @@ -1428,7 +1428,7 @@ _cairo_gstate_text_to_glyphs (cairo_gstate_t *font, cairo_private cairo_status_t _cairo_gstate_glyph_extents (cairo_gstate_t *gstate, - cairo_glyph_t *glyphs, + const cairo_glyph_t *glyphs, int num_glyphs, cairo_text_extents_t *extents); @@ -1438,10 +1438,10 @@ _cairo_gstate_show_glyphs (cairo_gstate_t *gstate, int num_glyphs); cairo_private cairo_status_t -_cairo_gstate_glyph_path (cairo_gstate_t *gstate, - cairo_glyph_t *glyphs, - int num_glyphs, - cairo_path_fixed_t *path); +_cairo_gstate_glyph_path (cairo_gstate_t *gstate, + const cairo_glyph_t *glyphs, + int num_glyphs, + cairo_path_fixed_t *path); cairo_private cairo_bool_t _cairo_operator_bounded_by_mask (cairo_operator_t op); @@ -1685,12 +1685,6 @@ _cairo_scaled_font_text_to_glyphs (cairo_scaled_font_t *scaled_font, int *num_glyphs); cairo_private cairo_status_t -_cairo_scaled_font_glyph_extents (cairo_scaled_font_t *scaled_font, - cairo_glyph_t *glyphs, - int num_glyphs, - cairo_text_extents_t *extents); - -cairo_private cairo_status_t _cairo_scaled_font_glyph_device_extents (cairo_scaled_font_t *scaled_font, const cairo_glyph_t *glyphs, int num_glyphs, @@ -1707,7 +1701,7 @@ _cairo_scaled_font_show_glyphs (cairo_scaled_font_t *scaled_font, int dest_y, unsigned int width, unsigned int height, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs); cairo_private cairo_status_t @@ -1858,7 +1852,7 @@ cairo_private cairo_status_t _cairo_surface_show_glyphs (cairo_surface_t *surface, cairo_operator_t op, cairo_pattern_t *source, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs, cairo_scaled_font_t *scaled_font); @@ -1957,7 +1951,7 @@ _cairo_surface_old_show_glyphs (cairo_scaled_font_t *scaled_font, int dest_y, unsigned int width, unsigned int height, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs); cairo_private cairo_status_t diff --git a/src/test-meta-surface.c b/src/test-meta-surface.c index d50119fdf..7939b6e93 100644 --- a/src/test-meta-surface.c +++ b/src/test-meta-surface.c @@ -247,7 +247,7 @@ static cairo_int_status_t _test_meta_surface_show_glyphs (void *abstract_surface, cairo_operator_t op, cairo_pattern_t *source, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs, cairo_scaled_font_t *scaled_font) { diff --git a/src/test-paginated-surface.c b/src/test-paginated-surface.c index 4548df561..544efcf5a 100644 --- a/src/test-paginated-surface.c +++ b/src/test-paginated-surface.c @@ -228,7 +228,7 @@ static cairo_int_status_t _test_paginated_surface_show_glyphs (void *abstract_surface, cairo_operator_t op, cairo_pattern_t *source, - const cairo_glyph_t *glyphs, + cairo_glyph_t *glyphs, int num_glyphs, cairo_scaled_font_t *scaled_font) { |