[cairo-commit] glitz/src glitz_rect.c, 1.1.1.1, 1.2 glitz_surface.c, 1.2, 1.3 glitzint.h, 1.3, 1.4

David Reveman commit at pdx.freedesktop.org
Tue Apr 6 09:28:05 PDT 2004


Committed by: davidr

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

Modified Files:
	glitz_rect.c glitz_surface.c glitzint.h 
Log Message:
Use glClear for rectangular solid color and stencil fills

Index: glitz_rect.c
===================================================================
RCS file: /cvs/cairo/glitz/src/glitz_rect.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** a/glitz_rect.c	30 Mar 2004 17:07:19 -0000	1.1.1.1
--- b/glitz_rect.c	6 Apr 2004 16:28:03 -0000	1.2
***************
*** 66,69 ****
--- 66,70 ----
    glitz_region_box_t bounds;
    glitz_gl_vertex_2i_t vertex_2i;
+   glitz_gl_bitfield_t clear_mask;
    
    glitz_rectangle_bounds (n_rects, rects, &bounds);
***************
*** 72,90 ****
      return;
  
!   dst->gl->color_4us (color->red, color->green, color->blue, color->alpha);
! 
!   glitz_set_operator (dst->gl, op);
      
!   dst->gl->begin (GLITZ_GL_QUADS);
! 
!   vertex_2i = dst->gl->vertex_2i;
!   for (; n_rects; n_rects--, rects++) {
!     vertex_2i (rects->x, rects->y);
!     vertex_2i (rects->x + rects->width, rects->y);
!     vertex_2i (rects->x + rects->width, rects->y + rects->height);
!     vertex_2i (rects->x, rects->y + rects->height);
    }
    
!   dst->gl->end ();
  }
  
--- 73,117 ----
      return;
  
!   if (op == GLITZ_OPERATOR_SRC) {
!     clear_mask = GLITZ_GL_COLOR_BUFFER_BIT;
!     dst->gl->clear_color (color->red / (glitz_gl_clampf_t) 0xffff,
!                           color->green / (glitz_gl_clampf_t) 0xffff,
!                           color->blue / (glitz_gl_clampf_t) 0xffff,
!                           color->alpha / (glitz_gl_clampf_t) 0xffff);
!   } else if (op == (glitz_operator_t) GLITZ_INT_OPERATOR_STENCIL_RECT_SET) {
!     clear_mask = GLITZ_GL_STENCIL_BUFFER_BIT;
!     dst->gl->clear_stencil (0x1);
!   } else {
!     if (op == (glitz_operator_t) GLITZ_INT_OPERATOR_STENCIL_RECT_SRC)
!       op = GLITZ_OPERATOR_SRC;
      
!     clear_mask = 0x0;
    }
    
!   if (clear_mask) {
!     for (; n_rects; n_rects--, rects++) {
!       dst->gl->scissor (rects->x,
!                         dst->height - (rects->y + rects->height),
!                         rects->width,
!                         rects->height);
!       dst->gl->clear (clear_mask);
!     }
!   } else {
!     dst->gl->color_4us (color->red, color->green, color->blue, color->alpha);
!       
!     glitz_set_operator (dst->gl, op);
!       
!     dst->gl->begin (GLITZ_GL_QUADS);
!       
!     vertex_2i = dst->gl->vertex_2i;
!     for (; n_rects; n_rects--, rects++) {
!       vertex_2i (rects->x, rects->y);
!       vertex_2i (rects->x + rects->width, rects->y);
!       vertex_2i (rects->x + rects->width, rects->y + rects->height);
!       vertex_2i (rects->x, rects->y + rects->height);
!     }
!   
!     dst->gl->end ();
!   }
  }
  

Index: glitz_surface.c
===================================================================
RCS file: /cvs/cairo/glitz/src/glitz_surface.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** a/glitz_surface.c	3 Apr 2004 17:53:54 -0000	1.2
--- b/glitz_surface.c	6 Apr 2004 16:28:03 -0000	1.3
***************
*** 772,776 ****
                             GLITZ_GL_FALSE, GLITZ_GL_FALSE);
  
!   glitz_int_fill_rectangles (GLITZ_OPERATOR_SRC,
                               surface,
                               &color,
--- 772,779 ----
                             GLITZ_GL_FALSE, GLITZ_GL_FALSE);
  
!   glitz_int_fill_rectangles ((glitz_operator_t)
!                              ((op == GLITZ_INT_CLIP_OPERATOR_SET)?
!                               GLITZ_INT_OPERATOR_STENCIL_RECT_SET:
!                               GLITZ_INT_OPERATOR_STENCIL_RECT_SRC),
                               surface,
                               &color,

Index: glitzint.h
===================================================================
RCS file: /cvs/cairo/glitz/src/glitzint.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** a/glitzint.h	3 Apr 2004 17:53:54 -0000	1.3
--- b/glitzint.h	6 Apr 2004 16:28:03 -0000	1.4
***************
*** 375,378 ****
--- 375,383 ----
  glitz_matrix_normalize (glitz_matrix_t *matrix);
  
+ typedef enum glitz_int_operator {
+   GLITZ_INT_OPERATOR_STENCIL_RECT_SET = 1000,
+   GLITZ_INT_OPERATOR_STENCIL_RECT_SRC
+ } glitz_int_operator_t;
+ 
  extern void __internal_linkage
  glitz_set_operator (glitz_gl_proc_address_list_t *gl, glitz_operator_t op);





More information about the cairo-commit mailing list