[cairo-commit] cairo/src cairo_gl_surface.c,1.11,1.12

David Reveman commit at pdx.freedesktop.org
Tue Jul 20 01:39:25 PDT 2004


Committed by: davidr

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

Modified Files:
	cairo_gl_surface.c 
Log Message:
Tracking changes to glitz

Index: cairo_gl_surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_gl_surface.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** cairo_gl_surface.c	21 Jun 2004 22:13:52 -0000	1.11
--- cairo_gl_surface.c	20 Jul 2004 08:39:23 -0000	1.12
***************
*** 95,100 ****
          ((surface->hints & GLITZ_HINT_CLIPPING_MASK)? 2: 1))
  
! #define CAIRO_GL_SURFACE_IS_OFFSCREEN(surface) \
!     (surface->hints & GLITZ_HINT_OFFSCREEN_MASK)
  
  #define CAIRO_GL_SURFACE_IS_SOLID(surface) \
--- 95,101 ----
          ((surface->hints & GLITZ_HINT_CLIPPING_MASK)? 2: 1))
  
! #define CAIRO_GL_SURFACE_IS_DRAWABLE(surface) \
!     ((surface->hints & GLITZ_HINT_OFFSCREEN_MASK)? \
!         surface->format->draw.offscreen: surface->format->draw.onscreen)
  
  #define CAIRO_GL_SURFACE_IS_SOLID(surface) \
***************
*** 133,136 ****
--- 134,138 ----
      int rowstride;
      cairo_format_masks_t format;
+     glitz_pixel_buffer_t *buffer;
      glitz_pixel_format_t pf;
  
***************
*** 167,170 ****
--- 169,173 ----
      pf.masks.blue_mask = format.blue_mask;
      pf.xoffset = 0;
+     pf.skip_lines = 0;
      pf.bytes_per_line = rowstride;
      pf.scanline_order = GLITZ_PIXEL_SCANLINE_ORDER_TOP_DOWN;
***************
*** 173,182 ****
      if (!pixels)
  	return NULL;
      
      glitz_get_pixels (surface->surface,
  		      0, 0,
  		      width, height,
! 		      &pf,
! 		      pixels);
      
      image = (cairo_image_surface_t *)
--- 176,192 ----
      if (!pixels)
  	return NULL;
+ 
+     buffer = glitz_pixel_buffer_create_for_data (pixels, &pf);
+     if (!buffer) {
+ 	free (pixels);
+ 	return NULL;
+     }
      
      glitz_get_pixels (surface->surface,
  		      0, 0,
  		      width, height,
! 		      buffer);
! 
!     glitz_pixel_buffer_destroy (buffer);
      
      image = (cairo_image_surface_t *)
