[cairo-commit] cairo/src cairo_image_surface.c,NONE,1.1 Makefile.am,1.11,1.12 cairo-xlib.h,1.3,1.4 cairo.c,1.23,1.24 cairo.h,1.23,1.24 cairo_ft_font.c,1.6,1.7 cairo_gstate.c,1.25,1.26 cairo_surface.c,1.18,1.19 cairo_xlib_surface.c,1.8,1.9 cairoint.h,1.35,1.36

Carl Worth commit at pdx.freedesktop.org
Fri Oct 31 10:41:39 PST 2003


Committed by: cworth

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

Modified Files:
	Makefile.am cairo-xlib.h cairo.c cairo.h cairo_ft_font.c 
	cairo_gstate.c cairo_surface.c cairo_xlib_surface.c cairoint.h 
Added Files:
	cairo_image_surface.c 
Log Message:
Moved all libic-related drawing into cairo_image_surface.c

--- NEW FILE: cairo_image_surface.c ---
(This appears to be a binary file; contents omitted.)

Index: Makefile.am
===================================================================
RCS file: /cvs/cairo/cairo/src/Makefile.am,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** Makefile.am	23 Oct 2003 22:22:28 -0000	1.11
--- Makefile.am	31 Oct 2003 18:41:37 -0000	1.12
***************
*** 2,26 ****
  include_HEADERS = cairo.h cairo-xlib.h
  
! libcairo_la_SOURCES = \
! 	cairo.c \
! 	cairo.h \
! 	cairo_color.c \
! 	cairo_fixed.c \
! 	cairo_font.c \
! 	cairo_ft_font.c \
! 	cairo_gstate.c \
! 	cairo_hull.c \
! 	cairo_matrix.c \
! 	cairo_path.c \
! 	cairo_path_bounds.c \
! 	cairo_path_fill.c \
! 	cairo_path_stroke.c \
! 	cairo_pen.c \
! 	cairo_polygon.c \
! 	cairo_slope.c \
! 	cairo_spline.c \
! 	cairo_surface.c \
! 	cairo_xlib_surface.c \
! 	cairo_traps.c \
  	cairoint.h
  
--- 2,27 ----
  include_HEADERS = cairo.h cairo-xlib.h
  
! libcairo_la_SOURCES = 		\
! 	cairo.c			\
! 	cairo.h			\
! 	cairo_color.c		\
! 	cairo_fixed.c		\
! 	cairo_font.c		\
! 	cairo_ft_font.c		\
! 	cairo_gstate.c		\
! 	cairo_hull.c		\
! 	cairo_image_surface.c	\
! 	cairo_matrix.c		\
! 	cairo_path.c		\
! 	cairo_path_bounds.c	\
! 	cairo_path_fill.c	\
! 	cairo_path_stroke.c	\
! 	cairo_pen.c		\
! 	cairo_polygon.c		\
! 	cairo_slope.c		\
! 	cairo_spline.c		\
! 	cairo_surface.c		\
! 	cairo_traps.c		\
! 	cairo_xlib_surface.c	\
  	cairoint.h
  

Index: cairo-xlib.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-xlib.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** cairo-xlib.h	23 Oct 2003 14:47:29 -0000	1.3
--- cairo-xlib.h	31 Oct 2003 18:41:37 -0000	1.4
***************
*** 29,32 ****
--- 29,34 ----
  #define _CAIRO_XLIB_H_
  
+ #include <X11/extensions/Xrender.h>
+ 
  #include "cairo.h"
  #ifdef _CAIROINT_H_

Index: cairo.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** cairo.c	24 Oct 2003 18:01:37 -0000	1.23
--- cairo.c	31 Oct 2003 18:41:37 -0000	1.24
***************
*** 186,191 ****
  
      surface = cairo_surface_create_for_image (data,
! 				       format,
! 				       width, height, stride);
      if (surface == NULL) {
  	cr->status = CAIRO_STATUS_NO_MEMORY;
--- 186,191 ----
  
      surface = cairo_surface_create_for_image (data,
! 					      format,
! 					      width, height, stride);
      if (surface == NULL) {
  	cr->status = CAIRO_STATUS_NO_MEMORY;
***************
*** 841,844 ****
--- 841,846 ----
      case CAIRO_STATUS_NO_TARGET_SURFACE:
  	return "no target surface has been set";
+     case CAIRO_STATUS_NULL_POINTER:
+ 	return "NULL pointer";
      }
  

Index: cairo.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** cairo.h	30 Oct 2003 20:39:49 -0000	1.23
--- cairo.h	31 Oct 2003 18:41:37 -0000	1.24
***************
*** 29,34 ****
  #define _CAIRO_H_
  
- #include <X11/extensions/Xrender.h>
- #include <fontconfig/fontconfig.h>
  #include <ic.h>
  
--- 29,32 ----
***************
*** 79,86 ****
  
  typedef enum cairo_format {
!     CAIRO_FORMAT_ARGB32 = PictStandardARGB32,
!     CAIRO_FORMAT_RGB24 = PictStandardRGB24,
!     CAIRO_FORMAT_A8 = PictStandardA8,
!     CAIRO_FORMAT_A1 = PictStandardA1
  } cairo_format_t;
  
--- 77,84 ----
  
  typedef enum cairo_format {
!     CAIRO_FORMAT_ARGB32,
!     CAIRO_FORMAT_RGB24,
!     CAIRO_FORMAT_A8,
!     CAIRO_FORMAT_A1
  } cairo_format_t;
  
***************
*** 94,137 ****
  
  typedef enum cairo_operator { 
!     CAIRO_OPERATOR_CLEAR = PictOpClear,
!     CAIRO_OPERATOR_SRC = PictOpSrc,
!     CAIRO_OPERATOR_DST = PictOpDst,
!     CAIRO_OPERATOR_OVER = PictOpOver,
!     CAIRO_OPERATOR_OVER_REVERSE = PictOpOverReverse,
!     CAIRO_OPERATOR_IN = PictOpIn,
!     CAIRO_OPERATOR_IN_REVERSE = PictOpInReverse,
!     CAIRO_OPERATOR_OUT = PictOpOut,
!     CAIRO_OPERATOR_OUT_REVERSE = PictOpOutReverse,
!     CAIRO_OPERATOR_ATOP = PictOpAtop,
!     CAIRO_OPERATOR_ATOP_REVERSE = PictOpAtopReverse,
!     CAIRO_OPERATOR_XOR = PictOpXor,
!     CAIRO_OPERATOR_ADD = PictOpAdd,
!     CAIRO_OPERATOR_SATURATE = PictOpSaturate,
! 
!     CAIRO_OPERATOR_DISJOINT_CLEAR = PictOpDisjointClear,
!     CAIRO_OPERATOR_DISJOINT_SRC = PictOpDisjointSrc,
!     CAIRO_OPERATOR_DISJOINT_DST = PictOpDisjointDst,
!     CAIRO_OPERATOR_DISJOINT_OVER = PictOpDisjointOver,
!     CAIRO_OPERATOR_DISJOINT_OVER_REVERSE = PictOpDisjointOverReverse,
!     CAIRO_OPERATOR_DISJOINT_IN = PictOpDisjointIn,
!     CAIRO_OPERATOR_DISJOINT_IN_REVERSE = PictOpDisjointInReverse,
!     CAIRO_OPERATOR_DISJOINT_OUT = PictOpDisjointOut,
!     CAIRO_OPERATOR_DISJOINT_OUT_REVERSE = PictOpDisjointOutReverse,
!     CAIRO_OPERATOR_DISJOINT_ATOP = PictOpDisjointAtop,
!     CAIRO_OPERATOR_DISJOINT_ATOP_REVERSE = PictOpDisjointAtopReverse,
!     CAIRO_OPERATOR_DISJOINT_XOR = PictOpDisjointXor,
! 
!     CAIRO_OPERATOR_CONJOINT_CLEAR = PictOpConjointClear,
!     CAIRO_OPERATOR_CONJOINT_SRC = PictOpConjointSrc,
!     CAIRO_OPERATOR_CONJOINT_DST = PictOpConjointDst,
!     CAIRO_OPERATOR_CONJOINT_OVER = PictOpConjointOver,
!     CAIRO_OPERATOR_CONJOINT_OVER_REVERSE = PictOpConjointOverReverse,
!     CAIRO_OPERATOR_CONJOINT_IN = PictOpConjointIn,
!     CAIRO_OPERATOR_CONJOINT_IN_REVERSE = PictOpConjointInReverse,
!     CAIRO_OPERATOR_CONJOINT_OUT = PictOpConjointOut,
!     CAIRO_OPERATOR_CONJOINT_OUT_REVERSE = PictOpConjointOutReverse,
!     CAIRO_OPERATOR_CONJOINT_ATOP = PictOpConjointAtop,
!     CAIRO_OPERATOR_CONJOINT_ATOP_REVERSE = PictOpConjointAtopReverse,
!     CAIRO_OPERATOR_CONJOINT_XOR = PictOpConjointXor
  } cairo_operator_t;
  
--- 92,109 ----
  
  typedef enum cairo_operator { 
!     CAIRO_OPERATOR_CLEAR,
!     CAIRO_OPERATOR_SRC,
!     CAIRO_OPERATOR_DST,
!     CAIRO_OPERATOR_OVER,
!     CAIRO_OPERATOR_OVER_REVERSE,
!     CAIRO_OPERATOR_IN,
!     CAIRO_OPERATOR_IN_REVERSE,
!     CAIRO_OPERATOR_OUT,
!     CAIRO_OPERATOR_OUT_REVERSE,
!     CAIRO_OPERATOR_ATOP,
!     CAIRO_OPERATOR_ATOP_REVERSE,
!     CAIRO_OPERATOR_XOR,
!     CAIRO_OPERATOR_ADD,
!     CAIRO_OPERATOR_SATURATE,
  } cairo_operator_t;
  
***************
*** 431,434 ****
--- 403,407 ----
  /* Fontconfig/Freetype platform-specific font interface */
  
+ #include <fontconfig/fontconfig.h>
  #include <freetype/freetype.h>
  
***************
*** 515,519 ****
      CAIRO_STATUS_NO_CURRENT_POINT,
      CAIRO_STATUS_INVALID_MATRIX,
!     CAIRO_STATUS_NO_TARGET_SURFACE
  } cairo_status_t;
  
