[cairo-commit] libpixman/src ic.c, 1.14, 1.15 iccompose.c, 1.14, 1.15 icimage.h, 1.18, 1.19

David Reveman commit at pdx.freedesktop.org
Sat Sep 11 19:28:02 PDT 2004


Committed by: davidr

Update of /cvs/cairo/libpixman/src
In directory gabe:/tmp/cvs-serv27755/src

Modified Files:
	ic.c iccompose.c icimage.h 
Log Message:
Added support for both transform and repeat

Index: ic.c
===================================================================
RCS file: /cvs/cairo/libpixman/src/ic.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** ic.c	10 Dec 2003 23:39:45 -0000	1.14
--- ic.c	12 Sep 2004 02:27:59 -0000	1.15
***************
*** 1079,1082 ****
--- 1079,1090 ----
  	break;
      }
+     /* if we are transforming, we handle repeats in
+      * IcFetch[a]_transform
+      */
+     if (iSrc->transform)
+       srcRepeat = 0;
+     if (iMask && iMask->transform)
+       maskRepeat = 0;
+     
      n = pixman_region_num_rects (region);
      pbox = pixman_region_rects (region);

Index: iccompose.c
===================================================================
RCS file: /cvs/cairo/libpixman/src/iccompose.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** iccompose.c	24 Jan 2004 09:50:55 -0000	1.14
--- iccompose.c	12 Sep 2004 02:28:00 -0000	1.15
***************
*** 2240,2243 ****
--- 2240,2245 ----
  }
  
+ #define mod(a,b)	((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (a) % (b) == 0 ? 0: (b) + (a) % (b))
+ 
  static uint32_t
  IcFetch_transform (pixman_compositeOperand *op)
***************
*** 2261,2264 ****
--- 2263,2271 ----
  	y = xFixedToInt (v.vector[1]) + op->u.transform.top_y;
  	x = xFixedToInt (v.vector[0]) + op->u.transform.left_x;
+ 	if (op->u.transform.repeat)
+ 	{
+ 	    y = mod (y, op->u.transform.height);
+ 	    x = mod (x, op->u.transform.width);
+ 	}
  	if (pixman_region_contains_point (op->clip, x, y, &box))
  	{
***************
*** 2283,2293 ****
  	{
  	    uint32_t	lrtot = 0, lgtot = 0, lbtot = 0, latot = 0;
  	    
  	    xerr = xFixed1 - xFixedFrac (v.vector[0]);
  	    for (x = minx; x <= maxx; x++)
  	    {
! 		if (pixman_region_contains_point (op->clip, x, y, &box))
  		{
! 		    (*op[1].set) (&op[1], x, y);
  		    bits = (*op[1].fetch) (&op[1]);
  		    {
--- 2290,2311 ----
  	{
  	    uint32_t	lrtot = 0, lgtot = 0, lbtot = 0, latot = 0;
+ 	    int         tx, ty;
+ 
+ 	    if (op->u.transform.repeat)
+ 		ty = mod (y, op->u.transform.height);
+ 	    else
+ 		ty = y;
  	    
  	    xerr = xFixed1 - xFixedFrac (v.vector[0]);
  	    for (x = minx; x <= maxx; x++)
  	    {
! 		if (op->u.transform.repeat)
! 		    tx = mod (x, op->u.transform.width);
! 		else
! 		    tx = x;
! 
! 		if (pixman_region_contains_point (op->clip, tx, ty, &box))
  		{
! 		    (*op[1].set) (&op[1], tx, ty);
  		    bits = (*op[1].fetch) (&op[1]);
  		    {
***************
*** 2344,2347 ****
--- 2362,2370 ----
  	y = xFixedToInt (v.vector[1]) + op->u.transform.left_x;
  	x = xFixedToInt (v.vector[0]) + op->u.transform.top_y;
+ 	if (op->u.transform.repeat)
+ 	{
+ 	    y = mod (y, op->u.transform.height);
+ 	    x = mod (x, op->u.transform.width);
+ 	}
  	if (pixman_region_contains_point (op->clip, x, y, &box))
  	{
***************
*** 2367,2376 ****
  	{
  	    uint32_t	lrtot = 0, lgtot = 0, lbtot = 0, latot = 0;
  	    xerr = xFixed1 - xFixedFrac (v.vector[0]);
  	    for (x = minx; x <= maxx; x++)
  	    {
! 		if (pixman_region_contains_point (op->clip, x, y, &box))
  		{
! 		    (*op[1].set) (&op[1], x, y);
  		    bits = (*op[1].fetcha) (&op[1]);
  		    {
--- 2390,2411 ----
  	{
  	    uint32_t	lrtot = 0, lgtot = 0, lbtot = 0, latot = 0;
+ 	    int         tx, ty;
+ 
+ 	    if (op->u.transform.repeat)
+ 		ty = mod (y, op->u.transform.height);
+ 	    else
+ 		ty = y;
+ 	    
  	    xerr = xFixed1 - xFixedFrac (v.vector[0]);
  	    for (x = minx; x <= maxx; x++)
  	    {
! 		if (op->u.transform.repeat)
! 		    tx = mod (x, op->u.transform.width);
! 		else
! 		    tx = x;
! 		
! 		if (pixman_region_contains_point (op->clip, tx, ty, &box))
  		{
! 		    (*op[1].set) (&op[1], tx, ty);
  		    bits = (*op[1].fetcha) (&op[1]);
  		    {
***************
*** 2536,2539 ****
--- 2571,2577 ----
  	op->u.transform.transform = image->transform;
  	op->u.transform.filter = image->filter;
+ 	op->u.transform.repeat = image->repeat;
+ 	op->u.transform.width = image->pixels->width;
+ 	op->u.transform.height = image->pixels->height;
  	
  	op->fetch = IcFetch_transform;

Index: icimage.h
===================================================================
RCS file: /cvs/cairo/libpixman/src/icimage.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** icimage.h	16 Apr 2004 15:32:53 -0000	1.18
--- icimage.h	12 Sep 2004 02:28:00 -0000	1.19
***************
*** 273,276 ****
--- 273,279 ----
  	    pixman_transform_t		*transform;
  	    pixman_filter_t		filter;
+ 	    int                         repeat;
+ 	    int                         width;
+ 	    int                         height;
  	} transform;
      } u;




More information about the cairo-commit mailing list