[cairo-commit] libglc/src glc.c,1.20,1.21 glc_program.c,1.4,1.5 glc_trap.c,1.11,1.12 glc_tri.c,1.11,1.12

David Reveman commit at pdx.freedesktop.org
Mon Aug 15 11:12:59 PDT 2005


Committed by: davidr

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

Modified Files:
	glc.c glc_program.c glc_trap.c glc_tri.c 
Log Message:
Fixed composite polygon source offsets

Index: glc.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** a/glc.c	26 Feb 2004 10:16:04 -0000	1.20
--- b/glc.c	27 Feb 2004 14:46:23 -0000	1.21
***************
*** 156,159 ****
--- 156,160 ----
    translate_src.x = (src_region.x1 < 0.0)? src_region.x1: 0.0;
    translate_src.y = (src_region.y1 < 0.0)? src_region.y1: 0.0;
+ 
    src_region.x1 += x_dst;
    src_region.y1 += y_dst;
***************
*** 205,210 ****
      glc_intersect_sub_pixel_region (&src_region, &dst_region, &src_region);
  
!     src_region.x2 = (src_region.x2 - src_region.x1) - translate_src.x;
!     src_region.y2 = (src_region.y2 - src_region.y1) - translate_src.y;
      src_region.x1 = x_src - translate_src.x;
      src_region.y1 = y_src - translate_src.y;
--- 206,211 ----
      glc_intersect_sub_pixel_region (&src_region, &dst_region, &src_region);
  
!     src_region.x2 = x_src + (src_region.x2 - src_region.x1) - translate_src.x;
!     src_region.y2 = y_src + (src_region.y2 - src_region.y1) - translate_src.y;
      src_region.x1 = x_src - translate_src.x;
      src_region.y1 = y_src - translate_src.y;
***************
*** 222,227 ****
      glc_intersect_sub_pixel_region (&mask_region, &dst_region, &mask_region);
      
!     mask_region.x2 = (mask_region.x2 - mask_region.x1) - translate_mask.x;
!     mask_region.y2 = (mask_region.y2 - mask_region.y1) - translate_mask.y;
      mask_region.x1 = x_mask - translate_mask.x;
      mask_region.y1 = y_mask - translate_mask.y;
--- 223,230 ----
      glc_intersect_sub_pixel_region (&mask_region, &dst_region, &mask_region);
      
!     mask_region.x2 = x_mask + (mask_region.x2 - mask_region.x1) -
!       translate_mask.x;
!     mask_region.y2 = y_mask + (mask_region.y2 - mask_region.y1) -
!       translate_mask.y;
      mask_region.x1 = x_mask - translate_mask.x;
      mask_region.y1 = y_mask - translate_mask.y;
***************
*** 398,403 ****
  
    if (src->programmatic)
!     glc_programmatic_surface_setup (src, dst->width + x_src,
!                                     dst->height + y_src);
  
    if (mask) {
--- 401,405 ----
  
    if (src->programmatic)
!     glc_programmatic_surface_setup (src, width + x_src, height + y_src);
  
    if (mask) {

Index: glc_program.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_program.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** a/glc_program.c	26 Feb 2004 10:16:04 -0000	1.4
--- b/glc_program.c	27 Feb 2004 14:46:23 -0000	1.5
***************
*** 79,86 ****
  
    /* GLC_PROGRAM_RECTSRC_NOMASK_OFFSET */
!   { EXPAND_RECT_SRC, EXPAND_NONE, EXPAND_NONE },
  
    /* GLC_PROGRAM_NOSRC_NOMASK_OFFSET */
!   { EXPAND_NONE, EXPAND_NONE, EXPAND_NONE },
  };
  
--- 79,86 ----
  
    /* GLC_PROGRAM_RECTSRC_NOMASK_OFFSET */
!   { EXPAND_RECT_SRC, EXPAND_NONE, EXPAND_NO_MASK_OP },
  
    /* GLC_PROGRAM_NOSRC_NOMASK_OFFSET */
!   { EXPAND_NONE, EXPAND_NONE, EXPAND_NO_MASK_OP },
  };
  

Index: glc_trap.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_trap.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** a/glc_trap.c	26 Feb 2004 10:16:04 -0000	1.11
--- b/glc_trap.c	27 Feb 2004 14:46:23 -0000	1.12
***************
*** 142,150 ****
    glc_region_box_t bounds, mask_bounds;
    double x_draw_offset, y_draw_offset;
  
    if (src->programmatic)
      glc_programmatic_surface_setup (src, dst->width + x_src,
                                      dst->height + y_src);