--- 488,493 ----
      CAIRO_STATUS_NO_CURRENT_POINT,
      CAIRO_STATUS_INVALID_MATRIX,
!     CAIRO_STATUS_NO_TARGET_SURFACE,
!     CAIRO_STATUS_NULL_POINTER
  } cairo_status_t;
  
***************
*** 567,575 ****
  
  typedef enum cairo_filter {
!     CAIRO_FILTER_FAST = IcFilterFast,
!     CAIRO_FILTER_GOOD = IcFilterGood,
!     CAIRO_FILTER_BEST = IcFilterBest,
!     CAIRO_FILTER_NEAREST = IcFilterNearest,
!     CAIRO_FILTER_BILINEAR = IcFilterBilinear
  } cairo_filter_t;
  
--- 541,549 ----
  
  typedef enum cairo_filter {
!     CAIRO_FILTER_FAST,
!     CAIRO_FILTER_GOOD,
!     CAIRO_FILTER_BEST,
!     CAIRO_FILTER_NEAREST,
!     CAIRO_FILTER_BILINEAR,
  } cairo_filter_t;
  
***************
*** 577,580 ****
--- 551,568 ----
  cairo_surface_set_filter (cairo_surface_t *surface, cairo_filter_t filter);
  
+ /* Image-surface functions */
+ 
+ cairo_surface_t *
+ cairo_image_surface_create (cairo_format_t	format,
+ 			    int			width,
+ 			    int			height);
+ 
+ cairo_surface_t *
+ cairo_image_surface_create_for_data (char			*data,
+ 				     cairo_format_t		format,
+ 				     int			width,
+ 				     int			height,
+ 				     int			stride);
+ 
  /* Matrix functions */
  

Index: cairo_ft_font.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_ft_font.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** cairo_ft_font.c	30 Oct 2003 20:39:49 -0000	1.6
--- cairo_ft_font.c	31 Oct 2003 18:41:37 -0000	1.7
***************
*** 428,431 ****
--- 428,432 ----
                              int                 num_glyphs)
  {
+     cairo_status_t status;
      int i;
      cairo_ft_font_t *ft = NULL;
***************
*** 448,451 ****
--- 449,454 ----
      for (i = 0; i < num_glyphs; i++)
      {
+ 	unsigned char *bitmap;
+ 
          FT_Load_Glyph (ft->face, glyphs[i].index, FT_LOAD_DEFAULT);
          FT_Render_Glyph (glyphslot, FT_RENDER_MODE_NORMAL);
***************
*** 454,457 ****
--- 457,461 ----
          height = glyphslot->bitmap.rows;
          stride = glyphslot->bitmap.pitch;
+ 	bitmap = glyphslot->bitmap.buffer;
     
  	x = x0 + glyphs[i].x;
***************
*** 459,513 ****
  
          /* X gets upset with zero-sized images (such as whitespace) */
!         if (width * height != 0)
!         {
! 	    unsigned char	*bitmap = glyphslot->bitmap.buffer;
  	    
! 	    /*
! 	     * XXX 
! 	     * reformat to match libic alignment requirements.
! 	     * This should be done before rendering the glyph,
! 	     * but that requires using FT_Outline_Get_Bitmap
! 	     * function
! 	     */
! 	    if (stride & 3)
! 	    {
! 		int		nstride = (stride + 3) & ~3;
! 		unsigned char	*g, *b;
! 		int		h;
! 		
! 		bitmap = malloc (nstride * height);
! 		if (!bitmap)
! 		    return CAIRO_STATUS_NO_MEMORY;
! 		g = glyphslot->bitmap.buffer;
! 		b = bitmap;
! 		h = height;
! 		while (h--)
! 		{
! 		    memcpy (b, g, width);
! 		    b += nstride;
! 		    g += stride;
! 		}
! 		stride = nstride;
! 	    }
!             mask = cairo_surface_create_for_image (bitmap,
!                                                   CAIRO_FORMAT_A8,
!                                                   width, height, stride);
!             if (mask == NULL)
  	    {
! 		if (bitmap != glyphslot->bitmap.buffer)
! 		    free (bitmap);
!                 return CAIRO_STATUS_NO_MEMORY;
  	    }
! 
!             _cairo_surface_composite (operator, source, mask, surface,
!                                       0, 0, 0, 0, 
! 				      x + glyphslot->bitmap_left, 
! 				      y - glyphslot->bitmap_top, 
!                                       (double)width, (double)height);
! 
!             cairo_surface_destroy (mask);
  	    if (bitmap != glyphslot->bitmap.buffer)
  		free (bitmap);
!         }
      }  
      return CAIRO_STATUS_SUCCESS;
--- 463,518 ----
  
          /* X gets upset with zero-sized images (such as whitespace) */
!         if (width * height == 0)
! 	    continue;
  	    
! 	/*
! 	 * XXX 
! 	 * reformat to match libic alignment requirements.
! 	 * This should be done before rendering the glyph,
! 	 * but that requires using FT_Outline_Get_Bitmap
! 	 * function
! 	 */
! 	if (stride & 3)
! 	{
! 	    int		nstride = (stride + 3) & ~3;
! 	    unsigned char	*g, *b;
! 	    int		h;
! 	    
! 	    bitmap = malloc (nstride * height);
! 	    if (!bitmap)
! 		return CAIRO_STATUS_NO_MEMORY;
! 	    g = glyphslot->bitmap.buffer;
! 	    b = bitmap;
! 	    h = height;
! 	    while (h--)
  	    {
! 		memcpy (b, g, width);
! 		b += nstride;
! 		g += stride;
  	    }
! 	    stride = nstride;
! 	}
! 	mask = cairo_surface_create_for_image (bitmap,
! 					       CAIRO_FORMAT_A8,
! 					       width, height, stride);
! 	if (mask == NULL)
! 	{
  	    if (bitmap != glyphslot->bitmap.buffer)
  		free (bitmap);
! 	    return CAIRO_STATUS_NO_MEMORY;
! 	}
! 	
! 	status = _cairo_surface_composite (operator, source, mask, surface,
! 					   0, 0, 0, 0, 
! 					   x + glyphslot->bitmap_left, 
! 					   y - glyphslot->bitmap_top, 
! 					   (double)width, (double)height);
! 	
! 	cairo_surface_destroy (mask);
! 	if (bitmap != glyphslot->bitmap.buffer)
! 	    free (bitmap);
! 	
! 	if (status)
! 	    return status;
      }  
      return CAIRO_STATUS_SUCCESS;

Index: cairo_gstate.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_gstate.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** cairo_gstate.c	30 Oct 2003 18:55:04 -0000	1.25
--- cairo_gstate.c	31 Oct 2003 18:41:37 -0000	1.26
***************
*** 161,172 ****
      cairo_font_destroy (gstate->font);
  
!     cairo_surface_destroy (gstate->surface);
      gstate->surface = NULL;
  
!     cairo_surface_destroy (gstate->source);
      gstate->source = NULL;
      gstate->source_is_solid = 1;
  
!     cairo_surface_destroy (gstate->clip.surface);
      gstate->clip.surface = NULL;
  
--- 161,175 ----
      cairo_font_destroy (gstate->font);
  
!     if (gstate->surface)
! 	cairo_surface_destroy (gstate->surface);
      gstate->surface = NULL;
  
!     if (gstate->source)
! 	cairo_surface_destroy (gstate->source);
      gstate->source = NULL;
      gstate->source_is_solid = 1;
  
!     if (gstate->clip.surface)
! 	cairo_surface_destroy (gstate->clip.surface);
      gstate->clip.surface = NULL;
  
***************
*** 257,261 ****
      _cairo_color_set_alpha (&clear, 0);
  
!     _cairo_surface_fill_rectangle (gstate->surface,
                                     CAIRO_OPERATOR_SRC,
  				   &clear,
--- 260,264 ----
      _cairo_color_set_alpha (&clear, 0);
  
!     status = _cairo_surface_fill_rectangle (gstate->surface,
                                     CAIRO_OPERATOR_SRC,
  				   &clear,
***************
*** 263,266 ****
--- 266,271 ----
  			           _cairo_surface_get_width (gstate->surface),
  				   _cairo_surface_get_height (gstate->surface));
+     if (status)				 
+         return status;
  
      return CAIRO_STATUS_SUCCESS;
***************
*** 317,321 ****
      double scale;
  
!     cairo_surface_destroy (gstate->surface);
  
      gstate->surface = surface;
--- 322,327 ----
      double scale;
  
!     if (gstate->surface)
! 	cairo_surface_destroy (gstate->surface);
  
      gstate->surface = surface;
***************
*** 376,380 ****
      _cairo_color_set_rgb (&gstate->color, red, green, blue);
  
!     cairo_surface_destroy (gstate->source);
  
      gstate->source = NULL;
--- 382,387 ----
      _cairo_color_set_rgb (&gstate->color, red, green, blue);
  
!     if (gstate->source)
! 	cairo_surface_destroy (gstate->source);
  
      gstate->source = NULL;
***************
*** 1178,1181 ****
--- 1185,1190 ----
  					     cairo_traps_t *traps)
  {
+     cairo_status_t status;
+ 
      if (traps->num_traps == 0)
  	return CAIRO_STATUS_SUCCESS;
***************
*** 1193,1196 ****
--- 1202,1209 ----
  						     1, 1,
  						     &white_color);
