diff options
author | Carl Worth <cworth@cworth.org> | 2003-12-11 12:43:58 +0000 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2003-12-11 12:43:58 +0000 |
commit | 5b38b14ff2bf8cfc74f5f14339d3aeff0d01a769 (patch) | |
tree | bb101b09d14be65f6ba395fb41fd27ab248983dd | |
parent | 18ae004832b6bf3d12a8ee4e9199bc847a46031f (diff) |
Directly fold in slim stuff rather than depending on it from an external package.
Switch from libic to libpixman.
Include pixman.h not ic.h. (__external_linkage): Directly fold in slim stuff rather than depending on it from an external package.
Look for libpixman instead of libic and slim.
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | cairo.pc.in | 2 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/cairo-image-surface.c | 120 | ||||
-rw-r--r-- | src/cairo-ps-surface.c | 2 | ||||
-rw-r--r-- | src/cairo.h | 15 | ||||
-rw-r--r-- | src/cairo_image_surface.c | 120 | ||||
-rw-r--r-- | src/cairo_ps_surface.c | 2 | ||||
-rw-r--r-- | src/cairoint.h | 30 |
10 files changed, 177 insertions, 134 deletions
@@ -1,3 +1,19 @@ +2003-12-11 Carl Worth <cworth@isi.edu> + + * src/cairoint.h (slim_hidden_proto1): Directly fold in slim stuff + rather than depending on it from an external package. + + * src/cairo_ps_surface.c (_cairo_ps_surface_copy_page): + * src/cairo_image_surface.c: Switch from libic to libpixman. + + * src/cairo.h: Include pixman.h not ic.h. + (__external_linkage): Directly fold in slim stuff rather than + depending on it from an external package. + + * configure.in (PKG_CHECK_MODULES): + * cairo.pc.in (Requires): Look for libpixman instead of libic and + slim. + 2003-12-11 Andrew Chant <andrew.chant@utoronto.ca> * cairo_select_font: diff --git a/cairo.pc.in b/cairo.pc.in index 39b8dd8d..6adeb90c 100644 --- a/cairo.pc.in +++ b/cairo.pc.in @@ -7,7 +7,7 @@ Name: cairo Description: Multi-platform 2D graphics library Version: @VERSION@ -Requires: fontconfig libic slim @XRENDER_REQUIRES@ +Requires: fontconfig libpixman @XRENDER_REQUIRES@ Libs: -L${libdir} -lcairo -lm -lz @FREETYPE_LIBS@ Cflags: -I${includedir} @FREETYPE_CFLAGS@ diff --git a/configure.in b/configure.in index c6d0d6cf..8ff03736 100644 --- a/configure.in +++ b/configure.in @@ -56,7 +56,7 @@ AM_CONDITIONAL(CAIRO_HAS_XLIB_SURFACE, test x$have_x = xyes) dnl =========================================================================== PKG_CHECK_MODULES(FONTCONFIG, fontconfig) -PKG_CHECK_MODULES(CAIRO, slim >= 0.2.0 libic >= 0.1.3) +PKG_CHECK_MODULES(CAIRO, libpixman >= 0.1.0) # Test for freetype2 separate from pkg-config since at least up to # 2003-06-07, there was no freetype2.pc in the release. diff --git a/src/Makefile.am b/src/Makefile.am index 2ed7341b..fd42dc77 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -34,6 +34,6 @@ libcairo_la_SOURCES = \ libcairo_la_LDFLAGS = -version-info @VERSION_INFO@ -INCLUDES = $(CAIRO_CFLAGS) $(FONTCONFIG_CFLAGS) $(XRENDER_CFLAGS) $(X_CFLAGS) +INCLUDES = -I$(srcdir) $(CAIRO_CFLAGS) $(FONTCONFIG_CFLAGS) $(XRENDER_CFLAGS) $(X_CFLAGS) libcairo_la_LIBADD = $(CAIRO_LIBS) $(FONTCONFIG_LIBS) $(XRENDER_LIBS) $(X_LIBS) -lm diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c index efa54d26..7ee6a943 100644 --- a/src/cairo-image-surface.c +++ b/src/cairo-image-surface.c @@ -45,7 +45,7 @@ _cairo_format_bpp (cairo_format_t format) } static cairo_image_surface_t * -_cairo_image_surface_create_for_ic_image (IcImage *ic_image) +_cairo_image_surface_create_for_ic_image (pixman_image_t *ic_image) { cairo_image_surface_t *surface; @@ -57,13 +57,13 @@ _cairo_image_surface_create_for_ic_image (IcImage *ic_image) surface->ic_image = ic_image; - surface->data = (char *) IcImageGetData (ic_image); + surface->data = (char *) pixman_image_get_data (ic_image); surface->owns_data = 0; - surface->width = IcImageGetWidth (ic_image); - surface->height = IcImageGetHeight (ic_image); - surface->stride = IcImageGetStride (ic_image); - surface->depth = IcImageGetDepth (ic_image); + surface->width = pixman_image_get_width (ic_image); + surface->height = pixman_image_get_height (ic_image); + surface->stride = pixman_image_get_stride (ic_image); + surface->depth = pixman_image_get_depth (ic_image); return surface; } @@ -76,10 +76,10 @@ _cairo_image_surface_create_with_masks (char *data, int stride) { cairo_image_surface_t *surface; - IcFormat *ic_format; - IcImage *ic_image; + pixman_format_t *ic_format; + pixman_image_t *ic_image; - ic_format = IcFormatCreateMasks (format->bpp, + ic_format = pixman_format_create_masks (format->bpp, format->alpha_mask, format->red_mask, format->green_mask, @@ -88,10 +88,10 @@ _cairo_image_surface_create_with_masks (char *data, if (ic_format == NULL) return NULL; - ic_image = IcImageCreateForData ((IcBits *) data, ic_format, + ic_image = pixman_image_create_for_data ((pixman_bits_t *) data, ic_format, width, height, format->bpp, stride); - IcFormatDestroy (ic_format); + pixman_format_destroy (ic_format); if (ic_image == NULL) return NULL; @@ -101,22 +101,22 @@ _cairo_image_surface_create_with_masks (char *data, return surface; } -static IcFormat * +static pixman_format_t * _create_ic_format (cairo_format_t format) { switch (format) { case CAIRO_FORMAT_A1: - return IcFormatCreate (IcFormatNameA1); + return pixman_format_create (PIXMAN_FORMAT_NAME_A1); break; case CAIRO_FORMAT_A8: - return IcFormatCreate (IcFormatNameA8); + return pixman_format_create (PIXMAN_FORMAT_NAME_A8); break; case CAIRO_FORMAT_RGB24: - return IcFormatCreate (IcFormatNameRGB24); + return pixman_format_create (PIXMAN_FORMAT_NAME_RG_B24); break; case CAIRO_FORMAT_ARGB32: default: - return IcFormatCreate (IcFormatNameARGB32); + return pixman_format_create (PIXMAN_FORMAT_NAME_AR_GB32); break; } } @@ -127,16 +127,16 @@ cairo_image_surface_create (cairo_format_t format, int height) { cairo_image_surface_t *surface; - IcFormat *ic_format; - IcImage *ic_image; + pixman_format_t *ic_format; + pixman_image_t *ic_image; ic_format = _create_ic_format (format); if (ic_format == NULL) return NULL; - ic_image = IcImageCreate (ic_format, width, height); + ic_image = pixman_image_create (ic_format, width, height); - IcFormatDestroy (ic_format); + pixman_format_destroy (ic_format); if (ic_image == NULL) return NULL; @@ -154,19 +154,19 @@ cairo_image_surface_create_for_data (char *data, int stride) { cairo_image_surface_t *surface; - IcFormat *ic_format; - IcImage *ic_image; + pixman_format_t *ic_format; + pixman_image_t *ic_image; ic_format = _create_ic_format (format); if (ic_format == NULL) return NULL; - ic_image = IcImageCreateForData ((IcBits *) data, ic_format, + ic_image = pixman_image_create_for_data ((pixman_bits_t *) data, ic_format, width, height, _cairo_format_bpp (format), stride); - IcFormatDestroy (ic_format); + pixman_format_destroy (ic_format); if (ic_image == NULL) return NULL; @@ -191,7 +191,7 @@ _cairo_image_abstract_surface_destroy (void *abstract_surface) cairo_image_surface_t *surface = abstract_surface; if (surface->ic_image) - IcImageDestroy (surface->ic_image); + pixman_image_destroy (surface->ic_image); if (surface->owns_data) { free (surface->data); @@ -247,7 +247,7 @@ cairo_status_t _cairo_image_surface_set_matrix (cairo_image_surface_t *surface, cairo_matrix_t *matrix) { - IcTransform ic_transform; + pixman_transform_t ic_transform; ic_transform.matrix[0][0] = _cairo_fixed_from_double (matrix->m[0][0]); ic_transform.matrix[0][1] = _cairo_fixed_from_double (matrix->m[1][0]); @@ -261,7 +261,7 @@ _cairo_image_surface_set_matrix (cairo_image_surface_t *surface, ic_transform.matrix[2][1] = 0; ic_transform.matrix[2][2] = _cairo_fixed_from_double (1); - IcImageSetTransform (surface->ic_image, &ic_transform); + pixman_image_set_transform (surface->ic_image, &ic_transform); return CAIRO_STATUS_SUCCESS; } @@ -277,29 +277,29 @@ _cairo_image_abstract_surface_set_filter (void *abstract_surface, cairo_filter_t cairo_status_t _cairo_image_surface_set_filter (cairo_image_surface_t *surface, cairo_filter_t filter) { - IcFilter ic_filter; + pixman_filter_t ic_filter; switch (filter) { case CAIRO_FILTER_FAST: - ic_filter = IcFilterFast; + ic_filter = PIXMAN_FILTER_FAST; break; case CAIRO_FILTER_GOOD: - ic_filter = IcFilterGood; + ic_filter = PIXMAN_FILTER_GOOD; break; case CAIRO_FILTER_BEST: - ic_filter = IcFilterBest; + ic_filter = PIXMAN_FILTER_BEST; break; case CAIRO_FILTER_NEAREST: - ic_filter = IcFilterNearest; + ic_filter = PIXMAN_FILTER_NEAREST; break; case CAIRO_FILTER_BILINEAR: - ic_filter = IcFilterBilinear; + ic_filter = PIXMAN_FILTER_BILINEAR; break; default: - ic_filter = IcFilterBest; + ic_filter = PIXMAN_FILTER_BEST; } - IcImageSetFilter (surface->ic_image, ic_filter); + pixman_image_set_filter (surface->ic_image, ic_filter); return CAIRO_STATUS_SUCCESS; } @@ -314,45 +314,45 @@ _cairo_image_abstract_surface_set_repeat (void *abstract_surface, int repeat) cairo_status_t _cairo_image_surface_set_repeat (cairo_image_surface_t *surface, int repeat) { - IcImageSetRepeat (surface->ic_image, repeat); + pixman_image_set_repeat (surface->ic_image, repeat); return CAIRO_STATUS_SUCCESS; } -static IcOperator +static pixman_operator_t _ic_operator (cairo_operator_t operator) { switch (operator) { case CAIRO_OPERATOR_CLEAR: - return IcOperatorClear; + return PIXMAN_OPERATOR_CLEAR; case CAIRO_OPERATOR_SRC: - return IcOperatorSrc; + return PIXMAN_OPERATOR_SRC; case CAIRO_OPERATOR_DST: - return IcOperatorDst; + return PIXMAN_OPERATOR_DST; case CAIRO_OPERATOR_OVER: - return IcOperatorOver; + return PIXMAN_OPERATOR_OVER; case CAIRO_OPERATOR_OVER_REVERSE: - return IcOperatorOverReverse; + return PIXMAN_OPERATOR_OVER_REVERSE; case CAIRO_OPERATOR_IN: - return IcOperatorIn; + return PIXMAN_OPERATOR_IN; case CAIRO_OPERATOR_IN_REVERSE: - return IcOperatorInReverse; + return PIXMAN_OPERATOR_IN_REVERSE; case CAIRO_OPERATOR_OUT: - return IcOperatorOut; + return PIXMAN_OPERATOR_OUT; case CAIRO_OPERATOR_OUT_REVERSE: - return IcOperatorOutReverse; + return PIXMAN_OPERATOR_OUT_REVERSE; case CAIRO_OPERATOR_ATOP: - return IcOperatorAtop; + return PIXMAN_OPERATOR_ATOP; case CAIRO_OPERATOR_ATOP_REVERSE: - return IcOperatorAtopReverse; + return PIXMAN_OPERATOR_ATOP_REVERSE; case CAIRO_OPERATOR_XOR: - return IcOperatorXor; + return PIXMAN_OPERATOR_XOR; case CAIRO_OPERATOR_ADD: - return IcOperatorAdd; + return PIXMAN_OPERATOR_ADD; case CAIRO_OPERATOR_SATURATE: - return IcOperatorSaturate; + return PIXMAN_OPERATOR_SATURATE; default: - return IcOperatorOver; + return PIXMAN_OPERATOR_OVER; } } @@ -380,7 +380,7 @@ _cairo_image_surface_composite (cairo_operator_t operator, return CAIRO_INT_STATUS_UNSUPPORTED; } - IcComposite (_ic_operator (operator), + pixman_composite (_ic_operator (operator), src->ic_image, mask ? mask->ic_image : NULL, dst->ic_image, @@ -401,16 +401,16 @@ _cairo_image_surface_fill_rectangles (void *abstract_surface, { cairo_image_surface_t *surface = abstract_surface; - IcColor ic_color; + pixman_color_t ic_color; ic_color.red = color->red_short; ic_color.green = color->green_short; ic_color.blue = color->blue_short; ic_color.alpha = color->alpha_short; - /* XXX: The IcRectangle cast is evil... it needs to go away somehow. */ - IcFillRectangles (_ic_operator(operator), surface->ic_image, - &ic_color, (IcRectangle *) rects, num_rects); + /* XXX: The pixman_rectangle_t cast is evil... it needs to go away somehow. */ + pixman_fill_rectangles (_ic_operator(operator), surface->ic_image, + &ic_color, (pixman_rectangle_t *) rects, num_rects); return CAIRO_STATUS_SUCCESS; } @@ -430,9 +430,9 @@ _cairo_image_surface_composite_trapezoids (cairo_operator_t operator, if (generic_src->backend != dst->base.backend) return CAIRO_INT_STATUS_UNSUPPORTED; - /* XXX: The IcTrapezoid cast is evil and needs to go away somehow. */ - IcCompositeTrapezoids (operator, src->ic_image, dst->ic_image, - x_src, y_src, (IcTrapezoid *) traps, num_traps); + /* XXX: The pixman_trapezoid_t cast is evil and needs to go away somehow. */ + pixman_composite_trapezoids (operator, src->ic_image, dst->ic_image, + x_src, y_src, (pixman_trapezoid_t *) traps, num_traps); return CAIRO_STATUS_SUCCESS; } diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c index c5313de7..9afda77e 100644 --- a/src/cairo-ps-surface.c +++ b/src/cairo-ps-surface.c @@ -330,7 +330,7 @@ _cairo_ps_surface_copy_page (void *abstract_surface) i = 0; for (y = 0; y < height; y++) { - IcBits *pixel = (IcBits *) (surface->image->data + y * surface->image->stride); + pixman_bits_t *pixel = (pixman_bits_t *) (surface->image->data + y * surface->image->stride); for (x = 0; x < width; x++, pixel++) { rgb[i++] = (*pixel & 0x00ff0000) >> 16; rgb[i++] = (*pixel & 0x0000ff00) >> 8; diff --git a/src/cairo.h b/src/cairo.h index 7b5f2dc5..8bed5de8 100644 --- a/src/cairo.h +++ b/src/cairo.h @@ -30,15 +30,9 @@ #include <cairo-features.h> -#include <ic.h> +#include <pixman.h> #include <stdio.h> -#ifdef _CAIROINT_H_ -#include <slim_export.h> -#else -#include <slim_import.h> -#endif - typedef struct cairo cairo_t; typedef struct cairo_surface cairo_surface_t; typedef struct cairo_matrix cairo_matrix_t; @@ -47,6 +41,13 @@ typedef struct cairo_matrix cairo_matrix_t; extern "C" { #endif +/* slim_export.h */ +#if defined(WIN32) || defined(__CYGWIN__) +#define __external_linkage __declspec(dllexport) +#else +#define __external_linkage +#endif + /* Functions for manipulating state objects */ extern cairo_t * __external_linkage cairo_create (void); diff --git a/src/cairo_image_surface.c b/src/cairo_image_surface.c index efa54d26..7ee6a943 100644 --- a/src/cairo_image_surface.c +++ b/src/cairo_image_surface.c @@ -45,7 +45,7 @@ _cairo_format_bpp (cairo_format_t format) } static cairo_image_surface_t * -_cairo_image_surface_create_for_ic_image (IcImage *ic_image) +_cairo_image_surface_create_for_ic_image (pixman_image_t *ic_image) { cairo_image_surface_t *surface; @@ -57,13 +57,13 @@ _cairo_image_surface_create_for_ic_image (IcImage *ic_image) surface->ic_image = ic_image; - surface->data = (char *) IcImageGetData (ic_image); + surface->data = (char *) pixman_image_get_data (ic_image); surface->owns_data = 0; - surface->width = IcImageGetWidth (ic_image); - surface->height = IcImageGetHeight (ic_image); - surface->stride = IcImageGetStride (ic_image); - surface->depth = IcImageGetDepth (ic_image); + surface->width = pixman_image_get_width (ic_image); + surface->height = pixman_image_get_height (ic_image); + surface->stride = pixman_image_get_stride (ic_image); + surface->depth = pixman_image_get_depth (ic_image); return surface; } @@ -76,10 +76,10 @@ _cairo_image_surface_create_with_masks (char *data, int stride) { cairo_image_surface_t *surface; - IcFormat *ic_format; - IcImage *ic_image; + pixman_format_t *ic_format; + pixman_image_t *ic_image; - ic_format = IcFormatCreateMasks (format->bpp, + ic_format = pixman_format_create_masks (format->bpp, format->alpha_mask, format->red_mask, format->green_mask, @@ -88,10 +88,10 @@ _cairo_image_surface_create_with_masks (char *data, if (ic_format == NULL) return NULL; - ic_image = IcImageCreateForData ((IcBits *) data, ic_format, + ic_image = pixman_image_create_for_data ((pixman_bits_t *) data, ic_format, width, height, format->bpp, stride); - IcFormatDestroy (ic_format); + pixman_format_destroy (ic_format); if (ic_image == NULL) return NULL; @@ -101,22 +101,22 @@ _cairo_image_surface_create_with_masks (char *data, return surface; } -static IcFormat * +static pixman_format_t * _create_ic_format (cairo_format_t format) { switch (format) { case CAIRO_FORMAT_A1: - return IcFormatCreate (IcFormatNameA1); + return pixman_format_create (PIXMAN_FORMAT_NAME_A1); break; case CAIRO_FORMAT_A8: - return IcFormatCreate (IcFormatNameA8); + return pixman_format_create (PIXMAN_FORMAT_NAME_A8); break; case CAIRO_FORMAT_RGB24: - return IcFormatCreate (IcFormatNameRGB24); + return pixman_format_create (PIXMAN_FORMAT_NAME_RG_B24); break; case CAIRO_FORMAT_ARGB32: default: - return IcFormatCreate (IcFormatNameARGB32); + return pixman_format_create (PIXMAN_FORMAT_NAME_AR_GB32); break; } } @@ -127,16 +127,16 @@ cairo_image_surface_create (cairo_format_t format, int height) { cairo_image_surface_t *surface; - IcFormat *ic_format; - IcImage *ic_image; + pixman_format_t *ic_format; + pixman_image_t *ic_image; ic_format = _create_ic_format (format); if (ic_format == NULL) return NULL; - ic_image = IcImageCreate (ic_format, width, height); + ic_image = pixman_image_create (ic_format, width, height); - IcFormatDestroy (ic_format); + pixman_format_destroy (ic_format); if (ic_image == NULL) return NULL; @@ -154,19 +154,19 @@ cairo_image_surface_create_for_data (char *data, int stride) { cairo_image_surface_t *surface; - IcFormat *ic_format; - IcImage *ic_image; + pixman_format_t *ic_format; + pixman_image_t *ic_image; ic_format = _create_ic_format (format); if (ic_format == NULL) return NULL; - ic_image = IcImageCreateForData ((IcBits *) data, ic_format, + ic_image = pixman_image_create_for_data ((pixman_bits_t *) data, ic_format, width, height, _cairo_format_bpp (format), stride); - IcFormatDestroy (ic_format); + pixman_format_destroy (ic_format); if (ic_image == NULL) return NULL; @@ -191,7 +191,7 @@ _cairo_image_abstract_surface_destroy (void *abstract_surface) cairo_image_surface_t *surface = abstract_surface; if (surface->ic_image) - IcImageDestroy (surface->ic_image); + pixman_image_destroy (surface->ic_image); if (surface->owns_data) { free (surface->data); @@ -247,7 +247,7 @@ cairo_status_t _cairo_image_surface_set_matrix (cairo_image_surface_t *surface, cairo_matrix_t *matrix) { - IcTransform ic_transform; + pixman_transform_t ic_transform; ic_transform.matrix[0][0] = _cairo_fixed_from_double (matrix->m[0][0]); ic_transform.matrix[0][1] = _cairo_fixed_from_double (matrix->m[1][0]); @@ -261,7 +261,7 @@ _cairo_image_surface_set_matrix (cairo_image_surface_t *surface, ic_transform.matrix[2][1] = 0; ic_transform.matrix[2][2] = _cairo_fixed_from_double (1); - IcImageSetTransform (surface->ic_image, &ic_transform); + pixman_image_set_transform (surface->ic_image, &ic_transform); return CAIRO_STATUS_SUCCESS; } @@ -277,29 +277,29 @@ _cairo_image_abstract_surface_set_filter (void *abstract_surface, cairo_filter_t cairo_status_t _cairo_image_surface_set_filter (cairo_image_surface_t *surface, cairo_filter_t filter) { - IcFilter ic_filter; + pixman_filter_t ic_filter; switch (filter) { case CAIRO_FILTER_FAST: - ic_filter = IcFilterFast; + ic_filter = PIXMAN_FILTER_FAST; break; case CAIRO_FILTER_GOOD: - ic_filter = IcFilterGood; + ic_filter = PIXMAN_FILTER_GOOD; break; case CAIRO_FILTER_BEST: - ic_filter = IcFilterBest; + ic_filter = PIXMAN_FILTER_BEST; break; case CAIRO_FILTER_NEAREST: - ic_filter = IcFilterNearest; + ic_filter = PIXMAN_FILTER_NEAREST; break; case CAIRO_FILTER_BILINEAR: - ic_filter = IcFilterBilinear; + ic_filter = PIXMAN_FILTER_BILINEAR; break; default: - ic_filter = IcFilterBest; + ic_filter = PIXMAN_FILTER_BEST; } - IcImageSetFilter (surface->ic_image, ic_filter); + pixman_image_set_filter (surface->ic_image, ic_filter); return CAIRO_STATUS_SUCCESS; } @@ -314,45 +314,45 @@ _cairo_image_abstract_surface_set_repeat (void *abstract_surface, int repeat) cairo_status_t _cairo_image_surface_set_repeat (cairo_image_surface_t *surface, int repeat) { - IcImageSetRepeat (surface->ic_image, repeat); + pixman_image_set_repeat (surface->ic_image, repeat); return CAIRO_STATUS_SUCCESS; } -static IcOperator +static pixman_operator_t _ic_operator (cairo_operator_t operator) { switch (operator) { case CAIRO_OPERATOR_CLEAR: - return IcOperatorClear; + return PIXMAN_OPERATOR_CLEAR; case CAIRO_OPERATOR_SRC: - return IcOperatorSrc; + return PIXMAN_OPERATOR_SRC; case CAIRO_OPERATOR_DST: - return IcOperatorDst; + return PIXMAN_OPERATOR_DST; case CAIRO_OPERATOR_OVER: - return IcOperatorOver; + return PIXMAN_OPERATOR_OVER; case CAIRO_OPERATOR_OVER_REVERSE: - return IcOperatorOverReverse; + return PIXMAN_OPERATOR_OVER_REVERSE; case CAIRO_OPERATOR_IN: - return IcOperatorIn; + return PIXMAN_OPERATOR_IN; case CAIRO_OPERATOR_IN_REVERSE: - return IcOperatorInReverse; + return PIXMAN_OPERATOR_IN_REVERSE; case CAIRO_OPERATOR_OUT: - return IcOperatorOut; + return PIXMAN_OPERATOR_OUT; case CAIRO_OPERATOR_OUT_REVERSE: - return IcOperatorOutReverse; + return PIXMAN_OPERATOR_OUT_REVERSE; case CAIRO_OPERATOR_ATOP: - return IcOperatorAtop; + return PIXMAN_OPERATOR_ATOP; case CAIRO_OPERATOR_ATOP_REVERSE: - return IcOperatorAtopReverse; + return PIXMAN_OPERATOR_ATOP_REVERSE; case CAIRO_OPERATOR_XOR: - return IcOperatorXor; + return PIXMAN_OPERATOR_XOR; case CAIRO_OPERATOR_ADD: - return IcOperatorAdd; + return PIXMAN_OPERATOR_ADD; case CAIRO_OPERATOR_SATURATE: - return IcOperatorSaturate; + return PIXMAN_OPERATOR_SATURATE; default: - return IcOperatorOver; + return PIXMAN_OPERATOR_OVER; } } @@ -380,7 +380,7 @@ _cairo_image_surface_composite (cairo_operator_t operator, return CAIRO_INT_STATUS_UNSUPPORTED; } - IcComposite (_ic_operator (operator), + pixman_composite (_ic_operator (operator), src->ic_image, mask ? mask->ic_image : NULL, dst->ic_image, @@ -401,16 +401,16 @@ _cairo_image_surface_fill_rectangles (void *abstract_surface, { cairo_image_surface_t *surface = abstract_surface; - IcColor ic_color; + pixman_color_t ic_color; ic_color.red = color->red_short; ic_color.green = color->green_short; ic_color.blue = color->blue_short; ic_color.alpha = color->alpha_short; - /* XXX: The IcRectangle cast is evil... it needs to go away somehow. */ - IcFillRectangles (_ic_operator(operator), surface->ic_image, - &ic_color, (IcRectangle *) rects, num_rects); + /* XXX: The pixman_rectangle_t cast is evil... it needs to go away somehow. */ + pixman_fill_rectangles (_ic_operator(operator), surface->ic_image, + &ic_color, (pixman_rectangle_t *) rects, num_rects); return CAIRO_STATUS_SUCCESS; } @@ -430,9 +430,9 @@ _cairo_image_surface_composite_trapezoids (cairo_operator_t operator, if (generic_src->backend != dst->base.backend) return CAIRO_INT_STATUS_UNSUPPORTED; - /* XXX: The IcTrapezoid cast is evil and needs to go away somehow. */ - IcCompositeTrapezoids (operator, src->ic_image, dst->ic_image, - x_src, y_src, (IcTrapezoid *) traps, num_traps); + /* XXX: The pixman_trapezoid_t cast is evil and needs to go away somehow. */ + pixman_composite_trapezoids (operator, src->ic_image, dst->ic_image, + x_src, y_src, (pixman_trapezoid_t *) traps, num_traps); return CAIRO_STATUS_SUCCESS; } diff --git a/src/cairo_ps_surface.c b/src/cairo_ps_surface.c index c5313de7..9afda77e 100644 --- a/src/cairo_ps_surface.c +++ b/src/cairo_ps_surface.c @@ -330,7 +330,7 @@ _cairo_ps_surface_copy_page (void *abstract_surface) i = 0; for (y = 0; y < height; y++) { - IcBits *pixel = (IcBits *) (surface->image->data + y * surface->image->stride); + pixman_bits_t *pixel = (pixman_bits_t *) (surface->image->data + y * surface->image->stride); for (x = 0; x < width; x++, pixel++) { rgb[i++] = (*pixel & 0x00ff0000) >> 16; rgb[i++] = (*pixel & 0x0000ff00) >> 8; diff --git a/src/cairoint.h b/src/cairoint.h index 13910cdb..b7422216 100644 --- a/src/cairoint.h +++ b/src/cairoint.h @@ -43,7 +43,33 @@ #include "cairo.h" -#include <slim_internal.h> +#if __GNUC__ >= 3 && defined(__ELF__) +# define slim_hidden_proto(name) slim_hidden_proto1(name, INT_##name) +# define slim_hidden_def(name) slim_hidden_def1(name, INT_##name) +# define slim_hidden_proto1(name, internal) \ + extern __typeof (name) name \ + __asm__ (slim_hidden_asmname (internal)) \ + __internal_linkage; +# define slim_hidden_def1(name, internal) \ + extern __typeof (name) EXT_##name __asm__(slim_hidden_asmname(name)) \ + __attribute__((__alias__(slim_hidden_asmname(internal)))) +# define slim_hidden_ulp slim_hidden_ulp1(__USER_LABEL_PREFIX__) +# define slim_hidden_ulp1(x) slim_hidden_ulp2(x) +# define slim_hidden_ulp2(x) #x +# define slim_hidden_asmname(name) slim_hidden_asmname1(name) +# define slim_hidden_asmname1(name) slim_hidden_ulp #name +#else +# define slim_hidden_proto(name) +# define slim_hidden_def(name) +#endif + +/* slim_internal.h */ +#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) +#define __internal_linkage __attribute__((__visibility__("hidden"))) +#else +#define __internal_linkage +#endif + /* These macros allow us to deprecate a function by providing an alias for the old function name to the new function name. With this @@ -387,7 +413,7 @@ struct cairo_image_surface { int stride; int depth; - IcImage *ic_image; + pixman_image_t *ic_image; }; /* XXX: Right now, the cairo_color structure puts unpremultiplied |