[cairo-commit] gtkcairo/gtkcairo gdkcairo.c, 1.4, 1.5 gdkcairo.h, 1.6, 1.7

OEyvind Kolaas commit at pdx.freedesktop.org
Tue Sep 21 09:53:46 PDT 2004


Committed by: pippin

Update of /cvs/cairo/gtkcairo/gtkcairo
In directory gabe:/tmp/cvs-serv24896/gtkcairo

Modified Files:
	gdkcairo.c gdkcairo.h 
Log Message:
integrating changes from david reveman to get in sync with glitz


Index: gdkcairo.c
===================================================================
RCS file: /cvs/cairo/gtkcairo/gtkcairo/gdkcairo.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** gdkcairo.c	9 Aug 2004 16:32:40 -0000	1.4
--- gdkcairo.c	21 Sep 2004 16:53:44 -0000	1.5
***************
*** 141,151 ****
              XVisualInfo *vinfo;
  	        glitz_format_t *onscreen_format;
  
! 	        onscreen_format = glitz_glx_find_standard_format (dpy, screen,
! 			    GLITZ_FORMAT_OPTION_ONSCREEN_MASK, GLITZ_STANDARD_ARGB32);
! 	        if (!onscreen_format)
! 	             onscreen_format = glitz_glx_find_standard_format (dpy, screen,
! 	             GLITZ_FORMAT_OPTION_ONSCREEN_MASK, GLITZ_STANDARD_RGB24);
!             
  	        /*  XSetWindowAttributes xswa;*/
  
--- 141,165 ----
              XVisualInfo *vinfo;
  	        glitz_format_t *onscreen_format;
+ 		glitz_format_t templ;
+ 		unsigned long mask;
  
! 		templ.doublebuffer = 1;
! 		mask = GLITZ_FORMAT_DOUBLEBUFFER_MASK;
! 
! 		templ.draw.onscreen = 1;
! 		mask |= GLITZ_FORMAT_DRAW_ONSCREEN_MASK;
! 
! 		templ.multisample.samples = 4;
! 		mask |= GLITZ_FORMAT_MULTISAMPLE_SAMPLES_MASK;
! 
! 	        onscreen_format =
! 		    glitz_glx_find_format (dpy, screen, mask, &templ, 0);
! 	        if (!onscreen_format) {
! 		    mask &= ~GLITZ_FORMAT_MULTISAMPLE_SAMPLES_MASK;
! 		
! 		    onscreen_format =
! 			glitz_glx_find_format (dpy, screen, mask, &templ, 0);
! 		}
! 		
  	        /*  XSetWindowAttributes xswa;*/
  
***************
*** 162,169 ****
                  self->glitz_surface =
                  glitz_glx_surface_create_for_window (dpy, screen,
! 					  onscreen_format,
! 					  gdk_x11_drawable_get_xid (widget->window));
  
!               cairo_set_target_gl (self->cr, self->glitz_surface);
              } else {
              g_error ("could not find a usable GL visual\n");
--- 176,185 ----
                  self->glitz_surface =
                  glitz_glx_surface_create_for_window (dpy, screen,
! 						     onscreen_format,
! 						     gdk_x11_drawable_get_xid (widget->window),
! 						     attributes.width,
! 						     attributes.height);
  
!               cairo_set_target_glitz (self->cr, self->glitz_surface);
              } else {
              g_error ("could not find a usable GL visual\n");
***************
*** 201,206 ****
             case GDKCAIRO_BACKEND_GL:
              if (self->glitz_surface) {
! 				glitz_surface_update_size (self->glitz_surface);
              }
              break;
           #endif
--- 217,236 ----
             case GDKCAIRO_BACKEND_GL:
              if (self->glitz_surface) {
! 		glitz_format_t *format;
! 
! 		format = glitz_surface_get_format (self->glitz_surface);
! 		
! 		glitz_surface_destroy (self->glitz_surface);
! 		
! 		self->glitz_surface =
! 		    glitz_glx_surface_create_for_window (gdk_x11_get_default_xdisplay (),
! 							 gdk_x11_get_default_screen (),
! 							 format,
! 							 gdk_x11_drawable_get_xid (self->widget->window),
! 							 width,
! 							 height);
! 		cairo_set_target_glitz (self->cr, self->glitz_surface);
              }
+ 	    
              break;
           #endif

Index: gdkcairo.h
===================================================================
RCS file: /cvs/cairo/gtkcairo/gtkcairo/gdkcairo.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** gdkcairo.h	9 Aug 2004 16:32:40 -0000	1.6
--- gdkcairo.h	21 Sep 2004 16:53:44 -0000	1.7
***************
*** 26,30 ****
  
  #ifdef USE_GL
!     #ifndef CAIRO_HAS_GL_SURFACE
          #undef USE_GL
      #endif
--- 26,30 ----
  
  #ifdef USE_GL
!     #ifndef CAIRO_HAS_GLITZ_SURFACE
          #undef USE_GL
      #endif




More information about the cairo-commit mailing list