+ 	if (white == NULL) {
+ 	    status = CAIRO_STATUS_NO_MEMORY;
+ 	    goto BAIL0;
+ 	}
  	cairo_surface_set_repeat (white, 1);
  
***************
*** 1202,1205 ****
--- 1215,1222 ----
  							    gstate->clip.height,
  							    &empty_color);
+ 	if (intermediate == NULL) {
+ 	    status = CAIRO_STATUS_NO_MEMORY;
+ 	    goto BAIL1;
+ 	}
  
  	/* Ugh. The cairo_composite/(Render) interface doesn't allow
***************
*** 1222,1246 ****
  	}
  
! 	_cairo_surface_composite_trapezoids (CAIRO_OPERATOR_ADD,
! 					     white, intermediate,
! 					     0, 0,
! 					     traps->traps,
! 					     traps->num_traps);
! 	_cairo_surface_composite (CAIRO_OPERATOR_IN,
! 				  gstate->clip.surface,
! 				  NULL,
! 				  intermediate,
! 				  0, 0, 0, 0, 0, 0,
! 				  gstate->clip.width, gstate->clip.height);
! 	_cairo_surface_composite (operator,
! 				  src, intermediate, dst,
! 				  0, 0,
! 				  0, 0,
! 				  gstate->clip.x,
! 				  gstate->clip.y,
! 				  gstate->clip.width,
! 				  gstate->clip.height);
  	cairo_surface_destroy (intermediate);
  	cairo_surface_destroy (white);
  
      } else {
--- 1239,1275 ----
  	}
  
! 	status = _cairo_surface_composite_trapezoids (CAIRO_OPERATOR_ADD,
! 						      white, intermediate,
! 						      0, 0,
! 						      traps->traps,
! 						      traps->num_traps);
! 	if (status)
! 	    goto BAIL2;
! 
! 	status = _cairo_surface_composite (CAIRO_OPERATOR_IN,
! 					   gstate->clip.surface,
! 					   NULL,
! 					   intermediate,
! 					   0, 0, 0, 0, 0, 0,
! 					   gstate->clip.width, gstate->clip.height);
! 	if (status)
! 	    goto BAIL2;
! 
! 	status = _cairo_surface_composite (operator,
! 					   src, intermediate, dst,
! 					   0, 0,
! 					   0, 0,
! 					   gstate->clip.x,
! 					   gstate->clip.y,
! 					   gstate->clip.width,
! 					   gstate->clip.height);
! 	
!     BAIL2:
  	cairo_surface_destroy (intermediate);
+     BAIL1:
  	cairo_surface_destroy (white);
+     BAIL0:
+ 	if (status)
+ 	    return status;
  
      } else {
***************
*** 1255,1264 ****
  	}
  
! 	_cairo_surface_composite_trapezoids (gstate->operator,
! 					     src, dst,
! 					     xoff - gstate->source_offset.x,
! 					     yoff - gstate->source_offset.y,
! 					     traps->traps,
! 					     traps->num_traps);
      }
  
--- 1284,1295 ----
  	}
  
! 	status = _cairo_surface_composite_trapezoids (gstate->operator,
! 						      src, dst,
! 						      xoff - gstate->source_offset.x,
! 						      yoff - gstate->source_offset.y,
! 						      traps->traps,
! 						      traps->num_traps);
! 	if (status)
! 	    return status;
      }
  
***************
*** 1331,1334 ****
--- 1362,1367 ----
  								    gstate->clip.height,
  								    &white_color);
+ 	if (gstate->clip.surface == NULL)
+ 	    return CAIRO_STATUS_NO_MEMORY;
      }
  
***************
*** 1336,1339 ****
--- 1369,1375 ----
  						     1, 1,
  						     &white_color);
+     if (alpha_one == NULL)
+ 	return CAIRO_STATUS_NO_MEMORY;
+ 
      cairo_surface_set_repeat (alpha_one, 1);
  
***************
*** 1364,1367 ****
--- 1400,1404 ----
  			    int			height)
  {
+     cairo_status_t status;
      cairo_surface_t *mask;
      cairo_matrix_t user_to_image, image_to_user;
***************
*** 1403,1417 ****
      /* XXX: The rendered size is sometimes 1 or 2 pixels short from
         what I expect. Need to fix this. */
!     _cairo_surface_composite (gstate->operator,
! 			      surface, mask, gstate->surface,
! 			      device_x, device_y,
! 			      0, 0,
! 			      device_x, device_y,
! 			      device_width,
! 			      device_height);
! 
      if (mask)
  	cairo_surface_destroy (mask);
  
      /* restore the matrix originally in the surface */
      cairo_surface_set_matrix (surface, &user_to_image);
--- 1440,1457 ----
      /* XXX: The rendered size is sometimes 1 or 2 pixels short from
         what I expect. Need to fix this. */
!     status = _cairo_surface_composite (gstate->operator,
! 				       surface, mask, gstate->surface,
! 				       device_x, device_y,
! 				       0, 0,
! 				       device_x, device_y,
! 				       device_width,
! 				       device_height);
!     
      if (mask)
  	cairo_surface_destroy (mask);
  
+     if (status)
+ 	return status;
+ 
      /* restore the matrix originally in the surface */
      cairo_surface_set_matrix (surface, &user_to_image);

Index: cairo_surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_surface.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** cairo_surface.c	28 Oct 2003 20:18:29 -0000	1.18
--- cairo_surface.c	31 Oct 2003 18:41:37 -0000	1.19
***************
*** 30,105 ****
  #include "cairoint.h"
  
- static const XTransform CAIRO_XTRANSFORM_IDENTITY = {
-     {
- 	{65536,     0,     0},
- 	{    0, 65536,     0},
- 	{    0,     0, 65536}
-     }
- };
- 
- static IcFormat *
- _create_icformat_for_format (cairo_format_t format)
- {
-     switch (format) {
-     case CAIRO_FORMAT_ARGB32:
- 	return IcFormatCreate (IcFormatNameARGB32);
- 	break;
-     case CAIRO_FORMAT_RGB24:
- 	return IcFormatCreate (IcFormatNameRGB24);
- 	break;
-     case CAIRO_FORMAT_A8:
- 	return IcFormatCreate (IcFormatNameA8);
- 	break;
-     case CAIRO_FORMAT_A1:
- 	return IcFormatCreate (IcFormatNameA1);
- 	break;
-     default:
- 	return NULL;
-     }
- }
- 
  void
  _cairo_surface_init (cairo_surface_t			*surface,
! 		     int				width,
! 		     int				height,
! 		     cairo_format_t			format,
! 		     const struct cairo_surface_backend	*backend)
  {
!     surface->width = width;
!     surface->height = height;
! 
!     surface->image_data = NULL;
  
      surface->ref_count = 1;
-     surface->repeat = 0;
- 
-     surface->xtransform = CAIRO_XTRANSFORM_IDENTITY;
- 
-     surface->icimage = NULL;
-     surface->icformat = _create_icformat_for_format (format);
- 
-     surface->backend = backend;
- }
  
! static int
! cairo_format_bpp (cairo_format_t format)
! {
!     switch (format) {
!     case CAIRO_FORMAT_A1:
! 	return 1;
! 	break;
!     case CAIRO_FORMAT_A8:
! 	return 8;
! 	break;
!     case CAIRO_FORMAT_RGB24:
!     case CAIRO_FORMAT_ARGB32:
!     default:
! 	return 32;
! 	break;
!     }
  }
  
- static const struct cairo_surface_backend cairo_icimage_surface_backend;
- 
  cairo_surface_t *
  cairo_surface_create_for_image (char		*data,
--- 30,45 ----
  #include "cairoint.h"
  
  void
  _cairo_surface_init (cairo_surface_t			*surface,
! 		     const cairo_surface_backend_t	*backend)
  {
!     surface->backend = backend;
  
      surface->ref_count = 1;
  
!     _cairo_matrix_init (&surface->matrix);
!     surface->repeat = 0;
  }
  
  cairo_surface_t *
  cairo_surface_create_for_image (char		*data,
***************
*** 109,131 ****
  				int		stride)
  {
!     cairo_surface_t *surface;
! 
!     surface = malloc (sizeof (cairo_surface_t));
!     if (surface == NULL)
! 	return NULL;
! 
!     _cairo_surface_init (surface, width, height, format, &cairo_icimage_surface_backend);
! 
!     surface->icimage = IcImageCreateForData ((IcBits *) data,
! 					     surface->icformat,
! 					     width, height,
! 					     cairo_format_bpp (format),
! 					     stride);
!     if (surface->icimage == NULL) {
! 	free (surface);
! 	return NULL;
!     }
! 
!     return surface;
  }
  slim_hidden_def(cairo_surface_create_for_image);
--- 49,53 ----
  				int		stride)
  {
!     return cairo_image_surface_create_for_data (data, format, width, height, stride);
  }
  slim_hidden_def(cairo_surface_create_for_image);
***************
*** 139,142 ****
--- 61,67 ----
      cairo_color_t empty;
  
+     if (other == NULL)
+ 	return NULL;
+ 
      _cairo_color_init (&empty);
      _cairo_color_set_rgb (&empty, 0., 0., 0.);
