[cairo-commit] libpixman/src icimage.c,1.15,1.16

Dave Beckett commit at pdx.freedesktop.org
Wed Dec 10 14:20:46 PST 2003


Committed by: dajobe

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

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


Index: icimage.c
===================================================================
RCS file: /cvs/cairo/libpixman/src/icimage.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** icimage.c	1 Nov 2003 13:23:55 -0000	1.15
--- icimage.c	10 Dec 2003 22:20:44 -0000	1.16
***************
*** 24,33 ****
  #include "icint.h"
  
! IcImage *
! IcImageCreate (IcFormat	*format,
  	       int	width,
  	       int	height)
  {
!     IcImage	*image;
      IcPixels	*pixels;
  
--- 24,33 ----
  #include "icint.h"
  
! pixman_image_t *
! pixman_image_tCreate (pixman_format_t	*format,
  	       int	width,
  	       int	height)
  {
!     pixman_image_t	*image;
      IcPixels	*pixels;
  
***************
*** 36,40 ****
  	return NULL;
      
!     image = IcImageCreateForPixels (pixels, format);
      if (image == NULL) {
  	IcPixelsDestroy (pixels);
--- 36,40 ----
  	return NULL;
      
!     image = pixman_image_tCreateForPixels (pixels, format);
      if (image == NULL) {
  	IcPixelsDestroy (pixels);
***************
*** 46,55 ****
      return image;
  }
! slim_hidden_def(IcImageCreate);
  
! IcImage *
! IcImageCreateForData (IcBits *data, IcFormat *format, int width, int height, int bpp, int stride)
  {
!     IcImage	*image;
      IcPixels	*pixels;
  
--- 46,55 ----
      return image;
  }
! slim_hidden_def(pixman_image_tCreate);
  
! pixman_image_t *
! pixman_image_tCreateForData (pixman_bits_t *data, pixman_format_t *format, int width, int height, int bpp, int stride)
  {
!     pixman_image_t	*image;
      IcPixels	*pixels;
  
***************
*** 58,62 ****
  	return NULL;
  
!     image = IcImageCreateForPixels (pixels, format);
      if (image == NULL) {
  	IcPixelsDestroy (pixels);
--- 58,62 ----
  	return NULL;
  
!     image = pixman_image_tCreateForPixels (pixels, format);
      if (image == NULL) {
  	IcPixelsDestroy (pixels);
***************
*** 69,79 ****
  }
  
! IcImage *
! IcImageCreateForPixels (IcPixels	*pixels,
! 			IcFormat	*format)
  {
!     IcImage		*image;
  
!     image = malloc (sizeof (IcImage));
      if (!image)
      {
--- 69,79 ----
  }
  
! pixman_image_t *
! pixman_image_tCreateForPixels (IcPixels	*pixels,
! 			pixman_format_t	*format)
  {
!     pixman_image_t		*image;
  
!     image = malloc (sizeof (pixman_image_t));
      if (!image)
      {
***************
*** 97,101 ****
  */
  
!     IcImageInit (image);
  
      return image;
--- 97,101 ----
  */
  
!     pixman_image_tInit (image);
  
      return image;
***************
*** 103,107 ****
  
  void
! IcImageInit (IcImage *image)
  {
      image->refcnt = 1;
--- 103,107 ----
  
  void
! pixman_image_tInit (pixman_image_t *image)
  {
      image->refcnt = 1;
***************
*** 131,141 ****
  */
  
!     image->pCompositeClip = PixRegionCreate();
!     PixRegionUnionRect (image->pCompositeClip, image->pCompositeClip,
  			0, 0, image->pixels->width, image->pixels->height);
  
      image->transform = NULL;
  
!     image->filter = IcFilterNearest;
      image->filter_params = 0;
      image->filter_nparams = 0;
--- 131,141 ----
  */
  
!     image->pCompositeClip = pixman_region_create();
!     pixman_region_unionRect (image->pCompositeClip, image->pCompositeClip,
  			0, 0, image->pixels->width, image->pixels->height);
  
      image->transform = NULL;
  
!     image->filter = PIXMAN_FILTER_NEAREST;
      image->filter_params = 0;
      image->filter_nparams = 0;
***************
*** 146,153 ****
  
  int
! IcImageSetTransform (IcImage		*image,
! 		     IcTransform	*transform)
  {
!     static const IcTransform	identity = { {
  	{ xFixed1, 0x00000, 0x00000 },
  	{ 0x00000, xFixed1, 0x00000 },
--- 146,153 ----
  
  int
! pixman_image_tSetTransform (pixman_image_t		*image,
! 		     pixman_transform_t	*transform)
  {
!     static const pixman_transform_t	identity = { {
  	{ xFixed1, 0x00000, 0x00000 },
  	{ 0x00000, xFixed1, 0x00000 },
***************
*** 155,159 ****
      } };
  
!     if (transform && memcmp (transform, &identity, sizeof (IcTransform)) == 0)
  	transform = 0;
      
--- 155,159 ----
      } };
  
!     if (transform && memcmp (transform, &identity, sizeof (pixman_transform_t)) == 0)
  	transform = 0;
      
***************
*** 162,166 ****
  	if (!image->transform)
  	{
! 	    image->transform = malloc (sizeof (IcTransform));
  	    if (!image->transform)
  		return 1;
--- 162,166 ----
  	if (!image->transform)
  	{
! 	    image->transform = malloc (sizeof (pixman_transform_t));
  	    if (!image->transform)
  		return 1;
***************
*** 180,184 ****
  
  void
! IcImageSetRepeat (IcImage	*image,
  		  int		repeat)
  {
--- 180,184 ----
  
  void
! pixman_image_tSetRepeat (pixman_image_t	*image,
  		  int		repeat)
  {
***************
*** 186,194 ****
  	image->repeat = repeat;
  }
! slim_hidden_def(IcImageSetRepeat);
  
  void
! IcImageSetFilter (IcImage	*image,
! 		  IcFilter	filter)
  {
      if (image)
--- 186,194 ----
  	image->repeat = repeat;
  }
! slim_hidden_def(pixman_image_tSetRepeat);
  
  void
! pixman_image_tSetFilter (pixman_image_t	*image,
! 		  pixman_filter_t	filter)
  {
      if (image)
***************
*** 197,201 ****
  
  int
! IcImageGetWidth (IcImage	*image)
  {
      return image->pixels->width;
--- 197,201 ----
  
  int
! pixman_image_tGetWidth (pixman_image_t	*image)
  {
      return image->pixels->width;
***************
*** 203,207 ****
  
  int
! IcImageGetHeight (IcImage	*image)
  {
      return image->pixels->height;
--- 203,207 ----
  
  int
! pixman_image_tGetHeight (pixman_image_t	*image)
  {
      return image->pixels->height;
***************
*** 209,213 ****
  
  int
! IcImageGetDepth (IcImage	*image)
  {
      return image->pixels->depth;
--- 209,213 ----
  
  int
! pixman_image_tGetDepth (pixman_image_t	*image)
  {
      return image->pixels->depth;
***************
*** 215,225 ****
  
  int
! IcImageGetStride (IcImage	*image)
  {
      return image->pixels->stride;
  }
  
! IcBits *
! IcImageGetData (IcImage	*image)
  {
      return image->pixels->data;
--- 215,225 ----
  
  int
! pixman_image_tGetStride (pixman_image_t	*image)
  {
      return image->pixels->stride;
  }
  
! pixman_bits_t *
! pixman_image_tGetData (pixman_image_t	*image)
  {
      return image->pixels->data;
***************
*** 227,234 ****
  
  void
! IcImageDestroy (IcImage *image)
  {
      if (image->freeCompClip)
! 	PixRegionDestroy (image->pCompositeClip);
  
      if (image->owns_pixels)
--- 227,234 ----
  
  void
! pixman_image_tDestroy (pixman_image_t *image)
  {
      if (image->freeCompClip)
! 	pixman_region_destroy (image->pCompositeClip);
  
      if (image->owns_pixels)
***************
*** 240,247 ****
      free (image);
  }
! slim_hidden_def(IcImageDestroy);
  
  void
! IcImageDestroyClip (IcImage *image)
  {
      switch (image->clientClipType) {
--- 240,247 ----
      free (image);
  }
! slim_hidden_def(pixman_image_tDestroy);
  
  void
! pixman_image_tDestroyClip (pixman_image_t *image)
  {
      switch (image->clientClipType) {
***************
*** 249,256 ****
  	return;
      case CT_PIXMAP:
! 	IcImageDestroy (image->clientClip);
  	break;
      default:
! 	PixRegionDestroy (image->clientClip);
  	break;
      }
--- 249,256 ----
  	return;
      case CT_PIXMAP:
! 	pixman_image_tDestroy (image->clientClip);
  	break;
      default:
! 	pixman_region_destroy (image->clientClip);
  	break;
      }
***************
*** 260,267 ****
  
  int
! IcImageSetClipRegion (IcImage	*image,
! 		      PixRegion	*region)
  {
!     IcImageDestroyClip (image);
      image->clientClip = region;
      image->clientClipType = CT_REGION;
--- 260,267 ----
  
  int
! pixman_image_tSetClipRegion (pixman_image_t	*image,
! 		      pixman_region16_t	*region)
  {
!     pixman_image_tDestroyClip (image);
      image->clientClip = region;
      image->clientClipType = CT_REGION;
***************
*** 273,286 ****
  
  static __inline int
! IcClipImageReg (PixRegion	*region,
! 		PixRegion	*clip,
  		int		dx,
  		int		dy)
  {
!     if (PixRegionNumRects (region) == 1 &&
! 	PixRegionNumRects (clip) == 1)
      {
! 	PixRegionBox *pRbox = PixRegionRects (region);
! 	PixRegionBox *pCbox = PixRegionRects (clip);
  	int	v;
  
--- 273,286 ----
  
  static __inline int
! IcClipImageReg (pixman_region16_t	*region,
! 		pixman_region16_t	*clip,
  		int		dx,
  		int		dy)
  {
!     if (pixman_region_num_rects (region) == 1 &&
! 	pixman_region_num_rects (clip) == 1)
      {
! 	pixman_box16_t *pRbox = pixman_region_rects (region);
! 	pixman_box16_t *pCbox = pixman_region_rects (clip);
  	int	v;
  
***************
*** 296,307 ****
  	    pRbox->y1 >= pRbox->y2)
  	{
! 	    PixRegionEmpty (region);
  	}
      }
      else
      {
! 	PixRegionTranslate (region, dx, dy);
! 	PixRegionIntersect (region, clip, region);
! 	PixRegionTranslate (region, -dx, -dy);
      }
      return 1;
--- 296,307 ----
  	    pRbox->y1 >= pRbox->y2)
  	{
! 	    pixman_region_empty (region);
  	}
      }
      else
      {
! 	pixman_region_translate (region, dx, dy);
! 	pixman_region_intersect (region, clip, region);
! 	pixman_region_translate (region, -dx, -dy);
      }
      return 1;
***************
*** 309,314 ****
  		  
  static __inline int
! IcClipImageSrc (PixRegion	*region,
! 		IcImage		*image,
  		int		dx,
  		int		dy)
--- 309,314 ----
  		  
  static __inline int
! IcClipImageSrc (pixman_region16_t	*region,
! 		pixman_image_t		*image,
  		int		dx,
  		int		dy)
***************
*** 321,329 ****
  	if (image->clientClipType != CT_NONE)
  	{
! 	    PixRegionTranslate (region, 
  			   dx - image->clipOrigin.x,
  			   dy - image->clipOrigin.y);
! 	    PixRegionIntersect (region, image->clientClip, region);
! 	    PixRegionTranslate (region, 
  			   - (dx - image->clipOrigin.x),
  			   - (dy - image->clipOrigin.y));
--- 321,329 ----
  	if (image->clientClipType != CT_NONE)
  	{
! 	    pixman_region_translate (region, 
  			   dx - image->clipOrigin.x,
  			   dy - image->clipOrigin.y);
! 	    pixman_region_intersect (region, image->clientClip, region);
! 	    pixman_region_translate (region, 
  			   - (dx - image->clipOrigin.x),
  			   - (dy - image->clipOrigin.y));
***************
*** 347,351 ****
  
  int
! IcImageChange (IcImage		*image,
  	       Mask		vmask,
  	       unsigned int	*vlist,
--- 347,351 ----
  
  int
! pixman_image_tChange (pixman_image_t		*image,
  	       Mask		vmask,
  	       unsigned int	*vlist,
***************
*** 380,390 ****
  	case CPAlphaMap:
  	    {
! 		IcImage *iAlpha;
  		
! 		iAlpha = NEXT_PTR(IcImage *);
  		if (iAlpha)
  		    iAlpha->refcnt++;
  		if (image->alphaMap)
! 		    IcImageDestroy ((void *) image->alphaMap);
  		image->alphaMap = iAlpha;
  	    }
--- 380,390 ----
  	case CPAlphaMap:
  	    {
! 		pixman_image_t *iAlpha;
  		
! 		iAlpha = NEXT_PTR(pixman_image_t *);
  		if (iAlpha)
  		    iAlpha->refcnt++;
  		if (image->alphaMap)
! 		    pixman_image_tDestroy ((void *) image->alphaMap);
  		image->alphaMap = iAlpha;
  	    }
***************
*** 404,411 ****
  	case CPClipMask:
  	    {
! 		IcImage	    *mask;
  		int	    clipType;
  
! 		mask = NEXT_PTR(IcImage *);
  		if (mask) {
  		    clipType = CT_PIXMAP;
--- 404,411 ----
  	case CPClipMask:
  	    {
! 		pixman_image_t	    *mask;
  		int	    clipType;
  
! 		mask = NEXT_PTR(pixman_image_t *);
  		if (mask) {
  		    clipType = CT_PIXMAP;
***************
*** 414,418 ****
  		    clipType = CT_NONE;
  		}
! 		error = IcImageChangeClip (image, clipType,
  					   (void *)mask, 0);
  		break;
--- 414,418 ----
  		    clipType = CT_NONE;
  		}
! 		error = pixman_image_tChangeClip (image, clipType,
  					   (void *)mask, 0);
  		break;
***************
*** 507,511 ****
      ScreenPtr		pScreen = pPicture->pDrawable->pScreen;
      PictureScreenPtr	ps = GetPictureScreen(pScreen);
!     PixRegion		*clientClip;
      int			result;
  
--- 507,511 ----
      ScreenPtr		pScreen = pPicture->pDrawable->pScreen;
      PictureScreenPtr	ps = GetPictureScreen(pScreen);
!     pixman_region16_t		*clientClip;
      int			result;
  
***************
*** 528,535 ****
  
  int
! IcComputeCompositeRegion (PixRegion	*region,
! 			  IcImage	*iSrc,
! 			  IcImage	*iMask,
! 			  IcImage	*iDst,
  			  int16_t		xSrc,
  			  int16_t		ySrc,
--- 528,535 ----
  
  int
! IcComputeCompositeRegion (pixman_region16_t	*region,
! 			  pixman_image_t	*iSrc,
! 			  pixman_image_t	*iMask,
! 			  pixman_image_t	*iDst,
  			  int16_t		xSrc,
  			  int16_t		ySrc,
***************
*** 546,550 ****
      /* XXX: This code previously directly set the extents of the
         region here. I need to decide whether removing that has broken
!        this. Also, it might be necessary to just make the PixRegion
         data structure transparent anyway in which case I can just put
         the code back. */
--- 546,550 ----
      /* XXX: This code previously directly set the extents of the
         region here. I need to decide whether removing that has broken
!        this. Also, it might be necessary to just make the pixman_region16_t
         data structure transparent anyway in which case I can just put
         the code back. */
***************
*** 559,563 ****
  	y1 >= y2)
      {
! 	PixRegionEmpty (region);
  	return 1;
      }
--- 559,563 ----
  	y1 >= y2)
      {
! 	pixman_region_empty (region);
  	return 1;
      }
***************
*** 565,569 ****
      if (!IcClipImageSrc (region, iSrc, xDst - xSrc, yDst - ySrc))
      {
! 	PixRegionDestroy (region);
  	return 0;
      }
--- 565,569 ----
      if (!IcClipImageSrc (region, iSrc, xDst - xSrc, yDst - ySrc))
      {
! 	pixman_region_destroy (region);
  	return 0;
      }
***************
*** 574,578 ****
  			     yDst - (ySrc + iSrc->alphaOrigin.y)))
  	{
! 	    PixRegionDestroy (region);
  	    return 0;
  	}
--- 574,578 ----
  			     yDst - (ySrc + iSrc->alphaOrigin.y)))
  	{
! 	    pixman_region_destroy (region);
  	    return 0;
  	}
***************
*** 583,587 ****
  	if (!IcClipImageSrc (region, iMask, xDst - xMask, yDst - yMask))
  	{
! 	    PixRegionDestroy (region);
  	    return 0;
  	}	
--- 583,587 ----
  	if (!IcClipImageSrc (region, iMask, xDst - xMask, yDst - yMask))
  	{
! 	    pixman_region_destroy (region);
  	    return 0;
  	}	
***************
*** 592,596 ****
  				 yDst - (yMask + iMask->alphaOrigin.y)))
  	    {
! 		PixRegionDestroy (region);
  		return 0;
  	    }
--- 592,596 ----
  				 yDst - (yMask + iMask->alphaOrigin.y)))
  	    {
! 		pixman_region_destroy (region);
  		return 0;
  	    }
***************
*** 599,603 ****
      if (!IcClipImageReg (region, iDst->pCompositeClip, 0, 0))
      {
! 	PixRegionDestroy (region);
  	return 0;
      }
--- 599,603 ----
      if (!IcClipImageReg (region, iDst->pCompositeClip, 0, 0))
      {
! 	pixman_region_destroy (region);
  	return 0;
      }
***************
*** 608,612 ****
  			     -iDst->alphaOrigin.y))
  	{
! 	    PixRegionDestroy (region);
  	    return 0;
  	}
--- 608,612 ----
  			     -iDst->alphaOrigin.y))
  	{
! 	    pixman_region_destroy (region);
  	    return 0;
  	}





More information about the cairo-commit mailing list