[cairo-commit] glitz/src glitz.c, 1.5, 1.6 glitz_agl_surface.c, 1.5, 1.6 glitz_glx_surface.c, 1.6, 1.7 glitz_matrix.c, 1.2, 1.3 glitz_rect.c, 1.2, 1.3 glitz_surface.c, 1.6, 1.7 glitz_texture.c, 1.3, 1.4 glitz_trap.c, 1.2, 1.3 glitz_tri.c, 1.2, 1.3 glitz_util.c, 1.2, 1.3 glitzint.h, 1.8, 1.9

David Reveman commit at pdx.freedesktop.org
Mon May 10 08:14:42 PDT 2004


Committed by: davidr

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

Modified Files:
	glitz.c glitz_agl_surface.c glitz_glx_surface.c glitz_matrix.c 
	glitz_rect.c glitz_surface.c glitz_texture.c glitz_trap.c 
	glitz_tri.c glitz_util.c glitzint.h 
Log Message:
region_box -> bounding_box, sub_pixel_region_box -> bounding_box_double

Index: glitz.c
===================================================================
RCS file: /cvs/cairo/glitz/src/glitz.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** a/glitz.c	10 May 2004 14:34:28 -0000	1.5
--- b/glitz.c	10 May 2004 15:14:39 -0000	1.6
***************
*** 71,76 ****
    glitz_texture_t *src_texture;
    glitz_texture_t *mask_texture;
!   glitz_sub_pixel_region_box_t src_region, mask_region, dst_region;
!   glitz_region_box_t dirty_region;
    glitz_point_t src_tl, src_br, mask_tl, mask_br, translate_src,
      translate_mask;
--- 71,76 ----
    glitz_texture_t *src_texture;
    glitz_texture_t *mask_texture;
!   glitz_bounding_box_double_t src_box, mask_box, dst_box;
!   glitz_bounding_box_t dirty_box;
    glitz_point_t src_tl, src_br, mask_tl, mask_br, translate_src,
      translate_mask;
***************
*** 153,261 ****
    
    /* calculate source area */
!   src_region.x1 = src_region.y1 = 0.0;
!   src_region.x2 = src->width;
!   src_region.y2 = src->height;
    
    if (src->transform)
!     glitz_matrix_transform_sub_pixel_region (src->transform, &src_region);
  
!   src_width = src_region.x2 - src_region.x1;
!   src_height = src_region.y2 - src_region.y1;
  
!   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;
!   src_region.x2 += (x_dst - x_src);
!   src_region.y2 += (y_dst - y_src);
    
  
    /* calculate mask area */
!   mask_region.x1 = mask_region.y1 = 0.0;
!   mask_region.x2 = mask->width;
!   mask_region.y2 = mask->height;
  
    if (mask->transform)
!     glitz_matrix_transform_sub_pixel_region (mask->transform, &mask_region);
  
!   mask_width = mask_region.x2 - mask_region.x1;
!   mask_height = mask_region.y2 - mask_region.y1;
  
!   translate_mask.x = (mask_region.x1 < 0.0)? mask_region.x1: 0.0;
!   translate_mask.y = (mask_region.y1 < 0.0)? mask_region.y1: 0.0;
!   mask_region.x1 += x_dst;
!   mask_region.y1 += y_dst;
!   mask_region.x2 += (x_dst - x_mask);
!   mask_region.y2 += (y_dst - y_mask);
  
  
    /* calculate destination area */
!   dst_region.x1 = x_dst;
!   dst_region.y1 = y_dst;
!   dst_region.x2 = dst_region.x1 + width;
!   dst_region.y2 = dst_region.y1 + height;
    
    if (!SURFACE_REPEAT (src))
!     glitz_intersect_sub_pixel_region (&dst_region, &src_region, &dst_region);
  
    if (!SURFACE_REPEAT (mask))
!     glitz_intersect_sub_pixel_region (&dst_region, &mask_region, &dst_region);
    
  
    /* re-calculate source area */
    if (SURFACE_REPEAT (src)) {
!     src_region.y2 = src->height -
!       (((y_src % src->height) + (int) (dst_region.y2 - dst_region.y1)) %
         src->height);
!     src_region.y1 = (dst_region.y2 - dst_region.y1) + src_region.y2;    
!     src_region.x1 = x_src % src->width;
!     src_region.x2 = (dst_region.x2 - dst_region.x1) + src_region.x1;
    } else {
!     glitz_intersect_sub_pixel_region (&src_region, &dst_region, &src_region);
  
      if (x_src < 0) x_src = 0;
      if (y_src < 0) y_src = 0;
  
!     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;
    }
  
    /* re-calculate mask area */
    if (SURFACE_REPEAT (mask)) {
!     mask_region.y2 = mask->height -
!       (((y_mask % mask->height) + (int) (dst_region.y2 - dst_region.y1)) %
         mask->height);
!     mask_region.y1 = (dst_region.y2 - dst_region.y1) + mask_region.y2;    
!     mask_region.x1 = x_mask % mask->width;
!     mask_region.x2 = (dst_region.x2 - dst_region.x1) + mask_region.x1;
    } else {
!     glitz_intersect_sub_pixel_region (&mask_region, &dst_region, &mask_region);
  
      if (x_mask < 0) x_mask = 0;
      if (y_mask < 0) y_mask = 0;
      
!     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;
    }
  
    /* normalize texture coordinates */
!   src_tl.x = (src_region.x1 / src_width) * src_texture->texcoord_width;
!   src_tl.y = (src_region.y1 / src_height) * src_texture->texcoord_height;
  
!   src_br.x = (src_region.x2 / src_width) * src_texture->texcoord_width;
!   src_br.y = (src_region.y2 / src_height) * src_texture->texcoord_height;
  
!   mask_tl.x = (mask_region.x1 / mask_width) * mask_texture->texcoord_width;
!   mask_tl.y = (mask_region.y1 / mask_height) * mask_texture->texcoord_height;
  