***************
*** 153,177 ****
  				     cairo_color_t	*color)
  {
      cairo_surface_t *surface = NULL;
  
!     if (other->backend->create_similar)
! 	surface = other->backend->create_similar (other, format, width, height);
!     if (surface == NULL) {
! 	char *data;
! 	int stride;
! 
! 	stride = ((width * cairo_format_bpp (format)) + 7) >> 3;
! 	data = malloc (stride * height);
! 	if (data == NULL)
! 	    return NULL;
! 
! 	surface = cairo_surface_create_for_image (data, format,
! 						  width, height, stride);
  
! 	/* lodge data in the surface structure to be freed with the surface */
! 	surface->image_data = data;
      }
  
-     _cairo_surface_fill_rectangle (surface, CAIRO_OPERATOR_SRC, color, 0, 0, width, height);
      return surface;
  }
--- 78,96 ----
  				     cairo_color_t	*color)
  {
+     cairo_status_t status;
      cairo_surface_t *surface = NULL;
  
!     surface = other->backend->create_similar (other, format, width, height);
!     if (surface == NULL)
! 	surface = cairo_image_surface_create (format, width, height);
  
!     status = _cairo_surface_fill_rectangle (surface,
! 					    CAIRO_OPERATOR_SRC, color,
! 					    0, 0, width, height);
!     if (status) {
! 	cairo_surface_destroy (surface);
! 	return NULL;
      }
  
      return surface;
  }
***************
*** 196,269 ****
  	return;
  
-     if (surface->icformat)
- 	IcFormatDestroy (surface->icformat);
- 
-     if (surface->icimage)
- 	IcImageDestroy (surface->icimage);
- 
      if (surface->backend->destroy)
  	surface->backend->destroy (surface);
- 
-     if (surface->image_data)
- 	free (surface->image_data);
-     surface->image_data = NULL;
- 
-     free (surface);
  }
  slim_hidden_def(cairo_surface_destroy);
  
- #define CAIRO_SURFACE_PIXELS_PER_INCH_DEFAULT 96.0
  double
  _cairo_surface_pixels_per_inch (cairo_surface_t *surface)
  {
!     if (surface->backend->pixels_per_inch)
! 	return surface->backend->pixels_per_inch (surface);
! 
!     return CAIRO_SURFACE_PIXELS_PER_INCH_DEFAULT;
  }
! void
! _cairo_surface_pull_image (cairo_surface_t *surface)
  {
!     if (surface->backend->pull_image)
! 	surface->backend->pull_image (surface);
  }
  
! void
! _cairo_surface_push_image (cairo_surface_t *surface)
  {
!     if (surface->backend->push_image)
! 	surface->backend->push_image (surface);
  }
  
- /* XXX: We may want to move to projective matrices at some point. If
-    nothing else, that would eliminate the two different transform data
-    structures we have here. */
  cairo_status_t
  cairo_surface_set_matrix (cairo_surface_t *surface, cairo_matrix_t *matrix)
  {
!     cairo_status_t ret = CAIRO_STATUS_SUCCESS;
!     XTransform *xtransform = &surface->xtransform;
! 
!     xtransform->matrix[0][0] = XDoubleToFixed (matrix->m[0][0]);
!     xtransform->matrix[0][1] = XDoubleToFixed (matrix->m[1][0]);
!     xtransform->matrix[0][2] = XDoubleToFixed (matrix->m[2][0]);
! 
!     xtransform->matrix[1][0] = XDoubleToFixed (matrix->m[0][1]);
!     xtransform->matrix[1][1] = XDoubleToFixed (matrix->m[1][1]);
!     xtransform->matrix[1][2] = XDoubleToFixed (matrix->m[2][1]);
! 
!     xtransform->matrix[2][0] = 0;
!     xtransform->matrix[2][1] = 0;
!     xtransform->matrix[2][2] = XDoubleToFixed (1);
! 
!     if (surface->backend->set_matrix)
! 	ret = surface->backend->set_matrix (surface);
  
!     /* XXX: This cast should only occur with a #define hint from libic that it is OK */
!     if (surface->icimage) {
! 	IcImageSetTransform (surface->icimage, (IcTransform *) xtransform);
!     }
  
!     return ret;
  }
  slim_hidden_def(cairo_surface_set_matrix);
--- 115,150 ----
  	return;
  
      if (surface->backend->destroy)
  	surface->backend->destroy (surface);
  }
  slim_hidden_def(cairo_surface_destroy);
  
  double
  _cairo_surface_pixels_per_inch (cairo_surface_t *surface)
  {
!     return surface->backend->pixels_per_inch (surface);
  }
! 
! cairo_image_surface_t *
! _cairo_surface_get_image (cairo_surface_t *surface)
  {
!     return surface->backend->get_image (surface);
  }
  
! cairo_status_t
! _cairo_surface_set_image (cairo_surface_t *surface, cairo_image_surface_t *image)
  {
!     return surface->backend->set_image (surface, image);
  }
  
  cairo_status_t
  cairo_surface_set_matrix (cairo_surface_t *surface, cairo_matrix_t *matrix)
  {
!     if (surface == NULL)
! 	return CAIRO_STATUS_NULL_POINTER;
  
!     cairo_matrix_copy (&surface->matrix, matrix);
  
!     return surface->backend->set_matrix (surface, matrix);
  }
  slim_hidden_def(cairo_surface_set_matrix);
***************
*** 272,286 ****
  cairo_surface_get_matrix (cairo_surface_t *surface, cairo_matrix_t *matrix)
  {
!     XTransform *xtransform = &surface->xtransform;
! 
!     matrix->m[0][0] = _cairo_fixed_to_double (xtransform->matrix[0][0]);
!     matrix->m[1][0] = _cairo_fixed_to_double (xtransform->matrix[0][1]);
!     matrix->m[2][0] = _cairo_fixed_to_double (xtransform->matrix[0][2]);
! 
!     matrix->m[0][1] = _cairo_fixed_to_double (xtransform->matrix[1][0]);
!     matrix->m[1][1] = _cairo_fixed_to_double (xtransform->matrix[1][1]);
!     matrix->m[2][1] = _cairo_fixed_to_double (xtransform->matrix[1][2]);
  
!     return CAIRO_STATUS_SUCCESS;
  }
  slim_hidden_def(cairo_surface_get_matrix);
--- 153,160 ----
  cairo_surface_get_matrix (cairo_surface_t *surface, cairo_matrix_t *matrix)
  {
!     if (surface == NULL)
! 	return CAIRO_STATUS_NULL_POINTER;
  
!     return cairo_matrix_copy (matrix, &surface->matrix);
  }
  slim_hidden_def(cairo_surface_get_matrix);