!   
    if (n_traps == 1 &&
        glc_composite_direct_check (op, src, dst, x_src, y_src, traps))
--- 142,157 ----
    glc_region_box_t bounds, mask_bounds;
    double x_draw_offset, y_draw_offset;
+   int x_dst, y_dst;
+ 
+   if (n_traps == 0)
+ 	return;
+   
+   x_dst = traps[0].left.p1.x >> 16;
+   y_dst = traps[0].left.p1.y >> 16;
  
    if (src->programmatic)
      glc_programmatic_surface_setup (src, dst->width + x_src,
                                      dst->height + y_src);
!     
    if (n_traps == 1 &&
        glc_composite_direct_check (op, src, dst, x_src, y_src, traps))
***************
*** 158,174 ****
  
    if ((!src->repeat) && (!src->transform)) {
!     if (bounds.x1 > (src->width - x_src))
!       return;
!     if (bounds.y1 > (src->height - y_src))
!       return;
!          
!     if (bounds.x2 > (src->width - x_src))
!       bounds.x2 = src->width - x_src;
  
!     if (bounds.y2 > (src->height - y_src))
!       bounds.y2 = (src->height - y_src);
  
!     if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2)
!       return;
    }
  
--- 165,176 ----
  
    if ((!src->repeat) && (!src->transform)) {
!     glc_region_box_t src_bounds;
  
!     src_bounds.x1 = bounds.x1 - (x_src - x_dst);
!     src_bounds.y1 = bounds.y1 - (y_src - y_dst);
!     src_bounds.x2 = src->width - (x_src - x_dst);
!     src_bounds.y2 = src->height - (y_src - y_dst);
  
!     glc_intersect_region (&bounds, &src_bounds, &bounds);
    }
  
***************
*** 257,261 ****
                   mask,
                   dst,
!                  x_src + bounds.x1, y_src + bounds.y1,
                   0, 0,
                   mask_bounds.x1, mask_bounds.y1,
--- 259,263 ----
                   mask,
                   dst,
!                  x_src + bounds.x1 - x_dst, y_src + bounds.y1 - y_dst,
                   0, 0,
                   mask_bounds.x1, mask_bounds.y1,

Index: glc_tri.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_tri.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** a/glc_tri.c	26 Feb 2004 10:16:04 -0000	1.11
--- b/glc_tri.c	27 Feb 2004 14:46:23 -0000	1.12
***************
*** 74,77 ****
--- 74,81 ----
    glc_region_box_t bounds, mask_bounds;
    double x_draw_offset, y_draw_offset;
+   int x_dst, y_dst;
+ 
+   x_dst = tris[0].p1.x >> 16;
+   y_dst = tris[0].p1.y >> 16;
  
    if (src->programmatic)
***************
*** 86,104 ****
  
    if ((!src->repeat) && (!src->transform)) {
!     if (bounds.x1 > (src->width - x_src))
!       return;
!     if (bounds.y1 > (src->height - y_src))
!       return;
!          
!     if (bounds.x2 > (src->width - x_src))
!       bounds.x2 = src->width - x_src;
  
!     if (bounds.y2 > (src->height - y_src))
!       bounds.y2 = (src->height - y_src);
  
!     if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2)
!       return;
    }
!   
    mask_bounds.x1 = mask_bounds.y1 = 0;
    mask_bounds.x2 = dst->width;
--- 90,103 ----
  
    if ((!src->repeat) && (!src->transform)) {
!     glc_region_box_t src_bounds;
  
!     src_bounds.x1 = bounds.x1 - (x_src - x_dst);
!     src_bounds.y1 = bounds.y1 - (y_src - y_dst);
!     src_bounds.x2 = src->width - (x_src - x_dst);
!     src_bounds.y2 = src->height - (y_src - y_dst);
  
!     glc_intersect_region (&bounds, &src_bounds, &bounds);
    }
! 
    mask_bounds.x1 = mask_bounds.y1 = 0;
    mask_bounds.x2 = dst->width;
***************
*** 171,175 ****
                   mask,
                   dst,
!                  x_src + bounds.x1, y_src + bounds.y1,
                   0, 0,
                   mask_bounds.x1, mask_bounds.y1,