!   mask_br.x = (mask_region.x2 / mask_width) * mask_texture->texcoord_width;
!   mask_br.y = (mask_region.y2 / mask_height) * mask_texture->texcoord_height;
  
    if (!SURFACE_REPEAT(src)) {
--- 153,259 ----
    
    /* calculate source area */
!   src_box.x1 = src_box.y1 = 0.0;
!   src_box.x2 = src->width;
!   src_box.y2 = src->height;
    
    if (src->transform)
!     glitz_matrix_transform_bounding_box_double (src->transform, &src_box);
  
!   src_width = src_box.x2 - src_box.x1;
!   src_height = src_box.y2 - src_box.y1;
  
!   translate_src.x = (src_box.x1 < 0.0)? src_box.x1: 0.0;
!   translate_src.y = (src_box.y1 < 0.0)? src_box.y1: 0.0;
  
!   src_box.x1 += x_dst;
!   src_box.y1 += y_dst;
!   src_box.x2 += (x_dst - x_src);
!   src_box.y2 += (y_dst - y_src);
    
  
    /* calculate mask area */
!   mask_box.x1 = mask_box.y1 = 0.0;
!   mask_box.x2 = mask->width;
!   mask_box.y2 = mask->height;
  
    if (mask->transform)
!     glitz_matrix_transform_bounding_box_double (mask->transform, &mask_box);
  
!   mask_width = mask_box.x2 - mask_box.x1;
!   mask_height = mask_box.y2 - mask_box.y1;
  
!   translate_mask.x = (mask_box.x1 < 0.0)? mask_box.x1: 0.0;
!   translate_mask.y = (mask_box.y1 < 0.0)? mask_box.y1: 0.0;
!   mask_box.x1 += x_dst;
!   mask_box.y1 += y_dst;
!   mask_box.x2 += (x_dst - x_mask);
!   mask_box.y2 += (y_dst - y_mask);
  
  
    /* calculate destination area */
!   dst_box.x1 = x_dst;
!   dst_box.y1 = y_dst;
!   dst_box.x2 = dst_box.x1 + width;
!   dst_box.y2 = dst_box.y1 + height;
    
    if (!SURFACE_REPEAT (src))
!     glitz_intersect_bounding_box_double (&dst_box, &src_box, &dst_box);
  
    if (!SURFACE_REPEAT (mask))
!     glitz_intersect_bounding_box_double (&dst_box, &mask_box, &dst_box);
    
  
    /* re-calculate source area */
    if (SURFACE_REPEAT (src)) {
!     src_box.y2 = src->height -
!       (((y_src % src->height) + (int) (dst_box.y2 - dst_box.y1)) %
         src->height);
!     src_box.y1 = (dst_box.y2 - dst_box.y1) + src_box.y2;    
!     src_box.x1 = x_src % src->width;
!     src_box.x2 = (dst_box.x2 - dst_box.x1) + src_box.x1;
    } else {
!     glitz_intersect_bounding_box_double (&src_box, &dst_box, &src_box);
  
      if (x_src < 0) x_src = 0;
      if (y_src < 0) y_src = 0;
  
!     src_box.x2 = x_src + (src_box.x2 - src_box.x1) - translate_src.x;
!     src_box.y2 = y_src + (src_box.y2 - src_box.y1) - translate_src.y;
!     src_box.x1 = x_src - translate_src.x;
!     src_box.y1 = y_src - translate_src.y;
    }
  
    /* re-calculate mask area */
    if (SURFACE_REPEAT (mask)) {
!     mask_box.y2 = mask->height -
!       (((y_mask % mask->height) + (int) (dst_box.y2 - dst_box.y1)) %
         mask->height);
!     mask_box.y1 = (dst_box.y2 - dst_box.y1) + mask_box.y2;    
!     mask_box.x1 = x_mask % mask->width;
!     mask_box.x2 = (dst_box.x2 - dst_box.x1) + mask_box.x1;
    } else {
!     glitz_intersect_bounding_box_double (&mask_box, &dst_box, &mask_box);
  
      if (x_mask < 0) x_mask = 0;
      if (y_mask < 0) y_mask = 0;
      
!     mask_box.x2 = x_mask + (mask_box.x2 - mask_box.x1) - translate_mask.x;
!     mask_box.y2 = y_mask + (mask_box.y2 - mask_box.y1) - translate_mask.y;
!     mask_box.x1 = x_mask - translate_mask.x;
!     mask_box.y1 = y_mask - translate_mask.y;
    }
  
    /* normalize texture coordinates */
!   src_tl.x = (src_box.x1 / src_width) * src_texture->texcoord_width;
!   src_tl.y = (src_box.y1 / src_height) * src_texture->texcoord_height;
  
!   src_br.x = (src_box.x2 / src_width) * src_texture->texcoord_width;
!   src_br.y = (src_box.y2 / src_height) * src_texture->texcoord_height;
  
!   mask_tl.x = (mask_box.x1 / mask_width) * mask_texture->texcoord_width;
!   mask_tl.y = (mask_box.y1 / mask_height) * mask_texture->texcoord_height;
  
!   mask_br.x = (mask_box.x2 / mask_width) * mask_texture->texcoord_width;
!   mask_br.y = (mask_box.y2 / mask_height) * mask_texture->texcoord_height;
  
    if (!SURFACE_REPEAT(src)) {
***************
*** 273,289 ****
    gl->multi_tex_coord_2d_arb (GLITZ_GL_TEXTURE0_ARB, src_tl.x, src_tl.y);
    gl->multi_tex_coord_2d_arb (GLITZ_GL_TEXTURE1_ARB, mask_tl.x, mask_tl.y);
!   gl->vertex_2d (dst_region.x1, dst_region.y1);
  
    gl->multi_tex_coord_2d_arb (GLITZ_GL_TEXTURE0_ARB, src_br.x, src_tl.y);
    gl->multi_tex_coord_2d_arb (GLITZ_GL_TEXTURE1_ARB, mask_br.x, mask_tl.y);
!   gl->vertex_2d (dst_region.x2, dst_region.y1);
  
    gl->multi_tex_coord_2d_arb (GLITZ_GL_TEXTURE0_ARB, src_br.x, src_br.y);
    gl->multi_tex_coord_2d_arb (GLITZ_GL_TEXTURE1_ARB, mask_br.x, mask_br.y);
!   gl->vertex_2d (dst_region.x2, dst_region.y2);
  
    gl->multi_tex_coord_2d_arb (GLITZ_GL_TEXTURE0_ARB, src_tl.x, src_br.y);
    gl->multi_tex_coord_2d_arb (GLITZ_GL_TEXTURE1_ARB, mask_tl.x, mask_br.y);
!   gl->vertex_2d (dst_region.x1, dst_region.y2);
  
    gl->end ();
--- 271,287 ----
    gl->multi_tex_coord_2d_arb (GLITZ_GL_TEXTURE0_ARB, src_tl.x, src_tl.y);
    gl->multi_tex_coord_2d_arb (GLITZ_GL_TEXTURE1_ARB, mask_tl.x, mask_tl.y);
!   gl->vertex_2d (dst_box.x1, dst_box.y1);
  
    gl->multi_tex_coord_2d_arb (GLITZ_GL_TEXTURE0_ARB, src_br.x, src_tl.y);
    gl->multi_tex_coord_2d_arb (GLITZ_GL_TEXTURE1_ARB, mask_br.x, mask_tl.y);
!   gl->vertex_2d (dst_box.x2, dst_box.y1);
  
    gl->multi_tex_coord_2d_arb (GLITZ_GL_TEXTURE0_ARB, src_br.x, src_br.y);
    gl->multi_tex_coord_2d_arb (GLITZ_GL_TEXTURE1_ARB, mask_br.x, mask_br.y);
!   gl->vertex_2d (dst_box.x2, dst_box.y2);
  
    gl->multi_tex_coord_2d_arb (GLITZ_GL_TEXTURE0_ARB, src_tl.x, src_br.y);
    gl->multi_tex_coord_2d_arb (GLITZ_GL_TEXTURE1_ARB, mask_tl.x, mask_br.y);
!   gl->vertex_2d (dst_box.x1, dst_box.y2);
  
    gl->end ();
***************
*** 297,305 ****
    glitz_surface_disable_program (type, dst);
  
!   dirty_region.x1 = floor (dst_region.x1);
!   dirty_region.y1 = floor (dst_region.y1);
!   dirty_region.x2 = ceil (dst_region.x2);
!   dirty_region.y2 = ceil (dst_region.y2);
!   glitz_surface_dirty (dst, &dirty_region);
      
    glitz_surface_pop_current (dst);
--- 295,303 ----
    glitz_surface_disable_program (type, dst);
  
!   dirty_box.x1 = floor (dst_box.x1);
!   dirty_box.y1 = floor (dst_box.y1);
!   dirty_box.x2 = ceil (dst_box.x2);
!   dirty_box.y2 = ceil (dst_box.y2);
!   glitz_surface_dirty (dst, &dirty_box);
      
    glitz_surface_pop_current (dst);
***************
*** 318,325 ****
                     int x_dst,
                     int y_dst,
!                    glitz_region_box_t *bounds,
!                    glitz_region_box_t *mbounds)
  {
!   glitz_region_box_t region;
    
    if (bounds->x1 <= 0)
--- 316,323 ----
                     int x_dst,
                     int y_dst,
!                    glitz_bounding_box_t *bounds,
!                    glitz_bounding_box_t *mbounds)
  {
!   glitz_bounding_box_t box;
    
    if (bounds->x1 <= 0)
***************
*** 344,396 ****
  
    if (!SURFACE_REPEAT (src)) {
!     region.x1 = x_dst;
!     region.y1 = y_dst;
!     if (x_src < 0) region.x1 -= x_src;
!     if (y_src < 0) region.y1 -= y_src;
!     region.x2 = region.x1 + src->width;
!     region.y2 = region.y1 + src->height;
!     if (x_src > 0) region.x2 -= x_src;
!     if (y_src > 0) region.y2 -= y_src;
  
      if (src->transform)
!       glitz_matrix_transform_region (src->transform, &region);
      
!     if (mbounds->x1 < region.x1)
!       mbounds->x1 = region.x1;
      
!     if (mbounds->y1 < region.y1)
!       mbounds->y1 = region.y1;
      
!     if (mbounds->x2 > region.x2)
!       mbounds->x2 = region.x2;
      
!     if (mbounds->y2 > region.y2)
!       mbounds->y2 = region.y2;
    }
  
    if (!SURFACE_REPEAT (mask)) {
!     region.x1 = x_dst;
!     region.y1 = y_dst;
!     if (x_mask < 0) region.x1 -= x_mask;
!     if (y_mask < 0) region.y1 -= y_mask;
!     region.x2 = region.x1 + mask->width;
!     region.y2 = region.y1 + mask->height;
!     if (x_mask > 0) region.x2 -= x_mask;
!     if (y_mask > 0) region.y2 -= y_mask;
      
      if (mask->transform)
!       glitz_matrix_transform_region (mask->transform, &region);
      
!     if (mbounds->x1 < region.x1)
!       mbounds->x1 = region.x1;
      
!     if (mbounds->y1 < region.y1)
!       mbounds->y1 = region.y1;
      
!     if (mbounds->x2 > region.x2)
!       mbounds->x2 = region.x2;
      
!     if (mbounds->y2 > region.y2)
!       mbounds->y2 = region.y2;
    }
  }
--- 342,394 ----
  
    if (!SURFACE_REPEAT (src)) {
!     box.x1 = x_dst;
!     box.y1 = y_dst;
!     if (x_src < 0) box.x1 -= x_src;
!     if (y_src < 0) box.y1 -= y_src;
!     box.x2 = box.x1 + src->width;
!     box.y2 = box.y1 + src->height;
!     if (x_src > 0) box.x2 -= x_src;
!     if (y_src > 0) box.y2 -= y_src;
  
      if (src->transform)
!       glitz_matrix_transform_bounding_box (src->transform, &box);
      
!     if (mbounds->x1 < box.x1)
!       mbounds->x1 = box.x1;
      
!     if (mbounds->y1 < box.y1)
!       mbounds->y1 = box.y1;
      
!     if (mbounds->x2 > box.x2)
!       mbounds->x2 = box.x2;
      
!     if (mbounds->y2 > box.y2)
!       mbounds->y2 = box.y2;
    }
  
    if (!SURFACE_REPEAT (mask)) {
!     box.x1 = x_dst;
!     box.y1 = y_dst;
!     if (x_mask < 0) box.x1 -= x_mask;
!     if (y_mask < 0) box.y1 -= y_mask;
!     box.x2 = box.x1 + mask->width;
!     box.y2 = box.y1 + mask->height;
!     if (x_mask > 0) box.x2 -= x_mask;
!     if (y_mask > 0) box.y2 -= y_mask;
      
      if (mask->transform)
!       glitz_matrix_transform_bounding_box (mask->transform, &box);
      
!     if (mbounds->x1 < box.x1)
!       mbounds->x1 = box.x1;
      
!     if (mbounds->y1 < box.y1)
!       mbounds->y1 = box.y1;
      
!     if (mbounds->x2 > box.x2)
!       mbounds->x2 = box.x2;
      
!     if (mbounds->y2 > box.y2)
!       mbounds->y2 = box.y2;
    }
  }