***************
*** 289,298 ****
  cairo_surface_set_filter (cairo_surface_t *surface, cairo_filter_t filter)
  {
!     if (surface->icimage) {
! 	IcImageSetFilter (surface->icimage, filter);
!     }
! 
!     if (!surface->backend->set_filter)
! 	return CAIRO_STATUS_SUCCESS;
  
      return surface->backend->set_filter (surface, filter);
--- 163,168 ----
  cairo_surface_set_filter (cairo_surface_t *surface, cairo_filter_t filter)
  {
!     if (surface == NULL)
! 	return CAIRO_STATUS_NULL_POINTER;
  
      return surface->backend->set_filter (surface, filter);
***************
*** 317,328 ****
  cairo_surface_set_repeat (cairo_surface_t *surface, int repeat)
  {
!     surface->repeat = repeat;
! 
!     if (surface->icimage) {
! 	IcImageSetRepeat (surface->icimage, repeat);
!     }
  
!     if (!surface->backend->set_repeat)
! 	return CAIRO_STATUS_SUCCESS;
  
      return surface->backend->set_repeat (surface, repeat);
--- 187,194 ----
  cairo_surface_set_repeat (cairo_surface_t *surface, int repeat)
  {
!     if (surface == NULL)
! 	return CAIRO_STATUS_NULL_POINTER;
  
!     surface->repeat = repeat;
  
      return surface->backend->set_repeat (surface, repeat);
***************
*** 330,334 ****
  slim_hidden_def(cairo_surface_set_repeat);
  
! void
  _cairo_surface_composite (cairo_operator_t	operator,
  			  cairo_surface_t	*src,
--- 196,200 ----
  slim_hidden_def(cairo_surface_set_repeat);
  
! cairo_int_status_t
  _cairo_surface_composite (cairo_operator_t	operator,
  			  cairo_surface_t	*src,
***************
*** 345,378 ****
  {
      cairo_int_status_t status;
  
!     if (dst->backend->composite) {
! 	status = dst->backend->composite (operator,
! 					  src, mask, dst,
! 					  src_x, src_y,
! 					  mask_x, mask_y,
! 					  dst_x, dst_y,
! 					  width, height);
! 	if (status == CAIRO_STATUS_SUCCESS)
! 	    return;
!     }
  
!     _cairo_surface_pull_image (src);
      if (mask)
! 	_cairo_surface_pull_image (mask);
!     _cairo_surface_pull_image (dst);
  
!     IcComposite (operator,
! 		 src->icimage,
! 		 mask ? mask->icimage : NULL,
! 		 dst->icimage,
! 		 src_x, src_y,
! 		 mask_x, mask_y,
! 		 dst_x, dst_y,
! 		 width, height);
  
!     _cairo_surface_push_image (dst);
  }
  
! void
  _cairo_surface_fill_rectangle (cairo_surface_t	*surface,
  			       cairo_operator_t	operator,
--- 211,250 ----
  {
      cairo_int_status_t status;
+     cairo_image_surface_t *src_image, *mask_image, *dst_image;
  
!     status = dst->backend->composite (operator,
! 				      src, mask, dst,
! 				      src_x, src_y,
! 				      mask_x, mask_y,
! 				      dst_x, dst_y,
! 				      width, height);
!     if (status != CAIRO_INT_STATUS_UNSUPPORTED)
! 	return status;
  
!     src_image = _cairo_surface_get_image (src);
      if (mask)
! 	mask_image = _cairo_surface_get_image (mask);
!     dst_image = _cairo_surface_get_image (dst);
  
!     dst_image->base.backend->composite (operator,
! 					&src_image->base,
! 					mask ? &mask_image->base : NULL,
! 					dst_image,
! 					src_x, src_y,
! 					mask_x, mask_y,
! 					dst_x, dst_y,
! 					width, height);
  
!     status = _cairo_surface_set_image (dst, dst_image);
! 
!     cairo_surface_destroy (&src_image->base);
!     if (mask)
! 	cairo_surface_destroy (&mask_image->base);
!     cairo_surface_destroy (&dst_image->base);
! 
!     return status;
  }
  
! cairo_status_t
  _cairo_surface_fill_rectangle (cairo_surface_t	*surface,
  			       cairo_operator_t	operator,
***************
*** 390,397 ****
      rect.height = height;
  
!     _cairo_surface_fill_rectangles (surface, operator, color, &rect, 1);
  }
  
! void
  _cairo_surface_fill_rectangles (cairo_surface_t		*surface,
  				cairo_operator_t	operator,
--- 262,269 ----
      rect.height = height;
  
!     return _cairo_surface_fill_rectangles (surface, operator, color, &rect, 1);
  }
  
! cairo_status_t
  _cairo_surface_fill_rectangles (cairo_surface_t		*surface,
  				cairo_operator_t	operator,
***************
*** 401,460 ****
  {
      cairo_int_status_t status;
!     IcColor ic_color;
  
      if (num_rects == 0)
! 	return;
  
!     if (surface->backend->fill_rectangles) {
! 	status = surface->backend->fill_rectangles (surface,
! 						    operator,
! 						    color,
! 						    rects, num_rects);
! 	if (status == CAIRO_STATUS_SUCCESS)
! 	    return;
!     }
  
!     ic_color.red   = color->red_short;
!     ic_color.green = color->green_short;
!     ic_color.blue  = color->blue_short;
!     ic_color.alpha = color->alpha_short;
  
!     _cairo_surface_pull_image (surface);
  
!     /* XXX: The IcRectangle cast is evil... it needs to go away somehow. */
!     IcFillRectangles (operator, surface->icimage,
! 		      &ic_color, (IcRectangle *) rects, num_rects);
  
!     _cairo_surface_push_image (surface);
  }
  
! void
  _cairo_surface_composite_trapezoids (cairo_operator_t		operator,
  				     cairo_surface_t		*src,
  				     cairo_surface_t		*dst,
! 				     int			xSrc,
! 				     int			ySrc,
  				     cairo_trapezoid_t		*traps,
  				     int			num_traps)
  {
      cairo_int_status_t status;
  
!     if (dst->backend->composite_trapezoids) {
! 	status = dst->backend->composite_trapezoids (operator,
! 						     src, dst,
! 						     xSrc, ySrc,
! 						     traps, num_traps);
! 	if (status == CAIRO_STATUS_SUCCESS)
! 	    return;
!     }
  
!     _cairo_surface_pull_image (src);
!     _cairo_surface_pull_image (dst);
  
!     /* XXX: The IcTrapezoid cast is evil and needs to go away somehow. */
!     IcCompositeTrapezoids (operator, src->icimage, dst->icimage,
! 			   xSrc, ySrc, (IcTrapezoid *) traps, num_traps);
  
!     _cairo_surface_push_image (dst);
  }
  
--- 273,336 ----
  {
      cairo_int_status_t status;
!     cairo_image_surface_t *surface_image;
  
      if (num_rects == 0)
! 	return CAIRO_STATUS_SUCCESS;
  
!     status = surface->backend->fill_rectangles (surface,
! 						operator,
! 						color,
! 						rects, num_rects);
!     if (status != CAIRO_INT_STATUS_UNSUPPORTED)
! 	return status;
  
!     surface_image = _cairo_surface_get_image (surface);
  
!     surface_image->base.backend->fill_rectangles (surface_image,
! 						  operator,
! 						  color,
! 						  rects, num_rects);
  
!     status = _cairo_surface_set_image (surface, surface_image);
  
!     cairo_surface_destroy (&surface_image->base);
! 
!     return status;
  }
  
! cairo_status_t
  _cairo_surface_composite_trapezoids (cairo_operator_t		operator,
  				     cairo_surface_t		*src,
  				     cairo_surface_t		*dst,
! 				     int			x_src,
! 				     int			y_src,
  				     cairo_trapezoid_t		*traps,
  				     int			num_traps)
  {
      cairo_int_status_t status;
+     cairo_image_surface_t *src_image, *dst_image;
  
!     status = dst->backend->composite_trapezoids (operator,
! 						 src, dst,
! 						 x_src, y_src,
! 						 traps, num_traps);
!     if (status != CAIRO_INT_STATUS_UNSUPPORTED)
! 	return status;
  
!     src_image = _cairo_surface_get_image (src);
!     dst_image = _cairo_surface_get_image (dst);
  
!     dst_image->base.backend->composite_trapezoids (operator,
! 						   &src_image->base,
! 						   dst_image,
! 						   x_src, y_src,
! 						   traps, num_traps);
  
!     status = _cairo_surface_set_image (dst, dst_image);
! 
!     cairo_surface_destroy (&src_image->base);
!     cairo_surface_destroy (&dst_image->base);
! 
!     return status;
  }
  

Index: cairo_xlib_surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_xlib_surface.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** cairo_xlib_surface.c	31 Oct 2003 02:39:21 -0000	1.8
--- cairo_xlib_surface.c	31 Oct 2003 18:41:37 -0000	1.9
***************
*** 28,32 ****
  #include "cairoint.h"
  #include "cairo-xlib.h"
- #include <X11/Xlibint.h>
  
  void
--- 28,31 ----
***************
*** 50,53 ****
--- 49,54 ----
  
      cairo_set_target_surface (cr, surface);
+ 
+     /* cairo_set_target_surface takes a reference, so we must destroy ours */
      cairo_surface_destroy (surface);
  }
***************
*** 61,70 ****
      int owns_pixmap;
      Visual *visual;
  
      int render_major;
      int render_minor;
  
      Picture picture;
-     XImage *ximage;
  } cairo_xlib_surface_t;
  
--- 62,74 ----
      int owns_pixmap;
      Visual *visual;
+     cairo_format_t format;
  
      int render_major;
      int render_minor;
  
+     int width;
+     int height;
+ 
      Picture picture;
  } cairo_xlib_surface_t;
  
***************
*** 125,129 ****
--- 129,135 ----
  	|| (!CAIRO_SURFACE_RENDER_HAS_COMPOSITE (src)
  	    && format == CAIRO_FORMAT_ARGB32))
+     {
  	return NULL;
+     }
  
      scr = DefaultScreen (dpy);
***************
*** 132,140 ****
  			 width, height,
  			 _CAIRO_FORMAT_DEPTH (format));
! 
      surface = (cairo_xlib_surface_t *)
  	cairo_xlib_surface_create (dpy, pix, NULL, format, DefaultColormap (dpy, scr));
      surface->owns_pixmap = 1;
  
      return &surface->base;
  }
--- 138,149 ----
  			 width, height,
  			 _CAIRO_FORMAT_DEPTH (format));
!     
      surface = (cairo_xlib_surface_t *)
  	cairo_xlib_surface_create (dpy, pix, NULL, format, DefaultColormap (dpy, scr));
      surface->owns_pixmap = 1;
  
+     surface->width = width;
+     surface->height = height;
+ 
      return &surface->base;
  }
***************
*** 150,162 ****
  	XFreePixmap (surface->dpy, surface->drawable);
  
-     if (surface->ximage) {
- 	surface->ximage->data = NULL;
- 	XDestroyImage(surface->ximage);
-     }
- 
      if (surface->gc)
  	XFreeGC (surface->dpy, surface->gc);
  
      surface->dpy = 0;
  }
  
--- 159,168 ----
  	XFreePixmap (surface->dpy, surface->drawable);
  
      if (surface->gc)
  	XFreeGC (surface->dpy, surface->gc);
  
      surface->dpy = 0;
+ 
+     free (surface);
  }
  
***************
*** 168,210 ****
  }
  
! static void
! _cairo_xlib_surface_pull_image (void *abstract_surface)
  {
      cairo_xlib_surface_t *surface = abstract_surface;
      Window root_ignore;
      int x_ignore, y_ignore, bwidth_ignore, depth_ignore;
  
!     if (surface == NULL)
! 	return;
  
!     if (surface->base.icimage) {
! 	IcImageDestroy (surface->base.icimage);
! 	surface->base.icimage = NULL;
!     }
  
!     XGetGeometry(surface->dpy, 
! 		 surface->drawable, 
! 		 &root_ignore, &x_ignore, &y_ignore,
! 		 &surface->base.width, &surface->base.height,
! 		 &bwidth_ignore, &depth_ignore);
  
!     surface->ximage = XGetImage (surface->dpy,
! 				 surface->drawable,
! 				 0, 0,
! 				 surface->base.width, surface->base.height,
! 				 AllPlanes, ZPixmap);
  
!     surface->base.icimage = IcImageCreateForData ((IcBits *)(surface->ximage->data),
! 						  surface->base.icformat,
! 						  surface->ximage->width, 
! 						  surface->ximage->height,
! 						  surface->ximage->bits_per_pixel, 
! 						  surface->ximage->bytes_per_line);
       
!     IcImageSetRepeat (surface->base.icimage, surface->base.repeat);
!     /* XXX: Evil cast here... */
!     IcImageSetTransform (surface->base.icimage, (IcTransform *) &(surface->base.xtransform));
!     
!     /* XXX: Add support here for pictures with external alpha. */
  }
  
