[cairo-commit] cairo/src Makefile.am,1.15,1.16 cairo.h,1.33,1.34 cairo_image_surface.c,1.5,1.6 cairo_ps_surface.c,1.5,1.6 cairoint.h,1.42,1.43

Carl Worth commit at pdx.freedesktop.org
Thu Dec 11 12:44:01 PST 2003


Committed by: cworth

Update of /cvs/cairo/cairo/src
In directory pdx:/tmp/cvs-serv7700/src

Modified Files:
	Makefile.am cairo.h cairo_image_surface.c cairo_ps_surface.c 
	cairoint.h 
Log Message:

        * 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.


Index: Makefile.am
===================================================================
RCS file: /cvs/cairo/cairo/src/Makefile.am,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** Makefile.am	5 Dec 2003 16:53:07 -0000	1.15
--- Makefile.am	11 Dec 2003 20:43:58 -0000	1.16
***************
*** 35,39 ****
  libcairo_la_LDFLAGS = -version-info @VERSION_INFO@
  
! INCLUDES = $(CAIRO_CFLAGS) $(FONTCONFIG_CFLAGS) $(XRENDER_CFLAGS) $(X_CFLAGS)
  
  libcairo_la_LIBADD = $(CAIRO_LIBS) $(FONTCONFIG_LIBS) $(XRENDER_LIBS) $(X_LIBS) -lm
--- 35,39 ----
  libcairo_la_LDFLAGS = -version-info @VERSION_INFO@
  
! INCLUDES = -I$(srcdir) $(CAIRO_CFLAGS) $(FONTCONFIG_CFLAGS) $(XRENDER_CFLAGS) $(X_CFLAGS)
  
  libcairo_la_LIBADD = $(CAIRO_LIBS) $(FONTCONFIG_LIBS) $(XRENDER_LIBS) $(X_LIBS) -lm

Index: cairo.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** cairo.h	11 Dec 2003 19:12:59 -0000	1.33
--- cairo.h	11 Dec 2003 20:43:58 -0000	1.34
***************
*** 31,43 ****
  #include <cairo-features.h>
  
! #include <ic.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;
--- 31,37 ----
  #include <cairo-features.h>
  
! #include <pixman.h>
  #include <stdio.h>
  
  typedef struct cairo cairo_t;
  typedef struct cairo_surface cairo_surface_t;
***************
*** 48,51 ****
--- 42,52 ----
  #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

Index: cairo_image_surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_image_surface.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** cairo_image_surface.c	6 Nov 2003 20:53:39 -0000	1.5
--- cairo_image_surface.c	11 Dec 2003 20:43:58 -0000	1.6
***************
*** 46,50 ****
  
  static cairo_image_surface_t *