***************
*** 422,426 ****
    glitz_texture_t *texture;
    glitz_point_t tl, bl, br, tr;
!   glitz_region_box_t clip;
    glitz_program_type_t type = 0;
    glitz_bool_t simple_modulate = 0;
--- 420,424 ----
    glitz_texture_t *texture;
    glitz_point_t tl, bl, br, tr;
!   glitz_bounding_box_t clip;
    glitz_program_type_t type = 0;
    glitz_bool_t simple_modulate = 0;
***************
*** 448,452 ****
  
    if (mask && (!simple_modulate)) {
!     glitz_region_box_t mask_bounds;
      static glitz_color_t clear_color = { 0x0000, 0x0000, 0x0000, 0x0000 };
      glitz_bool_t intermediate_translate;
--- 446,450 ----
  
    if (mask && (!simple_modulate)) {
!     glitz_bounding_box_t mask_bounds;
      static glitz_color_t clear_color = { 0x0000, 0x0000, 0x0000, 0x0000 };
      glitz_bool_t intermediate_translate;
***************
*** 466,470 ****
      
      if (!SURFACE_IMPLICIT_MASK (mask)) {
!       glitz_region_box_t bounds;
        
        bounds.x1 = x_dst;
--- 464,468 ----
      
      if (!SURFACE_IMPLICIT_MASK (mask)) {
!       glitz_bounding_box_t bounds;
        
        bounds.x1 = x_dst;

Index: glitz_agl_surface.c
===================================================================
RCS file: /cvs/cairo/glitz/src/glitz_agl_surface.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** a/glitz_agl_surface.c	6 May 2004 14:55:03 -0000	1.5
--- b/glitz_agl_surface.c	10 May 2004 15:14:39 -0000	1.6
***************
*** 108,112 ****
      } else 
        glitz_texture_copy_surface (&surface->base.texture, &surface->base,
!                                   &surface->base.dirty_region);
      
      surface->base.hint_mask &= ~GLITZ_INT_HINT_DIRTY_MASK;
--- 108,112 ----
      } else 
        glitz_texture_copy_surface (&surface->base.texture, &surface->base,
!                                   &surface->base.dirty_box);
      
      surface->base.hint_mask &= ~GLITZ_INT_HINT_DIRTY_MASK;

Index: glitz_glx_surface.c
===================================================================
RCS file: /cvs/cairo/glitz/src/glitz_glx_surface.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** a/glitz_glx_surface.c	9 May 2004 20:54:51 -0000	1.6
--- b/glitz_glx_surface.c	10 May 2004 15:14:39 -0000	1.7
***************
*** 122,126 ****
    if (surface->base.hint_mask & GLITZ_INT_HINT_DIRTY_MASK) {
      glitz_texture_copy_surface (&surface->base.texture, &surface->base,
!                                 &surface->base.dirty_region);
      surface->base.hint_mask &= ~GLITZ_INT_HINT_DIRTY_MASK;
    }
--- 122,126 ----
    if (surface->base.hint_mask & GLITZ_INT_HINT_DIRTY_MASK) {
      glitz_texture_copy_surface (&surface->base.texture, &surface->base,
!                                 &surface->base.dirty_box);
      surface->base.hint_mask &= ~GLITZ_INT_HINT_DIRTY_MASK;
    }

Index: glitz_matrix.c
===================================================================
RCS file: /cvs/cairo/glitz/src/glitz_matrix.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** a/glitz_matrix.c	30 Apr 2004 02:26:02 -0000	1.2
--- b/glitz_matrix.c	10 May 2004 15:14:39 -0000	1.3
***************
*** 59,96 ****
  
  void
! glitz_matrix_transform_region (glitz_matrix_t *matrix,
!                                glitz_region_box_t *region)
  {
    glitz_point_t point;
  
!   point.x = region->x1;
!   point.y = region->y1;
    _glitz_matrix_transform_distance (matrix, &point.x, &point.y);
!   region->x1 = floor (point.x);
!   region->y1 = floor (point.y);
  
!   point.x = region->x2;
!   point.y = region->y2;
    _glitz_matrix_transform_distance (matrix, &point.x, &point.y);
!   region->x2 = ceil (point.x);
!   region->y2 = ceil (point.y);
    
!   region->x1 += (int) floor (matrix->m[2][0]);
!   region->y1 += (int) floor (matrix->m[2][1]);
!   region->x2 += (int) ceil (matrix->m[2][0]);
!   region->y2 += (int) ceil (matrix->m[2][1]);
  }
  
  void
! glitz_matrix_transform_sub_pixel_region (glitz_matrix_t *matrix,
!                                          glitz_sub_pixel_region_box_t *region)
  {
!   _glitz_matrix_transform_distance (matrix, &region->x1, &region->y1);
!   _glitz_matrix_transform_distance (matrix, &region->x2, &region->y2);
    
!   region->x1 += matrix->m[2][0];
!   region->y1 += matrix->m[2][1];
!   region->x2 += matrix->m[2][0];
!   region->y2 += matrix->m[2][1];
  }
  
--- 59,96 ----
  
  void
! glitz_matrix_transform_bounding_box (glitz_matrix_t *matrix,
!                                      glitz_bounding_box_t *box)
  {
    glitz_point_t point;
  
!   point.x = box->x1;
!   point.y = box->y1;
    _glitz_matrix_transform_distance (matrix, &point.x, &point.y);
!   box->x1 = floor (point.x);
!   box->y1 = floor (point.y);
  
!   point.x = box->x2;
!   point.y = box->y2;
    _glitz_matrix_transform_distance (matrix, &point.x, &point.y);
!   box->x2 = ceil (point.x);
!   box->y2 = ceil (point.y);
    
!   box->x1 += (int) floor (matrix->m[2][0]);
!   box->y1 += (int) floor (matrix->m[2][1]);
!   box->x2 += (int) ceil (matrix->m[2][0]);
!   box->y2 += (int) ceil (matrix->m[2][1]);
  }
  
  void
! glitz_matrix_transform_bounding_box_double (glitz_matrix_t *matrix,
!                                             glitz_bounding_box_double_t *box)
  {
!   _glitz_matrix_transform_distance (matrix, &box->x1, &box->y1);
!   _glitz_matrix_transform_distance (matrix, &box->x2, &box->y2);
    
!   box->x1 += matrix->m[2][0];
!   box->y1 += matrix->m[2][1];
!   box->x2 += matrix->m[2][0];
!   box->y2 += matrix->m[2][1];
  }
  

Index: glitz_rect.c
===================================================================
RCS file: /cvs/cairo/glitz/src/glitz_rect.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** a/glitz_rect.c	6 Apr 2004 16:28:03 -0000	1.2
--- b/glitz_rect.c	10 May 2004 15:14:39 -0000	1.3
***************
*** 35,39 ****
  glitz_rectangle_bounds (int n_rects,
                          const glitz_rectangle_t *rects,
!                         glitz_region_box_t *box)
  {
    box->x1 = rects->x;
--- 35,39 ----
  glitz_rectangle_bounds (int n_rects,
                          const glitz_rectangle_t *rects,
!                         glitz_bounding_box_t *box)
  {
    box->x1 = rects->x;
***************
*** 64,68 ****
                             int n_rects)
  {
!   glitz_region_box_t bounds;
    glitz_gl_vertex_2i_t vertex_2i;
    glitz_gl_bitfield_t clear_mask;
--- 64,68 ----
                             int n_rects)
  {
!   glitz_bounding_box_t bounds;
    glitz_gl_vertex_2i_t vertex_2i;
    glitz_gl_bitfield_t clear_mask;
***************
*** 125,129 ****
                        unsigned int height)
  {
!   glitz_region_box_t bounds;
    glitz_rectangle_t rect;
  
--- 125,129 ----
                        unsigned int height)
  {
!   glitz_bounding_box_t bounds;
    glitz_rectangle_t rect;
  
***************
*** 160,164 ****
                         int n_rects)
  {
!   glitz_region_box_t bounds;
    
    glitz_rectangle_bounds (n_rects, rects, &bounds);
--- 160,164 ----
                         int n_rects)
  {
!   glitz_bounding_box_t bounds;
    
    glitz_rectangle_bounds (n_rects, rects, &bounds);

Index: glitz_surface.c
===================================================================
RCS file: /cvs/cairo/glitz/src/glitz_surface.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** a/glitz_surface.c	6 May 2004 14:55:03 -0000	1.6
--- b/glitz_surface.c	10 May 2004 15:14:39 -0000	1.7
***************
*** 238,242 ****
  void
  glitz_surface_bounds (glitz_surface_t *surface,
!                       glitz_region_box_t *box)
  {
    box->y1 = MINSHORT;
--- 238,242 ----
  void
  glitz_surface_bounds (glitz_surface_t *surface,
!                       glitz_bounding_box_t *box)
  {
    box->y1 = MINSHORT;
***************
*** 480,496 ****
  void
  glitz_surface_dirty (glitz_surface_t *surface,
!                      glitz_region_box_t *region)
  {
!   if (!region) {
!     surface->dirty_region.x1 = surface->dirty_region.y1 = 0;
!     surface->dirty_region.x2 = surface->width;
!     surface->dirty_region.y2 = surface->height;
    } else {
      if (!SURFACE_DIRTY (surface)) {
!       surface->dirty_region = *region;
      } else
!       glitz_union_region (region,
!                           &surface->dirty_region,
!                           &surface->dirty_region);
    }
    
--- 480,496 ----
  void
  glitz_surface_dirty (glitz_surface_t *surface,
!                      glitz_bounding_box_t *box)
  {
!   if (!box) {
!     surface->dirty_box.x1 = surface->dirty_box.y1 = 0;
!     surface->dirty_box.x2 = surface->width;
!     surface->dirty_box.y2 = surface->height;
    } else {
      if (!SURFACE_DIRTY (surface)) {
!       surface->dirty_box = *box;
      } else
!       glitz_union_bounding_box (box,
!                                 &surface->dirty_box,
!                                 &surface->dirty_box);
    }
    
***************
*** 709,713 ****
  
    if (drawable) {
!     glitz_region_box_t bounds;
  
      bounds.x1 = x;
--- 709,713 ----
  
    if (drawable) {
!     glitz_bounding_box_t bounds;
  
      bounds.x1 = x;
***************
*** 804,814 ****
  glitz_surface_gl_end (glitz_surface_t *surface)
  {
!   glitz_region_box_t region;
  
!   region.x1 = region.y1 = 0;
!   region.x2 = surface->width;
!   region.y2 = surface->height;
    
!   glitz_surface_dirty (surface, &region);
    
    glitz_surface_pop_current (surface);
--- 804,814 ----
  glitz_surface_gl_end (glitz_surface_t *surface)
  {
!   glitz_bounding_box_t box;
  
!   box.x1 = box.y1 = 0;
!   box.x2 = surface->width;
!   box.y2 = surface->height;
    
!   glitz_surface_dirty (surface, &box);
    
    glitz_surface_pop_current (surface);

Index: glitz_texture.c
===================================================================
RCS file: /cvs/cairo/glitz/src/glitz_texture.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** a/glitz_texture.c	6 May 2004 14:55:03 -0000	1.3
--- b/glitz_texture.c	10 May 2004 15:14:39 -0000	1.4
***************
*** 215,219 ****
  glitz_texture_copy_surface (glitz_texture_t *texture,
                              glitz_surface_t *surface,
!                             glitz_region_box_t *region)
  {
    glitz_surface_push_current (surface, GLITZ_CN_SURFACE_DRAWABLE_CURRENT);
--- 215,219 ----
  glitz_texture_copy_surface (glitz_texture_t *texture,
                              glitz_surface_t *surface,
!                             glitz_bounding_box_t *box)
  {
    glitz_surface_push_current (surface, GLITZ_CN_SURFACE_DRAWABLE_CURRENT);
***************
*** 224,237 ****
      _glitz_texture_allocate (surface->gl, texture);
  
!   if (region->x1 < 0) region->x1 = 0;
!   if (region->y1 < 0) region->y1 = 0;
!   if (region->x2 > surface->width) region->x2 = surface->width;
!   if (region->y2 > surface->height) region->y2 = surface->height;
  
    surface->gl->copy_tex_sub_image_2d (texture->target, 0,
!                                       region->x1, region->y1,
!                                       region->x1, region->y1,
!                                       region->x2 - region->x1,
!                                       region->y2 - region->y1);
    
    surface->gl->flush ();
--- 224,237 ----
      _glitz_texture_allocate (surface->gl, texture);
  
!   if (box->x1 < 0) box->x1 = 0;
!   if (box->y1 < 0) box->y1 = 0;
!   if (box->x2 > surface->width) box->x2 = surface->width;
!   if (box->y2 > surface->height) box->y2 = surface->height;
  
    surface->gl->copy_tex_sub_image_2d (texture->target, 0,
!                                       box->x1, box->y1,
!                                       box->x1, box->y1,
!                                       box->x2 - box->x1,
!                                       box->y2 - box->y1);
    
    surface->gl->flush ();

Index: glitz_trap.c
===================================================================
RCS file: /cvs/cairo/glitz/src/glitz_trap.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** a/glitz_trap.c	10 May 2004 14:34:28 -0000	1.2
--- b/glitz_trap.c	10 May 2004 15:14:39 -0000	1.3
***************
*** 60,64 ****
  glitz_trapezoid_bounds (int n_traps,
                          const glitz_trapezoid_t *traps,
!                         glitz_region_box_t *box)
  {
    box->y1 = MAXSHORT;
--- 60,64 ----
  glitz_trapezoid_bounds (int n_traps,
                          const glitz_trapezoid_t *traps,
!                         glitz_bounding_box_t *box)
  {
    box->y1 = MAXSHORT;
***************
*** 152,156 ****
                         int n_traps)
  {
!   glitz_region_box_t bounds;
    
    glitz_trapezoid_bounds (n_traps, traps, &bounds);
--- 152,156 ----
                         int n_traps)
  {
!   glitz_bounding_box_t bounds;
    
    glitz_trapezoid_bounds (n_traps, traps, &bounds);
***************
*** 181,185 ****
  {
    glitz_surface_t *mask;
!   glitz_region_box_t trap_bounds;
    glitz_bool_t use_mask;
    int x_dst, y_dst;
--- 181,185 ----
  {
    glitz_surface_t *mask;
!   glitz_bounding_box_t trap_bounds;
    glitz_bool_t use_mask;
    int x_dst, y_dst;
***************
*** 201,205 ****
  
    if (use_mask) {
!     glitz_region_box_t src_bounds, dst_bounds, bounds;
      static glitz_color_t color = { 0xffff, 0xffff, 0xffff, 0xffff };
      
--- 201,205 ----
  
    if (use_mask) {
!     glitz_bounding_box_t src_bounds, dst_bounds, bounds;
      static glitz_color_t color = { 0xffff, 0xffff, 0xffff, 0xffff };
      
***************
*** 212,217 ****
      src_bounds.y2 += (y_dst - y_src);
  
!     glitz_intersect_region (&src_bounds, &trap_bounds, &bounds);
!     glitz_intersect_region (&dst_bounds, &bounds, &bounds);
  
      if ((bounds.x2 - bounds.x1) <= 0 || (bounds.y2 - bounds.y1) <= 0)
--- 212,217 ----
      src_bounds.y2 += (y_dst - y_src);
  
!     glitz_intersect_bounding_box (&src_bounds, &trap_bounds, &bounds);
!     glitz_intersect_bounding_box (&dst_bounds, &bounds, &bounds);
  
      if ((bounds.x2 - bounds.x1) <= 0 || (bounds.y2 - bounds.y1) <= 0)
***************
*** 303,307 ****
  glitz_color_trapezoid_bounds (int n_color_traps,
                                const glitz_color_trapezoid_t *color_traps,
!                               glitz_region_box_t *box)
  {
    box->y1 = MAXSHORT;
--- 303,307 ----
  glitz_color_trapezoid_bounds (int n_color_traps,
                                const glitz_color_trapezoid_t *color_traps,
!                               glitz_bounding_box_t *box)
  {
    box->y1 = MAXSHORT;
***************
*** 344,348 ****
    glitz_gl_vertex_2d_t vertex_2d;
    glitz_gl_color_4us_t color_4us;
!   glitz_region_box_t bounds;
    int index;
    glitz_bool_t shade = 0;
--- 344,348 ----
    glitz_gl_vertex_2d_t vertex_2d;
    glitz_gl_color_4us_t color_4us;
!   glitz_bounding_box_t bounds;
    int index;
    glitz_bool_t shade = 0;

Index: glitz_tri.c
===================================================================
RCS file: /cvs/cairo/glitz/src/glitz_tri.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** a/glitz_tri.c	10 May 2004 14:34:28 -0000	1.2
--- b/glitz_tri.c	10 May 2004 15:14:40 -0000	1.3
***************
*** 35,39 ****
  glitz_point_fixed_bounds (int n_point,
                            const glitz_point_fixed_t *points,
!                           glitz_region_box_t *box)
  {
    box->x1 = FIXED_TO_INT (points->x);
--- 35,39 ----
  glitz_point_fixed_bounds (int n_point,
                            const glitz_point_fixed_t *points,
!                           glitz_bounding_box_t *box)
  {
    box->x1 = FIXED_TO_INT (points->x);
***************
*** 111,115 ****
                        int n_tris)
  {
!   glitz_region_box_t bounds;
    
    glitz_point_fixed_bounds (n_tris * 3, (glitz_point_fixed_t *) tris, &bounds);
--- 111,115 ----
                        int n_tris)
  {
!   glitz_bounding_box_t bounds;
    
    glitz_point_fixed_bounds (n_tris * 3, (glitz_point_fixed_t *) tris, &bounds);
***************
*** 147,151 ****
  {
    glitz_surface_t *mask;
!   glitz_region_box_t tri_bounds;
    glitz_bool_t use_mask;
    int x_dst, y_dst;
--- 147,151 ----
  {
    glitz_surface_t *mask;
!   glitz_bounding_box_t tri_bounds;
    glitz_bool_t use_mask;
    int x_dst, y_dst;
***************
*** 164,168 ****
  
    if (use_mask) {
!     glitz_region_box_t src_bounds, dst_bounds, bounds;
      static glitz_color_t color = { 0xffff, 0xffff, 0xffff, 0xffff };
      
--- 164,168 ----
  
    if (use_mask) {
!     glitz_bounding_box_t src_bounds, dst_bounds, bounds;
      static glitz_color_t color = { 0xffff, 0xffff, 0xffff, 0xffff };
      
***************
*** 175,180 ****
      src_bounds.y2 += (y_dst - y_src);
  
!     glitz_intersect_region (&src_bounds, &tri_bounds, &bounds);
!     glitz_intersect_region (&dst_bounds, &bounds, &bounds);
  
      if ((bounds.x2 - bounds.x1) <= 0 || (bounds.y2 - bounds.y1) <= 0)
--- 175,180 ----
      src_bounds.y2 += (y_dst - y_src);
  
!     glitz_intersect_bounding_box (&src_bounds, &tri_bounds, &bounds);
!     glitz_intersect_bounding_box (&dst_bounds, &bounds, &bounds);
  
      if ((bounds.x2 - bounds.x1) <= 0 || (bounds.y2 - bounds.y1) <= 0)
***************
*** 314,318 ****
  glitz_color_triangle_bounds (int n_color_tris,
                               const glitz_color_triangle_t *color_tris,
!                              glitz_region_box_t *box)
  {
    box->x1 = MIN (MIN (FIXED_TO_INT (color_tris->p1.point.x),
--- 314,318 ----
  glitz_color_triangle_bounds (int n_color_tris,
                               const glitz_color_triangle_t *color_tris,
!                              glitz_bounding_box_t *box)
  {
    box->x1 = MIN (MIN (FIXED_TO_INT (color_tris->p1.point.x),
***************
*** 375,379 ****
    glitz_gl_vertex_2d_t vertex_2d;
    glitz_gl_color_4us_t color_4us;
!   glitz_region_box_t bounds;
    int index;
    glitz_bool_t shade = 0;
--- 375,379 ----
    glitz_gl_vertex_2d_t vertex_2d;
    glitz_gl_color_4us_t color_4us;
!   glitz_bounding_box_t bounds;
    int index;
    glitz_bool_t shade = 0;

Index: glitz_util.c
===================================================================
RCS file: /cvs/cairo/glitz/src/glitz_util.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** a/glitz_util.c	28 Apr 2004 08:59:38 -0000	1.2
--- b/glitz_util.c	10 May 2004 15:14:40 -0000	1.3
***************
*** 36,42 ****
  
  void
! glitz_intersect_region (glitz_region_box_t *box1,
!                         glitz_region_box_t *box2,
!                         glitz_region_box_t *return_box)
  {
    return_box->x1 = (box1->x1 >= box2->x1)? box1->x1: box2->x1;
--- 36,42 ----
  
  void
! glitz_intersect_bounding_box (glitz_bounding_box_t *box1,
!                               glitz_bounding_box_t *box2,
!                               glitz_bounding_box_t *return_box)
  {
    return_box->x1 = (box1->x1 >= box2->x1)? box1->x1: box2->x1;
***************
*** 53,59 ****
  
  void
! glitz_union_region (glitz_region_box_t *box1,
!                     glitz_region_box_t *box2,
!                     glitz_region_box_t *return_box)
  {
    return_box->x1 = (box1->x1 <= box2->x1)? box1->x1: box2->x1;
--- 53,59 ----
  
  void
! glitz_union_bounding_box (glitz_bounding_box_t *box1,
!                           glitz_bounding_box_t *box2,
!                           glitz_bounding_box_t *return_box)
  {
    return_box->x1 = (box1->x1 <= box2->x1)? box1->x1: box2->x1;
***************
*** 64,70 ****
  
  void
! glitz_intersect_sub_pixel_region (glitz_sub_pixel_region_box_t *box1,
!                                   glitz_sub_pixel_region_box_t *box2,
!                                   glitz_sub_pixel_region_box_t *return_box)
  {
    return_box->x1 = (box1->x1 >= box2->x1)? box1->x1: box2->x1;
--- 64,70 ----
  
  void
! glitz_intersect_bounding_box_double (glitz_bounding_box_double_t *box1,
!                                      glitz_bounding_box_double_t *box2,
!                                      glitz_bounding_box_double_t *return_box)
  {
    return_box->x1 = (box1->x1 >= box2->x1)? box1->x1: box2->x1;
***************
*** 81,87 ****
  
  void
! glitz_union_sub_pixel_region (glitz_sub_pixel_region_box_t *box1,
!                               glitz_sub_pixel_region_box_t *box2,
!                               glitz_sub_pixel_region_box_t *return_box)
  {
    return_box->x1 = (box1->x1 <= box2->x1)? box1->x1: box2->x1;
--- 81,87 ----
  
  void
! glitz_union_bounding_box_double (glitz_bounding_box_double_t *box1,
!                                  glitz_bounding_box_double_t *box2,
!                                  glitz_bounding_box_double_t *return_box)
  {
    return_box->x1 = (box1->x1 <= box2->x1)? box1->x1: box2->x1;

Index: glitzint.h
===================================================================
RCS file: /cvs/cairo/glitz/src/glitzint.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** a/glitzint.h	9 May 2004 20:54:51 -0000	1.8
--- b/glitzint.h	10 May 2004 15:14:40 -0000	1.9
***************
*** 206,216 ****
  } glitz_triangle_type_t;
  
! typedef struct _glitz_region_box_t {
    int x1, x2, y1, y2;
! } glitz_region_box_t;
  
! typedef struct _glitz_sub_pixel_region_box_t {
    double x1, x2, y1, y2;
! } glitz_sub_pixel_region_box_t;
  
  typedef struct _glitz_point_t {
--- 206,216 ----
  } glitz_triangle_type_t;
  
! typedef struct _glitz_bounding_box_t {
    int x1, x2, y1, y2;
! } glitz_bounding_box_t;
  
! typedef struct _glitz_bounding_box_double_t {
    double x1, x2, y1, y2;
! } glitz_bounding_box_double_t;
  
  typedef struct _glitz_point_t {
***************
*** 307,311 ****
    unsigned int n_transforms;
    int width, height;
!   glitz_region_box_t dirty_region;
    glitz_gl_proc_address_list_t *gl;
    glitz_programs_t *programs;
--- 307,311 ----
    unsigned int n_transforms;
    int width, height;
!   glitz_bounding_box_t dirty_box;
    glitz_gl_proc_address_list_t *gl;
    glitz_programs_t *programs;
***************
*** 365,374 ****
  
  extern void __internal_linkage
! glitz_matrix_transform_region (glitz_matrix_t *matrix,
!                                glitz_region_box_t *region);
       
  extern void __internal_linkage
! glitz_matrix_transform_sub_pixel_region (glitz_matrix_t *matrix,
!                                          glitz_sub_pixel_region_box_t *region);
  
  extern glitz_status_t __internal_linkage
--- 365,374 ----
  
  extern void __internal_linkage
! glitz_matrix_transform_bounding_box (glitz_matrix_t *matrix,
!                                      glitz_bounding_box_t *box);
       
  extern void __internal_linkage
! glitz_matrix_transform_bounding_box_double (glitz_matrix_t *matrix,
!                                             glitz_bounding_box_double_t *box);
  
  extern glitz_status_t __internal_linkage
***************
*** 406,427 ****
  
  extern void __internal_linkage
! glitz_intersect_region (glitz_region_box_t *box1,
!                         glitz_region_box_t *box2,
!                         glitz_region_box_t *return_box);
  
  extern void __internal_linkage
! glitz_union_region (glitz_region_box_t *box1,
!                     glitz_region_box_t *box2,
!                     glitz_region_box_t *return_box);
  
  extern void __internal_linkage
! glitz_intersect_sub_pixel_region (glitz_sub_pixel_region_box_t *box1,
!                                   glitz_sub_pixel_region_box_t *box2,
!                                   glitz_sub_pixel_region_box_t *return_box);
  
  extern void __internal_linkage
! glitz_union_sub_pixel_region (glitz_sub_pixel_region_box_t *box1,
!                               glitz_sub_pixel_region_box_t *box2,
!                               glitz_sub_pixel_region_box_t *return_box);
  
  glitz_gl_enum_t
--- 406,427 ----
  
  extern void __internal_linkage
! glitz_intersect_bounding_box (glitz_bounding_box_t *box1,
!                               glitz_bounding_box_t *box2,
!                               glitz_bounding_box_t *return_box);
  
  extern void __internal_linkage
! glitz_union_bounding_box (glitz_bounding_box_t *box1,
!                           glitz_bounding_box_t *box2,
!                           glitz_bounding_box_t *return_box);
  
  extern void __internal_linkage
! glitz_intersect_bounding_box_double (glitz_bounding_box_double_t *box1,
!                                      glitz_bounding_box_double_t *box2,
!                                      glitz_bounding_box_double_t *return_box);
  
  extern void __internal_linkage
! glitz_union_box_double (glitz_bounding_box_double_t *box1,
!                         glitz_bounding_box_double_t *box2,
!                         glitz_bounding_box_double_t *return_box);
  
  glitz_gl_enum_t
***************
*** 474,478 ****
  glitz_texture_copy_surface (glitz_texture_t *texture,
                              glitz_surface_t *surface,
!                             glitz_region_box_t *region);
  
  void
--- 474,478 ----
  glitz_texture_copy_surface (glitz_texture_t *texture,
                              glitz_surface_t *surface,
!                             glitz_bounding_box_t *box);
  
  void
***************
*** 510,514 ****
  extern void __internal_linkage
  glitz_surface_bounds (glitz_surface_t *surface,
!                       glitz_region_box_t *box);
  
  extern void __internal_linkage
--- 510,514 ----
  extern void __internal_linkage
  glitz_surface_bounds (glitz_surface_t *surface,
!                       glitz_bounding_box_t *box);
  
  extern void __internal_linkage
***************
*** 526,530 ****
  extern void __internal_linkage
  glitz_surface_dirty (glitz_surface_t *surface,
!                      glitz_region_box_t *region);
  
  extern void __internal_linkage
--- 526,530 ----
  extern void __internal_linkage
  glitz_surface_dirty (glitz_surface_t *surface,
!                      glitz_bounding_box_t *box);
  
  extern void __internal_linkage





More information about the cairo-commit mailing list