--- 174,234 ----
  }
  
! static cairo_image_surface_t *
! _cairo_xlib_surface_get_image (void *abstract_surface)
  {
      cairo_xlib_surface_t *surface = abstract_surface;
+     cairo_image_surface_t *image;
+ 
+     XImage *ximage;
      Window root_ignore;
      int x_ignore, y_ignore, bwidth_ignore, depth_ignore;
  
!     XGetGeometry (surface->dpy, 
! 		  surface->drawable, 
! 		  &root_ignore, &x_ignore, &y_ignore,
! 		  &surface->width, &surface->height,
! 		  &bwidth_ignore, &depth_ignore);
  
!     ximage = XGetImage (surface->dpy,
! 			surface->drawable,
! 			0, 0,
! 			surface->width, surface->height,
! 			AllPlanes, ZPixmap);
  
!     if (surface->visual) {
! 	cairo_format_masks_t masks;
  
! 	/* XXX: Add support here for pictures with external alpha? */
  
! 	masks.bpp = ximage->bits_per_pixel;
! 	masks.alpha_mask = 0;
! 	masks.red_mask = surface->visual->red_mask;
! 	masks.green_mask = surface->visual->green_mask;
! 	masks.blue_mask = surface->visual->blue_mask;
! 
! 	image = _cairo_image_surface_create_with_masks (ximage->data,
! 							&masks,
! 							ximage->width, 
! 							ximage->height,
! 							ximage->bytes_per_line);
!     } else {
! 	image = (cairo_image_surface_t *)
! 	    cairo_image_surface_create_for_data (ximage->data,
! 						 surface->format,
! 						 ximage->width, 
! 						 ximage->height,
! 						 ximage->bytes_per_line);
!     }
! 
!     /* Let the surface take ownership of the data */
!     /* XXX: Can probably come up with a cleaner API here. */
!     _cairo_image_surface_assume_ownership_of_data (image);
!     ximage->data = NULL;
!     XDestroyImage (ximage);
       
!     _cairo_image_surface_set_repeat (image, surface->base.repeat);
!     _cairo_image_surface_set_matrix (image, &(surface->base.matrix));
! 
!     return image;
  }
  
***************
*** 218,255 ****
  }
  
! static void
! _cairo_xlib_surface_push_image (void *abstract_surface)
  {
      cairo_xlib_surface_t *surface = abstract_surface;
!     if (surface == NULL)
! 	return;
  
!     if (surface->ximage == NULL)
! 	return;
  
      _cairo_xlib_surface_ensure_gc (surface);
!     XPutImage (surface->dpy,
! 	       surface->drawable,
! 	       surface->gc,
! 	       surface->ximage,
! 	       0, 0,
! 	       0, 0,
! 	       surface->base.width,
! 	       surface->base.height);
  
!     XDestroyImage(surface->ximage);
!     surface->ximage = NULL;
  }
  
  static cairo_status_t
