[cairo-commit] libpixman/src ictrap.c,1.9,1.10

Dave Beckett commit at pdx.freedesktop.org
Wed Dec 10 14:21:38 PST 2003


Committed by: dajobe

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

Modified Files:
	ictrap.c 
Log Message:
Rename exported Ic* and PixRegion* functions, types, enums
to be prefixed pixman (or PIXMAN for enum values)


Index: ictrap.c
===================================================================
RCS file: /cvs/cairo/libpixman/src/ictrap.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** ictrap.c	29 Oct 2003 18:45:02 -0000	1.9
--- ictrap.c	10 Dec 2003 22:21:36 -0000	1.10
***************
*** 30,40 ****
  #define MAX(a,b) ((a) > (b) ? (a) : (b))
  
! IcImage *
! IcCreateAlphaPicture (IcImage	*dst,
! 		      IcFormat	*format,
  		      uint16_t	width,
  		      uint16_t	height)
  {
!     IcImage	*image;
      int own_format = 0;
  
--- 30,40 ----
  #define MAX(a,b) ((a) > (b) ? (a) : (b))
  
! pixman_image_t *
! IcCreateAlphaPicture (pixman_image_t	*dst,
! 		      pixman_format_t	*format,
  		      uint16_t	width,
  		      uint16_t	height)
  {
!     pixman_image_t	*image;
      int own_format = 0;
  
***************
*** 46,63 ****
  	own_format = 1;
  	if (dst->polyEdge == PolyEdgeSharp)
! 	    format = IcFormatCreate (IcFormatNameA1);
  	else
! 	    format = IcFormatCreate (IcFormatNameA8);
  	if (!format)
  	    return 0;
      }
  
!     image = IcImageCreate (format, width, height); 
  
      if (own_format)
! 	IcFormatDestroy (format);
  
      /* XXX: Is this a reasonable way to clear the image? Would
!        probably be preferable to use IcImageFillRectangle once such a
         beast exists. */
      memset (image->pixels->data, 0, height * image->pixels->stride);
--- 46,63 ----
  	own_format = 1;
  	if (dst->polyEdge == PolyEdgeSharp)
! 	    format = pixman_format_tCreate (PIXMAN_FORMAT_NAME_A1);
  	else
! 	    format = pixman_format_tCreate (PIXMAN_FORMAT_NAME_A8);
  	if (!format)
  	    return 0;
      }
  
!     image = pixman_image_tCreate (format, width, height); 
  
      if (own_format)
! 	pixman_format_tDestroy (format);
  
      /* XXX: Is this a reasonable way to clear the image? Would
!        probably be preferable to use pixman_image_tFillRectangle once such a
         beast exists. */
      memset (image->pixels->data, 0, height * image->pixels->stride);
***************
*** 66,82 ****
  }
  
! static IcFixed16_16
! IcLineFixedX (const IcLineFixed *l, IcFixed16_16 y, int ceil)
  {
!     IcFixed16_16    dx = l->p2.x - l->p1.x;
      xFixed_32_32    ex = (xFixed_32_32) (y - l->p1.y) * dx;
!     IcFixed16_16    dy = l->p2.y - l->p1.y;
      if (ceil)
  	ex += (dy - 1);
!     return l->p1.x + (IcFixed16_16) (ex / dy);
  }
  
  static void
! IcTrapezoidBounds (int ntrap, const IcTrapezoid *traps, PixRegionBox *box)
  {
      box->y1 = MAXSHORT;
--- 66,82 ----
  }
  
! static pixman_fixed16_16_t
! pixman_line_fixed_tX (const pixman_line_fixed_t *l, pixman_fixed16_16_t y, int ceil)
  {
!     pixman_fixed16_16_t    dx = l->p2.x - l->p1.x;
      xFixed_32_32    ex = (xFixed_32_32) (y - l->p1.y) * dx;
!     pixman_fixed16_16_t    dy = l->p2.y - l->p1.y;
      if (ceil)
  	ex += (dy - 1);
!     return l->p1.x + (pixman_fixed16_16_t) (ex / dy);
  }
  
  static void
