[cairo-commit] cairo/src cairo_glitz_surface.c,1.6,1.7

David Reveman commit at pdx.freedesktop.org
Sun Sep 19 22:11:07 PDT 2004


Committed by: davidr

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv17076/src

Modified Files:
	cairo_glitz_surface.c 
Log Message:
Important fixes to glitz format handling

Index: cairo_glitz_surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_glitz_surface.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** cairo_glitz_surface.c	15 Sep 2004 16:55:40 -0000	1.6
--- cairo_glitz_surface.c	20 Sep 2004 05:11:04 -0000	1.7
***************
*** 370,382 ****
      glitz_format_t templ;
      unsigned long mask;
! 
!     mask = GLITZ_FORMAT_DRAW_OFFSCREEN_MASK;
      if (drawable) {
  	templ.draw.offscreen = 1;
! 	templ.multisample.samples = src->format->multisample.samples;
! 	mask |= GLITZ_FORMAT_MULTISAMPLE_SAMPLES_MASK;
      } else
  	templ.draw.offscreen = 0;
  
      switch (format) {
      case CAIRO_FORMAT_A1:
--- 370,388 ----
      glitz_format_t templ;
      unsigned long mask;
!     
!     templ.read.offscreen = 1;
!     mask = GLITZ_FORMAT_READ_OFFSCREEN_MASK;
!     
      if (drawable) {
  	templ.draw.offscreen = 1;
! 	if (src->features & GLITZ_FEATURE_OFFSCREEN_MULTISAMPLE_MASK) {
! 	    templ.multisample.samples = src->format->multisample.samples;
! 	    mask |= GLITZ_FORMAT_MULTISAMPLE_SAMPLES_MASK;
! 	}
      } else
  	templ.draw.offscreen = 0;
  
+     mask |= GLITZ_FORMAT_DRAW_OFFSCREEN_MASK;
+ 
      switch (format) {
      case CAIRO_FORMAT_A1:
***************
*** 399,405 ****
      glitz_format =
  	glitz_surface_find_similar_format (src->surface, mask, &templ, 0);
!     if (glitz_format == NULL)
! 	return NULL;
!     
      surface = glitz_surface_create_similar (src->surface, glitz_format,
  					    width, height);
--- 405,416 ----
      glitz_format =
  	glitz_surface_find_similar_format (src->surface, mask, &templ, 0);
!     if (glitz_format == NULL) {
! 	mask &= ~GLITZ_FORMAT_DRAW_OFFSCREEN_MASK;
! 	glitz_format =
! 	    glitz_surface_find_similar_format (src->surface, mask, &templ, 0);
! 	if (glitz_format == NULL)
! 	    return NULL;
!     }
! 
      surface = glitz_surface_create_similar (src->surface, glitz_format,
  					    width, height);
***************
*** 514,518 ****
      if (generic_mask && (generic_mask->backend != dst->base.backend)) {
  	mask_clone = _cairo_glitz_surface_clone_similar (dst, generic_mask,
! 							 CAIRO_FORMAT_ARGB32);
  	if (!mask_clone)
  	    return CAIRO_INT_STATUS_UNSUPPORTED;
--- 525,529 ----
      if (generic_mask && (generic_mask->backend != dst->base.backend)) {
  	mask_clone = _cairo_glitz_surface_clone_similar (dst, generic_mask,
! 							 CAIRO_FORMAT_A8);
  	if (!mask_clone)
  	    return CAIRO_INT_STATUS_UNSUPPORTED;
***************
*** 747,751 ****
      case CAIRO_PATTERN_SOLID:
  	generic_src =
! 	    _cairo_surface_create_similar_solid (&dst->base,
  						 CAIRO_FORMAT_ARGB32,
  						 1, 1,
--- 758,762 ----
      case CAIRO_PATTERN_SOLID:
  	generic_src =
! 	    _cairo_surface_create_similar_solid (abstract_dst,
  						 CAIRO_FORMAT_ARGB32,
  						 1, 1,




More information about the cairo-commit mailing list