--- 170,174 ----
                   mask,
                   dst,
!                  x_src + bounds.x1 - x_dst, y_src + bounds.y1 - y_dst,
                   0, 0,
                   mask_bounds.x1, mask_bounds.y1,
***************
*** 192,199 ****
--- 191,202 ----
    glc_region_box_t bounds, mask_bounds;
    double x_draw_offset, y_draw_offset;
+   int x_dst, y_dst;
  
    if (n_points < 3)
      return;
  
+   x_dst = points[0].x >> 16;
+   y_dst = points[0].y >> 16;
+ 
    if (src->programmatic)
      glc_programmatic_surface_setup (src, dst->width + x_src,
***************
*** 207,225 ****
  
    if ((!src->repeat) && (!src->transform)) {
!     if (bounds.x1 > (src->width - x_src))
!       return;
!     if (bounds.y1 > (src->height - y_src))
!       return;
!          
!     if (bounds.x2 > (src->width - x_src))
!       bounds.x2 = src->width - x_src;
  
!     if (bounds.y2 > (src->height - y_src))
!       bounds.y2 = (src->height - y_src);
  
!     if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2)
!       return;
    }
!   
    mask_bounds.x1 = mask_bounds.y1 = 0;
    mask_bounds.x2 = dst->width;
--- 210,223 ----
  
    if ((!src->repeat) && (!src->transform)) {
!     glc_region_box_t src_bounds;
  
!     src_bounds.x1 = bounds.x1 - (x_src - x_dst);
!     src_bounds.y1 = bounds.y1 - (y_src - y_dst);
!     src_bounds.x2 = src->width - (x_src - x_dst);
!     src_bounds.y2 = src->height - (y_src - y_dst);
  
!     glc_intersect_region (&bounds, &src_bounds, &bounds);
    }
! 
    mask_bounds.x1 = mask_bounds.y1 = 0;
    mask_bounds.x2 = dst->width;
***************
*** 287,291 ****
                   mask,
                   dst,
!                  x_src + bounds.x1, y_src + bounds.y1,
                   0, 0,
                   mask_bounds.x1, mask_bounds.y1,
--- 285,289 ----
                   mask,
                   dst,
!                  x_src + bounds.x1 - x_dst, y_src + bounds.y1 - y_dst,
                   0, 0,
                   mask_bounds.x1, mask_bounds.y1,
***************
*** 308,315 ****
--- 306,317 ----
    glc_region_box_t bounds, mask_bounds;
    double x_draw_offset, y_draw_offset;
+   int x_dst, y_dst;
  
    if (n_points < 3)
      return;
  
+   x_dst = points[0].x >> 16;
+   y_dst = points[0].y >> 16;
+ 
    if (src->programmatic)
      glc_programmatic_surface_setup (src, dst->width + x_src,
***************
*** 323,339 ****
  
    if ((!src->repeat) && (!src->transform)) {
!     if (bounds.x1 > (src->width - x_src))
!       return;
!     if (bounds.y1 > (src->height - y_src))
!       return;
!          
!     if (bounds.x2 > (src->width - x_src))
!       bounds.x2 = src->width - x_src;
  
!     if (bounds.y2 > (src->height - y_src))
!       bounds.y2 = (src->height - y_src);
  
!     if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2)
!       return;
    }
  
--- 325,336 ----
  
    if ((!src->repeat) && (!src->transform)) {
!     glc_region_box_t src_bounds;
  
!     src_bounds.x1 = bounds.x1 - (x_src - x_dst);
!     src_bounds.y1 = bounds.y1 - (y_src - y_dst);
!     src_bounds.x2 = src->width - (x_src - x_dst);
!     src_bounds.y2 = src->height - (y_src - y_dst);
  
!     glc_intersect_region (&bounds, &src_bounds, &bounds);
    }
  
***************
*** 403,407 ****
                   mask,
                   dst,
!                  x_src + bounds.x1, y_src + bounds.y1,
                   0, 0,
                   mask_bounds.x1, mask_bounds.y1,
--- 400,404 ----
                   mask,
                   dst,
!                  x_src + bounds.x1 - x_dst, y_src + bounds.y1 - y_dst,
                   0, 0,
                   mask_bounds.x1, mask_bounds.y1,





More information about the cairo-commit mailing list