! _cairo_image_surface_create_for_ic_image (IcImage *ic_image)
  {
      cairo_image_surface_t *surface;
--- 46,50 ----
  
  static cairo_image_surface_t *
! _cairo_image_surface_create_for_ic_image (pixman_image_t *ic_image)
  {
      cairo_image_surface_t *surface;
***************
*** 58,68 ****
      surface->ic_image = ic_image;
  
!     surface->data = (char *) IcImageGetData (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);
  
      return surface;
--- 58,68 ----
      surface->ic_image = ic_image;
  
!     surface->data = (char *) pixman_image_get_data (ic_image);
      surface->owns_data = 0;
  
!     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;
***************
*** 77,84 ****
  {
      cairo_image_surface_t *surface;
!     IcFormat *ic_format;
!     IcImage *ic_image;
  
!     ic_format = IcFormatCreateMasks (format->bpp,
  				     format->alpha_mask,
  				     format->red_mask,
--- 77,84 ----
  {
      cairo_image_surface_t *surface;
!     pixman_format_t *ic_format;
!     pixman_image_t *ic_image;
  
!     ic_format = pixman_format_create_masks (format->bpp,
  				     format->alpha_mask,
  				     format->red_mask,
***************
*** 89,96 ****
  	return NULL;
  
!     ic_image = IcImageCreateForData ((IcBits *) data, ic_format,
  				     width, height, format->bpp, stride);
  
!     IcFormatDestroy (ic_format);
  
      if (ic_image == NULL)
--- 89,96 ----
  	return NULL;
  
!     ic_image = pixman_image_create_for_data ((pixman_bits_t *) data, ic_format,
  				     width, height, format->bpp, stride);
  
!     pixman_format_destroy (ic_format);
  
      if (ic_image == NULL)
***************
*** 102,121 ****
  }
  
! static IcFormat *
  _create_ic_format (cairo_format_t format)
  {
      switch (format) {
      case CAIRO_FORMAT_A1:
! 	return IcFormatCreate (IcFormatNameA1);
  	break;
      case CAIRO_FORMAT_A8:
! 	return IcFormatCreate (IcFormatNameA8);
  	break;
      case CAIRO_FORMAT_RGB24:
! 	return IcFormatCreate (IcFormatNameRGB24);
  	break;
      case CAIRO_FORMAT_ARGB32:
      default:
! 	return IcFormatCreate (IcFormatNameARGB32);
  	break;
      }
--- 102,121 ----
  }
  
! static pixman_format_t *
  _create_ic_format (cairo_format_t format)
  {
      switch (format) {
      case CAIRO_FORMAT_A1:
! 	return pixman_format_create (PIXMAN_FORMAT_NAME_A1);
  	break;
      case CAIRO_FORMAT_A8:
! 	return pixman_format_create (PIXMAN_FORMAT_NAME_A8);
  	break;
      case CAIRO_FORMAT_RGB24:
! 	return pixman_format_create (PIXMAN_FORMAT_NAME_RG_B24);
  	break;
      case CAIRO_FORMAT_ARGB32:
      default:
! 	return pixman_format_create (PIXMAN_FORMAT_NAME_AR_GB32);
  	break;
      }
***************
*** 128,133 ****
  {
      cairo_image_surface_t *surface;
!     IcFormat *ic_format;
!     IcImage *ic_image;
  
      ic_format = _create_ic_format (format);
--- 128,133 ----
  {
      cairo_image_surface_t *surface;
!     pixman_format_t *ic_format;
!     pixman_image_t *ic_image;
  
      ic_format = _create_ic_format (format);
***************
*** 135,141 ****
  	return NULL;
  
!     ic_image = IcImageCreate (ic_format, width, height);
  
!     IcFormatDestroy (ic_format);
  
      if (ic_image == NULL)
--- 135,141 ----
  	return NULL;
  
!     ic_image = pixman_image_create (ic_format, width, height);
  
!     pixman_format_destroy (ic_format);
  
      if (ic_image == NULL)
***************
*** 155,160 ****
  {
      cairo_image_surface_t *surface;
!     IcFormat *ic_format;
!     IcImage *ic_image;
  
      ic_format = _create_ic_format (format);
--- 155,160 ----
  {
      cairo_image_surface_t *surface;
!     pixman_format_t *ic_format;
!     pixman_image_t *ic_image;
  
      ic_format = _create_ic_format (format);
***************
*** 162,171 ****
  	return NULL;
  
!     ic_image = IcImageCreateForData ((IcBits *) data, ic_format,
  				     width, height,
  				     _cairo_format_bpp (format),
  				     stride);
  
!     IcFormatDestroy (ic_format);
  
      if (ic_image == NULL)
--- 162,171 ----
  	return NULL;
  
!     ic_image = pixman_image_create_for_data ((pixman_bits_t *) data, ic_format,
  				     width, height,
  				     _cairo_format_bpp (format),
  				     stride);
  
!     pixman_format_destroy (ic_format);
  
      if (ic_image == NULL)
***************
*** 192,196 ****
      
      if (surface->ic_image)
! 	IcImageDestroy (surface->ic_image);
  
      if (surface->owns_data) {
--- 192,196 ----
      
      if (surface->ic_image)
! 	pixman_image_destroy (surface->ic_image);
  
      if (surface->owns_data) {
***************
*** 248,252 ****
  				 cairo_matrix_t		*matrix)
  {
!     IcTransform ic_transform;
  
      ic_transform.matrix[0][0] = _cairo_fixed_from_double (matrix->m[0][0]);
--- 248,252 ----
  				 cairo_matrix_t		*matrix)
  {
!     pixman_transform_t ic_transform;
  
      ic_transform.matrix[0][0] = _cairo_fixed_from_double (matrix->m[0][0]);
***************
*** 262,266 ****
      ic_transform.matrix[2][2] = _cairo_fixed_from_double (1);
  
!     IcImageSetTransform (surface->ic_image, &ic_transform);
  
      return CAIRO_STATUS_SUCCESS;
--- 262,266 ----
      ic_transform.matrix[2][2] = _cairo_fixed_from_double (1);
  
!     pixman_image_set_transform (surface->ic_image, &ic_transform);
  
      return CAIRO_STATUS_SUCCESS;
***************
*** 278,304 ****
  _cairo_image_surface_set_filter (cairo_image_surface_t *surface, cairo_filter_t filter)
  {
!     IcFilter ic_filter;
  
      switch (filter) {
      case CAIRO_FILTER_FAST:
! 	ic_filter = IcFilterFast;
  	break;
      case CAIRO_FILTER_GOOD:
! 	ic_filter = IcFilterGood;
  	break;
      case CAIRO_FILTER_BEST:
! 	ic_filter = IcFilterBest;
  	break;
      case CAIRO_FILTER_NEAREST:
! 	ic_filter = IcFilterNearest;
  	break;
      case CAIRO_FILTER_BILINEAR:
! 	ic_filter = IcFilterBilinear;
  	break;
      default:
! 	ic_filter = IcFilterBest;
      }
  
!     IcImageSetFilter (surface->ic_image, ic_filter);
  
      return CAIRO_STATUS_SUCCESS;
--- 278,304 ----
  _cairo_image_surface_set_filter (cairo_image_surface_t *surface, cairo_filter_t filter)
  {
!     pixman_filter_t ic_filter;
  
      switch (filter) {
      case CAIRO_FILTER_FAST:
! 	ic_filter = PIXMAN_FILTER_FAST;
  	break;
      case CAIRO_FILTER_GOOD:
! 	ic_filter = PIXMAN_FILTER_GOOD;
  	break;
      case CAIRO_FILTER_BEST:
! 	ic_filter = PIXMAN_FILTER_BEST;
  	break;
      case CAIRO_FILTER_NEAREST:
! 	ic_filter = PIXMAN_FILTER_NEAREST;
  	break;
      case CAIRO_FILTER_BILINEAR:
! 	ic_filter = PIXMAN_FILTER_BILINEAR;
  	break;
      default:
! 	ic_filter = PIXMAN_FILTER_BEST;
      }
  
!     pixman_image_set_filter (surface->ic_image, ic_filter);
  
      return CAIRO_STATUS_SUCCESS;
***************
*** 315,357 ****
  _cairo_image_surface_set_repeat (cairo_image_surface_t *surface, int repeat)
  {
!     IcImageSetRepeat (surface->ic_image, repeat);
  
      return CAIRO_STATUS_SUCCESS;
  }
  
! static IcOperator
  _ic_operator (cairo_operator_t operator)
  {
      switch (operator) {
      case CAIRO_OPERATOR_CLEAR:
! 	return IcOperatorClear;
      case CAIRO_OPERATOR_SRC:
! 	return IcOperatorSrc;
      case CAIRO_OPERATOR_DST:
! 	return IcOperatorDst;
      case CAIRO_OPERATOR_OVER:
! 	return IcOperatorOver;
      case CAIRO_OPERATOR_OVER_REVERSE:
! 	return IcOperatorOverReverse;
      case CAIRO_OPERATOR_IN:
! 	return IcOperatorIn;
      case CAIRO_OPERATOR_IN_REVERSE:
! 	return IcOperatorInReverse;
      case CAIRO_OPERATOR_OUT:
! 	return IcOperatorOut;
      case CAIRO_OPERATOR_OUT_REVERSE:
! 	return IcOperatorOutReverse;
      case CAIRO_OPERATOR_ATOP:
! 	return IcOperatorAtop;
      case CAIRO_OPERATOR_ATOP_REVERSE:
! 	return IcOperatorAtopReverse;
      case CAIRO_OPERATOR_XOR:
! 	return IcOperatorXor;
      case CAIRO_OPERATOR_ADD:
! 	return IcOperatorAdd;
      case CAIRO_OPERATOR_SATURATE:
! 	return IcOperatorSaturate;
      default:
! 	return IcOperatorOver;
      }
  }
--- 315,357 ----
  _cairo_image_surface_set_repeat (cairo_image_surface_t *surface, int repeat)
  {
!     pixman_image_set_repeat (surface->ic_image, repeat);
  
      return CAIRO_STATUS_SUCCESS;
  }
  
! static pixman_operator_t
  _ic_operator (cairo_operator_t operator)
  {
      switch (operator) {
      case CAIRO_OPERATOR_CLEAR:
! 	return PIXMAN_OPERATOR_CLEAR;
      case CAIRO_OPERATOR_SRC:
! 	return PIXMAN_OPERATOR_SRC;
      case CAIRO_OPERATOR_DST:
! 	return PIXMAN_OPERATOR_DST;
      case CAIRO_OPERATOR_OVER:
! 	return PIXMAN_OPERATOR_OVER;
      case CAIRO_OPERATOR_OVER_REVERSE:
! 	return PIXMAN_OPERATOR_OVER_REVERSE;
      case CAIRO_OPERATOR_IN:
! 	return PIXMAN_OPERATOR_IN;
      case CAIRO_OPERATOR_IN_REVERSE:
! 	return PIXMAN_OPERATOR_IN_REVERSE;
      case CAIRO_OPERATOR_OUT:
! 	return PIXMAN_OPERATOR_OUT;
      case CAIRO_OPERATOR_OUT_REVERSE:
! 	return PIXMAN_OPERATOR_OUT_REVERSE;
      case CAIRO_OPERATOR_ATOP:
! 	return PIXMAN_OPERATOR_ATOP;
      case CAIRO_OPERATOR_ATOP_REVERSE:
! 	return PIXMAN_OPERATOR_ATOP_REVERSE;
      case CAIRO_OPERATOR_XOR:
! 	return PIXMAN_OPERATOR_XOR;
      case CAIRO_OPERATOR_ADD:
! 	return PIXMAN_OPERATOR_ADD;
      case CAIRO_OPERATOR_SATURATE:
! 	return PIXMAN_OPERATOR_SATURATE;
      default:
! 	return PIXMAN_OPERATOR_OVER;
      }
  }
***************
*** 381,385 ****
      }
  
!     IcComposite (_ic_operator (operator),
  		 src->ic_image,
  		 mask ? mask->ic_image : NULL,
--- 381,385 ----
      }
  
!     pixman_composite (_ic_operator (operator),
  		 src->ic_image,
  		 mask ? mask->ic_image : NULL,
***************
*** 402,406 ****
      cairo_image_surface_t *surface = abstract_surface;
  
!     IcColor ic_color;
  
      ic_color.red   = color->red_short;
--- 402,406 ----
      cairo_image_surface_t *surface = abstract_surface;
  
!     pixman_color_t ic_color;
  
      ic_color.red   = color->red_short;
***************
*** 409,415 ****
      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);
  
      return CAIRO_STATUS_SUCCESS;
--- 409,415 ----
      ic_color.alpha = color->alpha_short;
  
!     /* 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;
***************
*** 431,437 ****
  	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);
  
      return CAIRO_STATUS_SUCCESS;
--- 431,437 ----
  	return CAIRO_INT_STATUS_UNSUPPORTED;
  
!     /* 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;

Index: cairo_ps_surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_ps_surface.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** cairo_ps_surface.c	11 Dec 2003 15:03:41 -0000	1.5
--- cairo_ps_surface.c	11 Dec 2003 20:43:58 -0000	1.6
***************
*** 331,335 ****
      i = 0;
      for (y = 0; y < height; y++) {
! 	IcBits *pixel = (IcBits *) (surface->image->data + y * surface->image->stride);
  	for (x = 0; x < width; x++, pixel++) {
  	    rgb[i++] = (*pixel & 0x00ff0000) >> 16;
--- 331,335 ----
      i = 0;
      for (y = 0; y < height; y++) {
! 	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;

Index: cairoint.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairoint.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** cairoint.h	11 Dec 2003 19:12:59 -0000	1.42
--- cairoint.h	11 Dec 2003 20:43:58 -0000	1.43
***************
*** 44,48 ****
  #include "cairo.h"
  
! #include <slim_internal.h>
  
  /* These macros allow us to deprecate a function by providing an alias
--- 44,74 ----
  #include "cairo.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
***************
*** 388,392 ****
      int depth;
  
!     IcImage *ic_image;
  };
  
--- 414,418 ----
      int depth;
  
!     pixman_image_t *ic_image;
  };
  





More information about the cairo-commit mailing list