***************
*** 198,201 ****
--- 208,212 ----
  {
      cairo_gl_surface_t *surface = abstract_surface;
+     glitz_pixel_buffer_t *buffer;
      glitz_pixel_format_t pf;
  
***************
*** 218,229 ****
  
      pf.xoffset = 0;
      pf.bytes_per_line = (((image->width * pf.masks.bpp) / 8) + 3) & -4;
      pf.scanline_order = GLITZ_PIXEL_SCANLINE_ORDER_TOP_DOWN;
  
      glitz_put_pixels (surface->surface,
  		      0, 0,
  		      image->width, image->height,
! 		      &pf,
! 		      image->data);
      
      return CAIRO_STATUS_SUCCESS;
--- 229,246 ----
  
      pf.xoffset = 0;
+     pf.skip_lines = 0;
      pf.bytes_per_line = (((image->width * pf.masks.bpp) / 8) + 3) & -4;
      pf.scanline_order = GLITZ_PIXEL_SCANLINE_ORDER_TOP_DOWN;
  
+     buffer = glitz_pixel_buffer_create_for_data (image->data, &pf);
+     if (!buffer)
+ 	return CAIRO_STATUS_NO_MEMORY;
+ 
      glitz_put_pixels (surface->surface,
  		      0, 0,
  		      image->width, image->height,
! 		      buffer);
! 
!     glitz_pixel_buffer_destroy (buffer);
      
      return CAIRO_STATUS_SUCCESS;
***************
*** 259,272 ****
  _cairo_gl_surface_set_filter (void *abstract_surface, cairo_filter_t filter)
  {
-     static glitz_convolution_t gaussian = {
-         {
-             { 0, 1 << 16, 0 },
-             { 1 << 16, 4 << 16, 1 << 16 },
-             { 0, 1 << 16, 0 }
-         }
-     };
      cairo_gl_surface_t *surface = abstract_surface;
      glitz_filter_t gl_filter;
-     glitz_convolution_t *convolution = NULL;
  
      if (!surface->surface)
--- 276,281 ----
***************
*** 286,293 ****
  	gl_filter = GLITZ_FILTER_NEAREST;
  	break;
-     case CAIRO_FILTER_GAUSSIAN:
- 	if (CAIRO_GL_CONVOLUTION_SUPPORT (surface))
- 	    convolution = &gaussian;
- 	/* fall-through */
      case CAIRO_FILTER_BILINEAR:
  	gl_filter = GLITZ_FILTER_BILINEAR;
--- 295,298 ----
***************
*** 298,302 ****
  
      glitz_surface_set_filter (surface->surface, gl_filter);
-     glitz_surface_set_convolution (surface->surface, convolution);
  
      return CAIRO_STATUS_SUCCESS;
--- 303,306 ----
***************
*** 475,482 ****
  	return CAIRO_STATUS_NO_TARGET_SURFACE;
  
!     /* If destination surface is offscreen, then offscreen drawing support is
!        required. */
!     if (CAIRO_GL_SURFACE_IS_OFFSCREEN (dst) &&
! 	(!CAIRO_GL_OFFSCREEN_SUPPORT (dst)))
  	return CAIRO_INT_STATUS_UNSUPPORTED;
  
--- 479,484 ----
  	return CAIRO_STATUS_NO_TARGET_SURFACE;
  
!     /* Make sure target surface is drawable */
!     if (!CAIRO_GL_SURFACE_IS_DRAWABLE (dst))
  	return CAIRO_INT_STATUS_UNSUPPORTED;
  
***************
*** 538,545 ****
  	return CAIRO_STATUS_NO_TARGET_SURFACE;
  
!     /* If destination surface is offscreen, then offscreen drawing support is
!        required. */
!     if (CAIRO_GL_SURFACE_IS_OFFSCREEN (surface) &&
! 	(!CAIRO_GL_OFFSCREEN_SUPPORT (surface)))
  	return CAIRO_INT_STATUS_UNSUPPORTED;
  
--- 540,545 ----
  	return CAIRO_STATUS_NO_TARGET_SURFACE;
  
!     /* Make sure target surface is drawable */
!     if (!CAIRO_GL_SURFACE_IS_DRAWABLE (surface))
  	return CAIRO_INT_STATUS_UNSUPPORTED;
  
***************
*** 625,632 ****
  	return CAIRO_STATUS_NO_TARGET_SURFACE;
  
!     /* If destination surface is offscreen, then offscreen drawing support is
!        required. */
!     if (CAIRO_GL_SURFACE_IS_OFFSCREEN (dst) &&
! 	(!CAIRO_GL_OFFSCREEN_SUPPORT (dst)))
  	return CAIRO_INT_STATUS_UNSUPPORTED;
  
--- 625,630 ----
  	return CAIRO_STATUS_NO_TARGET_SURFACE;
  
!     /* Make sure target surface is drawable */
!     if (!CAIRO_GL_SURFACE_IS_DRAWABLE (dst))
  	return CAIRO_INT_STATUS_UNSUPPORTED;
  
***************
*** 655,661 ****
      }
  
-     if (!CAIRO_GL_COMPOSITE_TRAPEZOIDS_SUPPORT (dst))
- 	return CAIRO_INT_STATUS_UNSUPPORTED;
- 
      if (generic_src->backend != dst->base.backend) {
  	src_clone = _cairo_gl_surface_clone_similar (generic_src, dst,
--- 653,656 ----
***************
*** 764,768 ****
  	    return CAIRO_INT_STATUS_UNSUPPORTED;
  	
! 	color_range = glitz_color_range_create (color_range_size);
  	if (!color_range)
  	    return CAIRO_STATUS_NO_MEMORY;
--- 759,764 ----
  	    return CAIRO_INT_STATUS_UNSUPPORTED;
  	
! 	color_range = glitz_color_range_create (surface->surface,
! 						color_range_size);
  	if (!color_range)
  	    return CAIRO_STATUS_NO_MEMORY;




More information about the cairo-commit mailing list