! _cairo_xlib_surface_set_matrix (void *abstract_surface)
  {
      cairo_xlib_surface_t *surface = abstract_surface;
      if (!surface->picture)
  	return CAIRO_STATUS_SUCCESS;
  
      if (CAIRO_SURFACE_RENDER_HAS_PICTURE_TRANSFORM (surface))
      {
! 	XRenderSetPictureTransform (surface->dpy, surface->picture, &surface->base.xtransform);
      } else {
  	/* XXX: Need support here if using an old RENDER without support
--- 242,311 ----
  }
  
! static cairo_status_t
! _cairo_xlib_surface_set_image (void			*abstract_surface,
! 			       cairo_image_surface_t	*image)
  {
      cairo_xlib_surface_t *surface = abstract_surface;
!     XImage *ximage;
!     unsigned bitmap_pad;
  
!     if (image->depth > 16)
! 	bitmap_pad = 32;
!     else if (image->depth > 8)
! 	bitmap_pad = 16;
!     else
! 	bitmap_pad = 8;
! 
!     ximage = XCreateImage (surface->dpy,
! 			   DefaultVisual(surface->dpy, DefaultScreen(surface->dpy)),
! 			   image->depth == 32 ? 24 : image->depth,
! 			   ZPixmap,
! 			   0,
! 			   image->data,
! 			   image->width,
! 			   image->height,
! 			   bitmap_pad,
! 			   image->stride);
!     if (ximage == NULL)
! 	return CAIRO_STATUS_NO_MEMORY;
  
      _cairo_xlib_surface_ensure_gc (surface);
!     XPutImage(surface->dpy, surface->drawable, surface->gc,
! 	      ximage, 0, 0, 0, 0,
! 	      surface->width,
! 	      surface->height);
  
!     /* Foolish XDestroyImage thinks it can free my data, but I won't
!        stand for it. */
!     ximage->data = NULL;
!     XDestroyImage (ximage);
! 
!     return CAIRO_STATUS_SUCCESS;
  }
  
  static cairo_status_t
! _cairo_xlib_surface_set_matrix (void *abstract_surface, cairo_matrix_t *matrix)
  {
      cairo_xlib_surface_t *surface = abstract_surface;
+     XTransform xtransform;
+ 
      if (!surface->picture)
  	return CAIRO_STATUS_SUCCESS;
  
+     xtransform.matrix[0][0] = _cairo_fixed_from_double (matrix->m[0][0]);
+     xtransform.matrix[0][1] = _cairo_fixed_from_double (matrix->m[1][0]);
+     xtransform.matrix[0][2] = _cairo_fixed_from_double (matrix->m[2][0]);
+ 
+     xtransform.matrix[1][0] = _cairo_fixed_from_double (matrix->m[0][1]);
+     xtransform.matrix[1][1] = _cairo_fixed_from_double (matrix->m[1][1]);
+     xtransform.matrix[1][2] = _cairo_fixed_from_double (matrix->m[2][1]);
+ 
+     xtransform.matrix[2][0] = 0;
+     xtransform.matrix[2][1] = 0;
+     xtransform.matrix[2][2] = _cairo_fixed_from_double (1);
+ 
      if (CAIRO_SURFACE_RENDER_HAS_PICTURE_TRANSFORM (surface))
      {
! 	XRenderSetPictureTransform (surface->dpy, surface->picture, &xtransform);
      } else {
  	/* XXX: Need support here if using an old RENDER without support
***************
*** 260,294 ****
  }
  
! /* XXX: The Render specification has capitalized versions of these
!    strings. However, the current implementation is case-sensitive and
!    expects lowercase versions. */
! static char *
! _render_filter_name (cairo_filter_t filter)
  {
      switch (filter) {
      case CAIRO_FILTER_FAST:
! 	return "fast";
      case CAIRO_FILTER_GOOD:
! 	return "good";
      case CAIRO_FILTER_BEST:
! 	return "best";
      case CAIRO_FILTER_NEAREST:
! 	return "nearest";
      case CAIRO_FILTER_BILINEAR:
! 	return "bilinear";
      default:
! 	return "best";
      }
- }
- 
- static cairo_status_t
- _cairo_xlib_surface_set_filter (void *abstract_surface, cairo_filter_t filter)
- {
-     cairo_xlib_surface_t *surface = abstract_surface;
-     if (!surface->picture)
- 	return CAIRO_STATUS_SUCCESS;
  
      XRenderSetPictureFilter (surface->dpy, surface->picture,
! 			     _render_filter_name (filter), NULL, 0);
  
      return CAIRO_STATUS_SUCCESS;
--- 316,349 ----
  }
  
! static cairo_status_t
! _cairo_xlib_surface_set_filter (void *abstract_surface, cairo_filter_t filter)
  {
+     cairo_xlib_surface_t *surface = abstract_surface;
+     char *render_filter;
+ 
+     if (!surface->picture)
+ 	return CAIRO_STATUS_SUCCESS;
+ 
+    /* XXX: The Render specification has capitalized versions of these
+            strings. However, the current implementation is
+            case-sensitive and expects lowercase versions.
+    */
      switch (filter) {
      case CAIRO_FILTER_FAST:
! 	render_filter = "fast";
      case CAIRO_FILTER_GOOD:
! 	render_filter = "good";
      case CAIRO_FILTER_BEST:
! 	render_filter = "best";
      case CAIRO_FILTER_NEAREST:
! 	render_filter = "nearest";
      case CAIRO_FILTER_BILINEAR:
! 	render_filter = "bilinear";
      default:
! 	render_filter = "best";
      }
  
      XRenderSetPictureFilter (surface->dpy, surface->picture,
! 			     render_filter, NULL, 0);
  
      return CAIRO_STATUS_SUCCESS;
***************
*** 313,383 ****
  }
  
! static cairo_status_t
! _cairo_xlib_surface_put_image (cairo_xlib_surface_t	*surface,
! 			      char			*data,
! 			      int			width,
! 			      int			height,
! 			      int			stride,
! 			      int			depth)
  {
!     XImage *image;
!     unsigned bitmap_pad;
!     
!     if (!surface->picture)
! 	return CAIRO_STATUS_SUCCESS;
! 
!     if (depth > 16)
! 	bitmap_pad = 32;
!     else if (depth > 8)
! 	bitmap_pad = 16;
!     else
! 	bitmap_pad = 8;
! 
!     image = XCreateImage(surface->dpy,
! 			 DefaultVisual(surface->dpy, DefaultScreen(surface->dpy)),
! 			 depth, ZPixmap, 0,
! 			 data, width, height,
! 			 bitmap_pad,
! 			 stride);
!     if (image == NULL)
! 	return CAIRO_STATUS_NO_MEMORY;
  
!     _cairo_xlib_surface_ensure_gc (surface);
!     XPutImage(surface->dpy, surface->drawable, surface->gc,
! 	      image, 0, 0, 0, 0, width, height);
  
!     /* Foolish XDestroyImage thinks it can free my data, but I won't
!        stand for it. */
!     image->data = NULL;
!     XDestroyImage(image);
!     
!     return CAIRO_STATUS_SUCCESS;
! }
  
! static cairo_xlib_surface_t *
! _cairo_xlib_surface_clone_from (cairo_surface_t *src, cairo_xlib_surface_t *tmpl, 
!                                 cairo_format_t fmt, int depth)
! {
!     cairo_matrix_t matrix;
!     cairo_xlib_surface_t *src_on_server;
  
!     _cairo_surface_pull_image (src);
  
!     src_on_server = (cairo_xlib_surface_t *)
! 	_cairo_xlib_surface_create_similar (tmpl, fmt,
! 					    IcImageGetWidth (src->icimage),
! 					    IcImageGetHeight (src->icimage));
!     if (src_on_server == NULL)
! 	return NULL;
  
!     cairo_surface_get_matrix (src, &matrix);
!     cairo_surface_set_matrix (&src_on_server->base, &matrix);
  
!     _cairo_xlib_surface_put_image (src_on_server,
! 				  (char *) IcImageGetData (src->icimage),
! 				  IcImageGetWidth (src->icimage),
! 				  IcImageGetHeight (src->icimage),
! 				  IcImageGetStride (src->icimage), depth);
!     return src_on_server;
  }
  
--- 368,433 ----
  }
  
! static cairo_xlib_surface_t *
! _cairo_xlib_surface_clone_similar (cairo_surface_t	*src,
! 				   cairo_xlib_surface_t	*template,
! 				   cairo_format_t	format,
! 				   int			depth)
  {
!     cairo_xlib_surface_t *clone;
!     cairo_image_surface_t *src_image;
  
!     src_image = _cairo_surface_get_image (src);
  
!     clone = (cairo_xlib_surface_t *)
! 	_cairo_xlib_surface_create_similar (template, format,
! 					    src_image->width,
! 					    src_image->height);
!     if (clone == NULL)
! 	return NULL;
  
!     _cairo_xlib_surface_set_image (clone, src_image);
  
!     _cairo_xlib_surface_set_matrix (clone, &(src_image->base.matrix));
  
!     cairo_surface_destroy (&src_image->base);
  
!     return clone;
! }
  
! static int
! _render_operator (cairo_operator_t operator)
! {
!     switch (operator) {
!     case CAIRO_OPERATOR_CLEAR:
! 	return PictOpClear;
!     case CAIRO_OPERATOR_SRC:
! 	return PictOpSrc;
!     case CAIRO_OPERATOR_DST:
! 	return PictOpDst;
!     case CAIRO_OPERATOR_OVER:
! 	return PictOpOver;
!     case CAIRO_OPERATOR_OVER_REVERSE:
! 	return PictOpOverReverse;
!     case CAIRO_OPERATOR_IN:
! 	return PictOpIn;
!     case CAIRO_OPERATOR_IN_REVERSE:
! 	return PictOpInReverse;
!     case CAIRO_OPERATOR_OUT:
! 	return PictOpOut;
!     case CAIRO_OPERATOR_OUT_REVERSE:
! 	return PictOpOutReverse;
!     case CAIRO_OPERATOR_ATOP:
! 	return PictOpAtop;
!     case CAIRO_OPERATOR_ATOP_REVERSE:
! 	return PictOpAtopReverse;
!     case CAIRO_OPERATOR_XOR:
! 	return PictOpXor;
!     case CAIRO_OPERATOR_ADD:
! 	return PictOpAdd;
!     case CAIRO_OPERATOR_SATURATE:
! 	return PictOpSaturate;
!     default:
! 	return PictOpOver;
!     }
  }
  
***************
*** 407,411 ****
  
      if (generic_src->backend != dst->base.backend || src->dpy != dst->dpy) {
! 	src_clone = _cairo_xlib_surface_clone_from (generic_src, dst, CAIRO_FORMAT_ARGB32, 32);
  	if (!src_clone)
  	    return CAIRO_INT_STATUS_UNSUPPORTED;
--- 457,462 ----
  
      if (generic_src->backend != dst->base.backend || src->dpy != dst->dpy) {
! 	src_clone = _cairo_xlib_surface_clone_similar (generic_src, dst,
! 						       CAIRO_FORMAT_ARGB32, 32);
  	if (!src_clone)
  	    return CAIRO_INT_STATUS_UNSUPPORTED;
***************
*** 413,417 ****
      }
      if (generic_mask && (generic_mask->backend != dst->base.backend || mask->dpy != dst->dpy)) {
! 	mask_clone = _cairo_xlib_surface_clone_from (generic_mask, dst, CAIRO_FORMAT_A8, 8);
  	if (!mask_clone)
  	    return CAIRO_INT_STATUS_UNSUPPORTED;
--- 464,469 ----
      }
      if (generic_mask && (generic_mask->backend != dst->base.backend || mask->dpy != dst->dpy)) {
! 	mask_clone = _cairo_xlib_surface_clone_similar (generic_mask, dst,
! 							CAIRO_FORMAT_A8, 8);
  	if (!mask_clone)
  	    return CAIRO_INT_STATUS_UNSUPPORTED;
***************
*** 419,423 ****
      }
  
!     XRenderComposite (dst->dpy, operator,
  		      src->picture,
  		      mask ? mask->picture : 0,
--- 471,476 ----
      }
  
!     XRenderComposite (dst->dpy,
! 		      _render_operator (operator),
  		      src->picture,
  		      mask ? mask->picture : 0,
***************
*** 457,461 ****
  
      /* XXX: This XRectangle cast is evil... it needs to go away somehow. */
!     XRenderFillRectangles (surface->dpy, operator, surface->picture,
  			   &render_color, (XRectangle *) rects, num_rects);
  
--- 510,516 ----
  
      /* XXX: This XRectangle cast is evil... it needs to go away somehow. */
!     XRenderFillRectangles (surface->dpy,
! 			   _render_operator (operator),
! 			   surface->picture,
  			   &render_color, (XRectangle *) rects, num_rects);
  
***************
*** 480,484 ****
  
      if (generic_src->backend != dst->base.backend || src->dpy != dst->dpy) {
! 	src_clone = _cairo_xlib_surface_clone_from (generic_src, dst, CAIRO_FORMAT_ARGB32, 32);
  	if (!src_clone)
  	    return CAIRO_INT_STATUS_UNSUPPORTED;
--- 535,540 ----
  
      if (generic_src->backend != dst->base.backend || src->dpy != dst->dpy) {
! 	src_clone = _cairo_xlib_surface_clone_similar (generic_src, dst,
! 						       CAIRO_FORMAT_ARGB32, 32);
  	if (!src_clone)
  	    return CAIRO_INT_STATUS_UNSUPPORTED;
***************
*** 487,491 ****
  
      /* XXX: The XTrapezoid cast is evil and needs to go away somehow. */
!     XRenderCompositeTrapezoids (dst->dpy, operator, src->picture, dst->picture,
  				XRenderFindStandardFormat (dst->dpy, PictStandardA8),
  				xSrc, ySrc, (XTrapezoid *) traps, num_traps);
--- 543,549 ----
  
      /* XXX: The XTrapezoid cast is evil and needs to go away somehow. */
!     XRenderCompositeTrapezoids (dst->dpy,
! 				_render_operator (operator),
! 				src->picture, dst->picture,
  				XRenderFindStandardFormat (dst->dpy, PictStandardA8),
  				xSrc, ySrc, (XTrapezoid *) traps, num_traps);
***************
*** 505,510 ****
      _cairo_xlib_surface_destroy,
      _cairo_xlib_surface_pixels_per_inch,
!     _cairo_xlib_surface_pull_image,
!     _cairo_xlib_surface_push_image,
      _cairo_xlib_surface_set_matrix,
      _cairo_xlib_surface_set_filter,
--- 563,568 ----
      _cairo_xlib_surface_destroy,
      _cairo_xlib_surface_pixels_per_inch,
!     _cairo_xlib_surface_get_image,
!     _cairo_xlib_surface_set_image,
      _cairo_xlib_surface_set_matrix,
      _cairo_xlib_surface_set_filter,
***************
*** 523,526 ****
--- 581,585 ----
  {
      cairo_xlib_surface_t *surface;
+     int render_standard;
  
      surface = malloc (sizeof (cairo_xlib_surface_t));
***************
*** 528,544 ****
  	return NULL;
  
!     /* XXX: How to get the proper width/height? Force a roundtrip? And
!        how can we track the width/height properly? Shall we give up on
!        supporting Windows and only allow drawing to pixmaps? */
!     _cairo_surface_init (&surface->base, 0, 0, format, &cairo_xlib_surface_backend);
  
!     if (visual) {
! 	if (surface->base.icformat)
! 	    IcFormatDestroy (surface->base.icformat);
! 	surface->base.icformat = IcFormatCreateMasks (32, 0,
! 						      visual->red_mask,
! 						      visual->green_mask,
! 						      visual->blue_mask);
!     }
  
      surface->dpy = dpy;
--- 587,594 ----
  	return NULL;
  
!     _cairo_surface_init (&surface->base, &cairo_xlib_surface_backend);
  
!     surface->visual = visual;
!     surface->format = format;
  
      surface->dpy = dpy;
***************
*** 554,557 ****
--- 604,623 ----
      }
  
+     switch (format) {
+     case CAIRO_FORMAT_A1:
+ 	render_standard = PictStandardA1;
+ 	break;
+     case CAIRO_FORMAT_A8:
+ 	render_standard = PictStandardA8;
+ 	break;
+     case CAIRO_FORMAT_RGB24:
+ 	render_standard = PictStandardRGB24;
+ 	break;
+     case CAIRO_FORMAT_ARGB32:
+     default:
+ 	render_standard = PictStandardARGB32;
+ 	break;
+     }
+ 
      /* XXX: I'm currently ignoring the colormap. Is that bad? */
      if (CAIRO_SURFACE_RENDER_HAS_CREATE_PICTURE (surface))
***************
*** 559,569 ****
  						 visual ?
  						 XRenderFindVisualFormat (dpy, visual) :
! 						 XRenderFindStandardFormat (dpy, format),
  						 0, NULL);
      else
  	surface->picture = 0;
  
-     surface->ximage = NULL;
- 
      return (cairo_surface_t *) surface;
  }
--- 625,633 ----
  						 visual ?
  						 XRenderFindVisualFormat (dpy, visual) :
! 						 XRenderFindStandardFormat (dpy, render_standard),
  						 0, NULL);
      else
  	surface->picture = 0;
  
      return (cairo_surface_t *) surface;
  }

Index: cairoint.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairoint.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** cairoint.h	30 Oct 2003 18:55:04 -0000	1.35
--- cairoint.h	31 Oct 2003 18:41:37 -0000	1.36
***************
*** 37,40 ****
--- 37,42 ----
  #define _CAIROINT_H_
  
+ #include <X11/extensions/Xrender.h>
+ 
  #include <assert.h>
  #include <stdlib.h>
***************
*** 229,233 ****
  typedef struct cairo_color cairo_color_t;
  
! struct cairo_font_backend {
  
      cairo_status_t (*font_extents)   (cairo_font_t         *font,
--- 231,235 ----
  typedef struct cairo_color cairo_color_t;
  
! typedef struct cairo_font_backend {
  
      cairo_status_t (*font_extents)   (cairo_font_t         *font,
***************
*** 277,287 ****
      void (*destroy)		     (cairo_font_t        *font);
    
! };
  
  /* concrete font backends */
  extern const struct cairo_font_backend cairo_ft_font_backend;
  
  
! struct cairo_surface_backend {
      cairo_surface_t *
      (*create_similar)		(void			*surface,
--- 279,290 ----
      void (*destroy)		     (cairo_font_t        *font);
    
! } cairo_font_backend_t;
  
  /* concrete font backends */
  extern const struct cairo_font_backend cairo_ft_font_backend;
  
+ typedef struct cairo_image_surface cairo_image_surface_t;
  
! typedef struct cairo_surface_backend {
      cairo_surface_t *
      (*create_similar)		(void			*surface,
***************
*** 296,307 ****
      (*pixels_per_inch)		(void			*surface);
  
!     void
!     (*pull_image)		(void			*surface);
  
!     void
!     (*push_image)		(void			*surface);
  
      cairo_status_t
!     (*set_matrix)		(void			*surface);
  
      cairo_status_t
--- 299,317 ----
      (*pixels_per_inch)		(void			*surface);
  
!     /* XXX: We could use a better name than get_image here. Something
!        to suggest the fact that the function will create a new
!        surface, (and hence that it needs to be destroyed). Perhaps
!        clone_image or maybe simply clone? */
  
!     cairo_image_surface_t *
!     (*get_image)		(void			*surface);
  
      cairo_status_t
!     (*set_image)		(void			*surface,
! 				 cairo_image_surface_t	*image);
! 
!     cairo_status_t
!     (*set_matrix)		(void			*surface,
! 				 cairo_matrix_t		*matrix);
  
      cairo_status_t
***************
*** 344,364 ****
  				 cairo_trapezoid_t	*traps,
  				 int			num_traps);
  };
  
! struct cairo_surface {
!     int width;
!     int height;
  
!     char *image_data;
  
      unsigned int ref_count;
      int repeat;
  
!     XTransform xtransform;
  
!     IcImage *icimage;
!     IcFormat *icformat;
  
!     const struct cairo_surface_backend *backend;
  };
  
--- 354,393 ----
  				 cairo_trapezoid_t	*traps,
  				 int			num_traps);
+ } cairo_surface_backend_t;
+ 
+ struct cairo_matrix {
+     double m[3][2];
  };
  
! typedef struct cairo_format_masks {
!     int bpp;
!     unsigned long alpha_mask;
!     unsigned long red_mask;
!     unsigned long green_mask;
!     unsigned long blue_mask;
! } cairo_format_masks_t;
  
! struct cairo_surface {
!     const cairo_surface_backend_t *backend;
  
      unsigned int ref_count;
+ 
+     cairo_matrix_t matrix;
      int repeat;
+ };
  
! struct cairo_image_surface {
!     cairo_surface_t base;
  
!     /* libic-specific fields */
!     char *data;
!     int owns_data;
  
!     int width;
!     int height;
!     int stride;
!     int depth;
! 
!     IcImage *ic_image;
  };
  
***************
*** 381,388 ****
  };
  
- struct cairo_matrix {
-     double m[3][2];
- };
- 
  typedef struct cairo_traps {
      cairo_trapezoid_t *traps;
--- 410,413 ----
***************
*** 523,532 ****
  
  extern cairo_status_t __internal_linkage
- _cairo_gstate_set_visual (cairo_gstate_t *gstate, Visual *visual);
- 
- extern cairo_status_t __internal_linkage
- _cairo_gstate_set_format (cairo_gstate_t *gstate, cairo_format_t format);
- 
- extern cairo_status_t __internal_linkage
  _cairo_gstate_set_target_surface (cairo_gstate_t *gstate, cairo_surface_t *surface);
  
--- 548,551 ----
***************
*** 897,906 ****
  extern void __internal_linkage
  _cairo_surface_init (cairo_surface_t			*surface,
! 		     int				width,
! 		     int				height,
! 		     cairo_format_t			format,
! 		     const struct cairo_surface_backend	*backend);
  
! extern void __internal_linkage
  _cairo_surface_fill_rectangle (cairo_surface_t	*surface,
  			       cairo_operator_t	operator,
--- 916,922 ----
  extern void __internal_linkage
  _cairo_surface_init (cairo_surface_t			*surface,
! 		     const cairo_surface_backend_t	*backend);
  
! extern cairo_status_t __internal_linkage
  _cairo_surface_fill_rectangle (cairo_surface_t	*surface,
  			       cairo_operator_t	operator,
***************
*** 911,915 ****
  			       int		height);
  
! extern void __internal_linkage
  _cairo_surface_composite (cairo_operator_t	operator,
  			  cairo_surface_t	*src,
--- 927,931 ----
  			       int		height);
  
! extern cairo_status_t __internal_linkage
  _cairo_surface_composite (cairo_operator_t	operator,
  			  cairo_surface_t	*src,
***************
*** 925,929 ****
  			  unsigned int		height);
  
! extern void __internal_linkage
  _cairo_surface_fill_rectangles (cairo_surface_t		*surface,
  				cairo_operator_t	operator,
--- 941,945 ----
  			  unsigned int		height);
  
! extern cairo_status_t __internal_linkage
  _cairo_surface_fill_rectangles (cairo_surface_t		*surface,
  				cairo_operator_t	operator,
***************
*** 932,936 ****
  				int			num_rects);
  
! extern void __internal_linkage
  _cairo_surface_composite_trapezoids (cairo_operator_t	operator,
  				     cairo_surface_t	*src,
--- 948,952 ----
  				int			num_rects);
  
! extern cairo_status_t __internal_linkage
  _cairo_surface_composite_trapezoids (cairo_operator_t	operator,
  				     cairo_surface_t	*src,
***************
*** 944,953 ****
  _cairo_surface_pixels_per_inch (cairo_surface_t *surface);
  
! extern void __internal_linkage
! _cairo_surface_pull_image (cairo_surface_t *surface);
  
  extern void __internal_linkage
! _cairo_surface_push_image (cairo_surface_t *surface);
  
  
  /* cairo_pen.c */
--- 960,988 ----
  _cairo_surface_pixels_per_inch (cairo_surface_t *surface);
  
! extern cairo_image_surface_t * __internal_linkage
! _cairo_surface_get_image (cairo_surface_t *surface);
! 
! extern cairo_status_t __internal_linkage
! _cairo_surface_set_image (cairo_surface_t	*surface,
! 			  cairo_image_surface_t	*image);
! 
! /* cairo_image_surface.c */
! 
! extern cairo_image_surface_t * __internal_linkage
! _cairo_image_surface_create_with_masks (char			*data,
! 					cairo_format_masks_t	*format,
! 					int			width,
! 					int			height,
! 					int			stride);
  
  extern void __internal_linkage
! _cairo_image_surface_assume_ownership_of_data (cairo_image_surface_t *surface);
  
+ extern cairo_status_t __internal_linkage
+ _cairo_image_surface_set_matrix (cairo_image_surface_t	*surface,
+ 				 cairo_matrix_t		*matrix);
+ 
+ extern cairo_status_t __internal_linkage
+ _cairo_image_surface_set_repeat (cairo_image_surface_t *surface, int repeat);
  
  /* cairo_pen.c */





More information about the cairo-commit mailing list