[cairo-commit] glitz/src glitz.h, 1.5, 1.6 glitz_surface.c, 1.7, 1.8 glitz_trap.c, 1.3, 1.4 glitz_tri.c, 1.3, 1.4 glitzint.h, 1.9, 1.10

David Reveman commit at pdx.freedesktop.org
Mon May 10 14:00:34 PDT 2004


Committed by: davidr

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

Modified Files:
	glitz.h glitz_surface.c glitz_trap.c glitz_tri.c glitzint.h 
Log Message:
Added polygon opacity support

Index: glitz.h
===================================================================
RCS file: /cvs/cairo/glitz/src/glitz.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** a/glitz.h	30 Apr 2004 02:32:11 -0000	1.5
--- b/glitz.h	10 May 2004 21:00:31 -0000	1.6
***************
*** 300,303 ****
--- 300,307 ----
                              glitz_polyedge_t polyedge);
  
+ void
+ glitz_surface_set_polyopacity (glitz_surface_t *surface,
+                                unsigned short polyopacity);
+ 
  typedef enum {
    GLITZ_CLIP_OPERATOR_SET,

Index: glitz_surface.c
===================================================================
RCS file: /cvs/cairo/glitz/src/glitz_surface.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** a/glitz_surface.c	10 May 2004 15:14:39 -0000	1.7
--- b/glitz_surface.c	10 May 2004 21:00:31 -0000	1.8
***************
*** 49,52 ****
--- 49,53 ----
    surface->filter = GLITZ_FILTER_NEAREST;
    surface->polyedge = GLITZ_POLYEDGE_SMOOTH;
+   surface->polyopacity = 0xffff;
  
    surface->programs = programs;
***************
*** 381,384 ****
--- 382,393 ----
  slim_hidden_def(glitz_surface_set_polyedge);
  
+ void
+ glitz_surface_set_polyopacity (glitz_surface_t *surface,
+                                unsigned short polyopacity)
+ {
+   surface->polyopacity = polyopacity;
+ }
+ slim_hidden_def(glitz_surface_set_polyopacity);
+ 
  int
  glitz_surface_get_width (glitz_surface_t *surface)

Index: glitz_trap.c
===================================================================
RCS file: /cvs/cairo/glitz/src/glitz_trap.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** a/glitz_trap.c	10 May 2004 15:14:39 -0000	1.3
--- b/glitz_trap.c	10 May 2004 21:00:31 -0000	1.4
***************
*** 188,192 ****
  
    if (n_traps == 0)
! 	return;
  
    x_dst = traps[0].left.p1.x >> 16;
--- 188,192 ----
  
    if (n_traps == 0)
!     return;
  
    x_dst = traps[0].left.p1.x >> 16;
***************
*** 239,242 ****
--- 239,253 ----
                                 &color, traps, n_traps);
  
+     if (dst->polyopacity != 0xffff) {
+       glitz_rectangle_t rect;
+       glitz_color_t color;
+ 
+       rect.x = rect.y = 0;
+       rect.width = mask->width;
+       rect.height = mask->height;
+       color.red = color.green = color.blue = color.alpha = dst->polyopacity;
+       glitz_int_fill_rectangles (GLITZ_OPERATOR_IN, mask, &color, &rect, 1);
+     }
+ 
      glitz_surface_dirty (mask, NULL);
      glitz_surface_pop_current (mask);
***************
*** 268,272 ****
      width = trap_bounds.x2 - trap_bounds.x1;
      height = trap_bounds.y2 - trap_bounds.y1;
!     mask = NULL;
    }
    
--- 279,290 ----
      width = trap_bounds.x2 - trap_bounds.x1;
      height = trap_bounds.y2 - trap_bounds.y1;
! 
!     if (dst->polyopacity != 0xffff) {
!       glitz_color_t color;
! 
!       color.red = color.green = color.blue = color.alpha = dst->polyopacity;
!       mask = glitz_surface_create_solid (&color);
!     } else
!       mask = NULL;
    }
    
***************
*** 281,287 ****
                     width, height);
  
!   if (use_mask) {
      glitz_surface_destroy (mask);
!   } else {
      glitz_int_clip_operator_t clip_op;
      static glitz_rectangle_t rect = { 0, 0, MAXSHORT, MAXSHORT };
--- 299,306 ----
                     width, height);
  
!   if (mask)
      glitz_surface_destroy (mask);
! 
!   if (!use_mask) {
      glitz_int_clip_operator_t clip_op;
      static glitz_rectangle_t rect = { 0, 0, MAXSHORT, MAXSHORT };

Index: glitz_tri.c
===================================================================
RCS file: /cvs/cairo/glitz/src/glitz_tri.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** a/glitz_tri.c	10 May 2004 15:14:40 -0000	1.3
--- b/glitz_tri.c	10 May 2004 21:00:31 -0000	1.4
***************
*** 204,207 ****
--- 204,218 ----
                                &color, points, n_points);
  
+     if (dst->polyopacity != 0xffff) {
+       glitz_rectangle_t rect;
+       glitz_color_t color;
+       
+       rect.x = rect.y = 0;
+       rect.width = mask->width;
+       rect.height = mask->height;
+       color.red = color.green = color.blue = color.alpha = dst->polyopacity;
+       glitz_int_fill_rectangles (GLITZ_OPERATOR_IN, mask, &color, &rect, 1);
+     }
+ 
      glitz_surface_dirty (mask, NULL);
      glitz_surface_pop_current (mask);
***************
*** 234,238 ****
      width = tri_bounds.x2 - tri_bounds.x1;
      height = tri_bounds.y2 - tri_bounds.y1;
!     mask = NULL;
    }
  
--- 245,256 ----
      width = tri_bounds.x2 - tri_bounds.x1;
      height = tri_bounds.y2 - tri_bounds.y1;
! 
!     if (dst->polyopacity != 0xffff) {
!       glitz_color_t color;
! 
!       color.red = color.green = color.blue = color.alpha = dst->polyopacity;
!       mask = glitz_surface_create_solid (&color);
!     } else
!       mask = NULL;
    }
  
***************
*** 247,253 ****
                     width, height);
  
!   if (use_mask) {
      glitz_surface_destroy (mask);
!   } else {
      glitz_int_clip_operator_t clip_op;
      static glitz_rectangle_t rect = { 0, 0, MAXSHORT, MAXSHORT };
--- 265,272 ----
                     width, height);
  
!   if (mask)
      glitz_surface_destroy (mask);
!   
!   if (!use_mask) {
      glitz_int_clip_operator_t clip_op;
      static glitz_rectangle_t rect = { 0, 0, MAXSHORT, MAXSHORT };

Index: glitzint.h
===================================================================
RCS file: /cvs/cairo/glitz/src/glitzint.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** a/glitzint.h	10 May 2004 15:14:40 -0000	1.9
--- b/glitzint.h	10 May 2004 21:00:31 -0000	1.10
***************
*** 313,316 ****
--- 313,317 ----
    unsigned int clip_mask;
    unsigned long hint_mask;
+   unsigned short polyopacity;
  };
  
***************
*** 731,734 ****
--- 732,736 ----
  slim_hidden_proto(glitz_surface_set_filter)
  slim_hidden_proto(glitz_surface_set_polyedge)
+ slim_hidden_proto(glitz_surface_set_polyopacity)
  slim_hidden_proto(glitz_surface_get_width)
  slim_hidden_proto(glitz_surface_get_height)





More information about the cairo-commit mailing list