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

David Reveman commit at pdx.freedesktop.org
Sun Sep 12 15:34:02 PDT 2004


Committed by: davidr

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

Modified Files:
	cairo_glitz_surface.c 
Log Message:
Get pixel masks from pixman image format

Index: cairo_glitz_surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_glitz_surface.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** cairo_glitz_surface.c	12 Sep 2004 12:09:32 -0000	1.4
--- cairo_glitz_surface.c	12 Sep 2004 22:34:00 -0000	1.5
***************
*** 192,213 ****
      glitz_buffer_t *buffer;
      glitz_pixel_format_t pf;
  
!     if (image->depth > 8) {
! 	pf.masks.bpp = 32;
! 	
! 	if (surface->format->alpha_size)
! 	    pf.masks.alpha_mask = 0xff000000;
! 	else
! 	    pf.masks.alpha_mask = 0x0;
! 	
! 	pf.masks.red_mask = 0xff0000;
! 	pf.masks.green_mask = 0xff00;
! 	pf.masks.blue_mask = 0xff;
!     } else {
! 	pf.masks.bpp = 8;
! 	pf.masks.alpha_mask = 0xff;
! 	pf.masks.red_mask = pf.masks.green_mask = pf.masks.blue_mask = 0x0;
!     }
  
      pf.xoffset = 0;
      pf.skip_lines = 0;
--- 192,208 ----
      glitz_buffer_t *buffer;
      glitz_pixel_format_t pf;
+     pixman_format_t *format;
+     int am, rm, gm, bm;
+     
+     format = pixman_image_get_format (image->pixman_image);
+     if (format == NULL)
+ 	return CAIRO_STATUS_NO_MEMORY;
  
!     pixman_format_get_masks (format, &pf.masks.bpp, &am, &rm, &gm, &bm);
  
+     pf.masks.alpha_mask = am;
+     pf.masks.red_mask = rm;
+     pf.masks.green_mask = gm;
+     pf.masks.blue_mask = bm;
      pf.xoffset = 0;
      pf.skip_lines = 0;




More information about the cairo-commit mailing list