! pixman_trapezoid_tBounds (int ntrap, const pixman_trapezoid_t *traps, pixman_box16_t *box)
  {
      box->y1 = MAXSHORT;
***************
*** 98,108 ****
  	    box->y2 = y2;
  	
! 	x1 = xFixedToInt (MIN (IcLineFixedX (&traps->left, traps->top, 0),
! 			       IcLineFixedX (&traps->left, traps->bottom, 0)));
  	if (x1 < box->x1)
  	    box->x1 = x1;
  	
! 	x2 = xFixedToInt (xFixedCeil (MAX (IcLineFixedX (&traps->right, traps->top, 1),
! 					   IcLineFixedX (&traps->right, traps->bottom, 1))));
  	if (x2 > box->x2)
  	    box->x2 = x2;
--- 98,108 ----
  	    box->y2 = y2;
  	
! 	x1 = xFixedToInt (MIN (pixman_line_fixed_tX (&traps->left, traps->top, 0),
! 			       pixman_line_fixed_tX (&traps->left, traps->bottom, 0)));
  	if (x1 < box->x1)
  	    box->x1 = x1;
  	
! 	x2 = xFixedToInt (xFixedCeil (MAX (pixman_line_fixed_tX (&traps->right, traps->top, 1),
! 					   pixman_line_fixed_tX (&traps->right, traps->bottom, 1))));
  	if (x2 > box->x2)
  	    box->x2 = x2;
***************
*** 111,127 ****
  
  void
! IcCompositeTrapezoids (IcOperator	op,
! 		       IcImage		*src,
! 		       IcImage		*dst,
  		       int		xSrc,
  		       int		ySrc,
! 		       const IcTrapezoid *traps,
  		       int		ntraps)
  {
!     IcImage		*image = NULL;
!     PixRegionBox	bounds;
      int16_t		xDst, yDst;
      int16_t		xRel, yRel;
!     IcFormat		*format;
  
      if (ntraps == 0)
--- 111,127 ----
  
  void
! pixman_compositeTrapezoids (pixman_operator_t	op,
! 		       pixman_image_t		*src,
! 		       pixman_image_t		*dst,
  		       int		xSrc,
  		       int		ySrc,
! 		       const pixman_trapezoid_t *traps,
  		       int		ntraps)
  {
!     pixman_image_t		*image = NULL;
!     pixman_box16_t	bounds;
      int16_t		xDst, yDst;
      int16_t		xRel, yRel;
!     pixman_format_t		*format;
  
      if (ntraps == 0)
***************
*** 131,139 ****
      yDst = traps[0].left.p1.y >> 16;
      
!     format = IcFormatCreate (IcFormatNameA8);
  
      if (format)
      {
! 	IcTrapezoidBounds (ntraps, traps, &bounds);
  	if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2)
  	    return;
--- 131,139 ----
      yDst = traps[0].left.p1.y >> 16;
      
!     format = pixman_format_tCreate (PIXMAN_FORMAT_NAME_A8);
  
      if (format)
      {
! 	pixman_trapezoid_tBounds (ntraps, traps, &bounds);
  	if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2)
  	    return;
***************
*** 150,154 ****
  	if (!format)
  	{
! 	    IcTrapezoidBounds (1, traps, &bounds);
  	    if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2)
  		continue;
--- 150,154 ----
  	if (!format)
  	{
! 	    pixman_trapezoid_tBounds (1, traps, &bounds);
  	    if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2)
  		continue;
***************
*** 165,173 ****
  	    xRel = bounds.x1 + xSrc - xDst;
  	    yRel = bounds.y1 + ySrc - yDst;
! 	    IcComposite (op, src, image, dst,
  			 xRel, yRel, 0, 0, bounds.x1, bounds.y1,
  			 bounds.x2 - bounds.x1,
  			 bounds.y2 - bounds.y1);
! 	    IcImageDestroy (image);
  	}
      }
--- 165,173 ----
  	    xRel = bounds.x1 + xSrc - xDst;
  	    yRel = bounds.y1 + ySrc - yDst;
! 	    pixman_composite (op, src, image, dst,
  			 xRel, yRel, 0, 0, bounds.x1, bounds.y1,
  			 bounds.x2 - bounds.x1,
  			 bounds.y2 - bounds.y1);
! 	    pixman_image_tDestroy (image);
  	}
      }
***************
*** 176,187 ****
  	xRel = bounds.x1 + xSrc - xDst;
  	yRel = bounds.y1 + ySrc - yDst;
! 	IcComposite (op, src, image, dst,
  		     xRel, yRel, 0, 0, bounds.x1, bounds.y1,
  		     bounds.x2 - bounds.x1,
  		     bounds.y2 - bounds.y1);
! 	IcImageDestroy (image);
      }
  
!     IcFormatDestroy (format);
  }
  
--- 176,187 ----
  	xRel = bounds.x1 + xSrc - xDst;
  	yRel = bounds.y1 + ySrc - yDst;
! 	pixman_composite (op, src, image, dst,
  		     xRel, yRel, 0, 0, bounds.x1, bounds.y1,
  		     bounds.x2 - bounds.x1,
  		     bounds.y2 - bounds.y1);
! 	pixman_image_tDestroy (image);
      }
  
!     pixman_format_tDestroy (format);
  }
  
***************
*** 809,817 ****
  
  static void 
! pixelWalkInit (PixelWalk *pw, IcLineFixed *line,
! 	       IcFixed16_16 top_y, IcFixed16_16 bottom_y)
  {
      xFixed_32_32    dy_inc, dx_inc;
!     IcPointFixed	    *top, *bot;
  
      /*
--- 809,817 ----
  
  static void 
! pixelWalkInit (PixelWalk *pw, pixman_line_fixed_t *line,
! 	       pixman_fixed16_16_t top_y, pixman_fixed16_16_t bottom_y)
  {
      xFixed_32_32    dy_inc, dx_inc;
!     pixman_point_fixed_t	    *top, *bot;
  
      /*
***************
*** 1144,1156 ****
  
  void
! IcRasterizeTrapezoid (IcImage		*pMask,
! 		      const IcTrapezoid	*pTrap,
  		      int		x_off,
  		      int		y_off)
  {
!     IcTrapezoid	trap = *pTrap;
      int alpha, temp;
      
!     IcCompositeOperand	mask;
  
      int depth = pMask->pixels->depth;
--- 1144,1156 ----
  
  void
! IcRasterizeTrapezoid (pixman_image_t		*pMask,
! 		      const pixman_trapezoid_t	*pTrap,
  		      int		x_off,
  		      int		y_off)
  {
!     pixman_trapezoid_t	trap = *pTrap;
      int alpha, temp;
      
!     pixman_compositeOperand	mask;
  
      int depth = pMask->pixels->depth;





More information about the cairo-commit mailing list