[cairo-commit] cairo/src cairo_gl_surface.c,1.4,1.5

David Reveman commit at pdx.freedesktop.org
Wed Apr 28 02:14:25 PDT 2004


Committed by: davidr

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

Modified Files:
	cairo_gl_surface.c 
Log Message:
Support compositing with mask surface when mask is solid or multi-texturing is available

Index: cairo_gl_surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_gl_surface.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** a/cairo_gl_surface.c	25 Apr 2004 12:11:07 -0000	1.4
--- b/cairo_gl_surface.c	28 Apr 2004 09:14:23 -0000	1.5
***************
*** 72,75 ****
--- 72,78 ----
  };
  
+ #define CAIRO_GL_MULTITEXTURE_SUPPORT(surface) \
+     (surface->features & GLITZ_FEATURE_ARB_MULTITEXTURE_MASK)
+ 
  #define CAIRO_GL_OFFSCREEN_SUPPORT(surface) \
      (surface->features & GLITZ_FEATURE_OFFSCREEN_DRAWING_MASK)
***************
*** 95,98 ****
--- 98,105 ----
      (surface->hints & GLITZ_HINT_OFFSCREEN_MASK)
  
+ #define CAIRO_GL_SURFACE_IS_SOLID(surface) \
+     ((surface->hints & GLITZ_HINT_PROGRAMMATIC_MASK) && \
+      (surface->pattern.type == CAIRO_PATTERN_SOLID))
+ 
  static void
  _cairo_gl_surface_destroy (void *abstract_surface)
***************
*** 131,136 ****
      height = glitz_surface_get_height (surface->surface);
  
!     rowstride = width * (surface->format->bpp / 8);
!     rowstride += (rowstride % 4) ? (4 - (rowstride % 4)) : 0;
  
      pixels = (char *) malloc (sizeof (char) * height * rowstride);
--- 138,142 ----
      height = glitz_surface_get_height (surface->surface);
  
!     rowstride = (width * (surface->format->bpp / 8) + 3) & -4;
  
      pixels = (char *) malloc (sizeof (char) * height * rowstride);
***************
*** 393,400 ****
  	return CAIRO_INT_STATUS_UNSUPPORTED;
  
!     /* Fragment program or offscreen drawing required for composite with
!        mask. */
      if (mask &&
! 	(!CAIRO_GL_FRAGMENT_PROGRAM_SUPPORT (dst)) &&
  	(!CAIRO_GL_OFFSCREEN_SUPPORT (dst)))
  	return CAIRO_INT_STATUS_UNSUPPORTED;
--- 399,407 ----
  	return CAIRO_INT_STATUS_UNSUPPORTED;
  
!     /* We need multi-texturing or offscreen drawing when compositing with
!        non-solid mask. */
      if (mask &&
! 	(!CAIRO_GL_SURFACE_IS_SOLID (mask)) &&
! 	(!CAIRO_GL_MULTITEXTURE_SUPPORT (dst)) &&
  	(!CAIRO_GL_OFFSCREEN_SUPPORT (dst)))
  	return CAIRO_INT_STATUS_UNSUPPORTED;





More information about the cairo-commit mailing list