[cairo-commit] glitz/src glitz_glx_context.c, 1.15, 1.16 glitz_glx_info.c, 1.20, 1.21 glitz_glx_pbuffer.c, 1.3, 1.4 glitz_glx_surface.c, 1.20, 1.21 glitz_glxext.h, 1.6, 1.7 glitz_glxint.h, 1.16, 1.17

David Reveman commit at pdx.freedesktop.org
Tue Sep 21 05:01:28 PDT 2004


Committed by: davidr

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

Modified Files:
	glitz_glx_context.c glitz_glx_info.c glitz_glx_pbuffer.c 
	glitz_glx_surface.c glitz_glxext.h glitz_glxint.h 
Log Message:
Fixed so that pbuffer formats that dont have any matching visual works

Index: glitz_glx_context.c
===================================================================
RCS file: /cvs/cairo/glitz/src/glitz_glx_context.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** glitz_glx_context.c	20 Sep 2004 04:59:34 -0000	1.15
--- glitz_glx_context.c	21 Sep 2004 12:01:25 -0000	1.16
***************
*** 53,57 ****
  
    context->context = glXCreateContext (screen_info->display_info->display,
!                                        &vis_infos[i], share_list, 1);
    context->id = visualid;  
    context->fbconfig = (XID) 0;
--- 53,58 ----
  
    context->context = glXCreateContext (screen_info->display_info->display,
!                                        &vis_infos[i], share_list,
!                                        GLITZ_GL_TRUE);
    context->id = visualid;  
    context->fbconfig = (XID) 0;
***************
*** 86,101 ****
      vinfo = glx->get_visual_from_fbconfig (screen_info->display_info->display,
                                             fbconfigs[i]);
!   
    if (vinfo) {
      context->context = glXCreateContext (screen_info->display_info->display,
!                                          vinfo, share_list, 1);
!     context->id = fbconfigid;
!     context->fbconfig = fbconfigs[i];
      XFree (vinfo);
!   } else {
!     context->context = NULL;
!     context->id = fbconfigid;
      context->fbconfig = NULL;
-   }
  
    if (fbconfigs)
--- 87,106 ----
      vinfo = glx->get_visual_from_fbconfig (screen_info->display_info->display,
                                             fbconfigs[i]);
! 
!   context->id = fbconfigid;
    if (vinfo) {
      context->context = glXCreateContext (screen_info->display_info->display,
!                                          vinfo, share_list, GLITZ_GL_TRUE);
      XFree (vinfo);
!   } else if (glx->create_new_context)
!     context->context =
!       glx->create_new_context (screen_info->display_info->display,
!                                fbconfigs[i], GLX_RGBA_TYPE, share_list,
!                                GLITZ_GL_TRUE);
!   
!   if (context->context)
!     context->fbconfig = fbconfigs[i];
!   else
      context->fbconfig = NULL;
  
    if (fbconfigs)
***************
*** 336,342 ****
  void
  glitz_glx_context_make_current (glitz_glx_surface_t *surface,
                                  glitz_bool_t flush)
  {
-   GLXContext context;
    Drawable drawable;
  
--- 341,347 ----
  void
  glitz_glx_context_make_current (glitz_glx_surface_t *surface,
+                                 GLXContext context,
                                  glitz_bool_t flush)
  {
    Drawable drawable;
  
***************
*** 348,352 ****
      context = surface->screen_info->root_context.context;
    } else {
-     context = surface->context->context;
      drawable = surface->drawable;
      surface->base.update_mask |= GLITZ_UPDATE_ALL_MASK;
--- 353,356 ----
***************
*** 366,369 ****
--- 370,379 ----
  {
    GLXContext context = glXGetCurrentContext ();
+   GLXContext newcontext;
+ 
+   if (surface->context->context)
+     newcontext = surface->context->context;
+   else
+     newcontext = surface->screen_info->root_context.context;
    
    switch (constraint) {
***************
*** 372,385 ****
    case GLITZ_CN_ANY_CONTEXT_CURRENT:
      if (context == NULL)
!       glitz_glx_context_make_current (surface, 0);
      break;
    case GLITZ_CN_SURFACE_CONTEXT_CURRENT:
!     if (context != surface->context->context)
!       glitz_glx_context_make_current (surface, (context)? 1: 0);
      break;
    case GLITZ_CN_SURFACE_DRAWABLE_CURRENT:
!     if ((context != surface->context->context) ||
          (glXGetCurrentDrawable () != surface->drawable))
!       glitz_glx_context_make_current (surface, (context)? 1: 0);
      break;
    }
--- 382,395 ----
    case GLITZ_CN_ANY_CONTEXT_CURRENT:
      if (context == NULL)
!       glitz_glx_context_make_current (surface, newcontext, 0);
      break;
    case GLITZ_CN_SURFACE_CONTEXT_CURRENT:
!     if (context != newcontext)
!       glitz_glx_context_make_current (surface, newcontext, (context)? 1: 0);
      break;
    case GLITZ_CN_SURFACE_DRAWABLE_CURRENT:
!     if ((context != newcontext) ||
          (glXGetCurrentDrawable () != surface->drawable))
!       glitz_glx_context_make_current (surface, newcontext, (context)? 1: 0);
      break;
    }

Index: glitz_glx_info.c
===================================================================
RCS file: /cvs/cairo/glitz/src/glitz_glx_info.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** glitz_glx_info.c	20 Sep 2004 04:59:34 -0000	1.20
--- glitz_glx_info.c	21 Sep 2004 12:01:25 -0000	1.21
***************
*** 151,154 ****
--- 151,156 ----
    info->glx.make_context_current = (glitz_glx_make_context_current_t)
      glitz_glx_get_proc_address (info, "glXMakeContextCurrent");
+   info->glx.create_new_context = (glitz_glx_create_new_context_t)
+     glitz_glx_get_proc_address (info, "glXCreateNewContext");
    info->glx.get_proc_address = (glitz_glx_get_proc_address_t)
      glitz_glx_get_proc_address (info, "glXGetProcAddressARB");

Index: glitz_glx_pbuffer.c
===================================================================
RCS file: /cvs/cairo/glitz/src/glitz_glx_pbuffer.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** glitz_glx_pbuffer.c	9 May 2004 20:54:51 -0000	1.3
--- glitz_glx_pbuffer.c	21 Sep 2004 12:01:25 -0000	1.4
***************
*** 37,55 ****
                            glitz_texture_t *texture)
  {
!   int pbuffer_attr[13], i = 0;
  
!   pbuffer_attr[i++] = GLX_PBUFFER_WIDTH;
!   pbuffer_attr[i++] = texture->width;
!   pbuffer_attr[i++] = GLX_PBUFFER_HEIGHT;
!   pbuffer_attr[i++] = texture->height;
!   pbuffer_attr[i++] = GLX_PRESERVED_CONTENTS;
!   pbuffer_attr[i++] = 1;
!   pbuffer_attr[i++] = GLX_LARGEST_PBUFFER;
!   pbuffer_attr[i++] = 0;
!   pbuffer_attr[i++] = 0;
!     
!   return
!     display_info->thread_info->glx.create_pbuffer (display_info->display,
!                                                    fbconfig, pbuffer_attr);
  }
  
--- 37,58 ----
                            glitz_texture_t *texture)
  {
!   if (fbconfig) {
!     int pbuffer_attr[13], i = 0;
  
!     pbuffer_attr[i++] = GLX_PBUFFER_WIDTH;
!     pbuffer_attr[i++] = texture->width;
!     pbuffer_attr[i++] = GLX_PBUFFER_HEIGHT;
!     pbuffer_attr[i++] = texture->height;
!     pbuffer_attr[i++] = GLX_PRESERVED_CONTENTS;
!     pbuffer_attr[i++] = 1;
!     pbuffer_attr[i++] = GLX_LARGEST_PBUFFER;
!     pbuffer_attr[i++] = 0;
!     pbuffer_attr[i++] = 0;
!   
!     return
!       display_info->thread_info->glx.create_pbuffer (display_info->display,
!                                                      fbconfig, pbuffer_attr);
!   } else
!     return (GLXPbuffer) 0;
  }
  

Index: glitz_glx_surface.c
===================================================================
RCS file: /cvs/cairo/glitz/src/glitz_glx_surface.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** glitz_glx_surface.c	6 Sep 2004 22:52:03 -0000	1.20
--- glitz_glx_surface.c	21 Sep 2004 12:01:25 -0000	1.21
***************
*** 257,261 ****
        (glXGetCurrentDrawable () == surface->drawable)) {
      surface->drawable = None;
!     glitz_glx_context_make_current (surface, 0);
    }
  
--- 257,261 ----
        (glXGetCurrentDrawable () == surface->drawable)) {
      surface->drawable = None;
!     glitz_glx_context_make_current (surface, (GLXContext) 0, 0);
    }
  

Index: glitz_glxext.h
===================================================================
RCS file: /cvs/cairo/glitz/src/glitz_glxext.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** glitz_glxext.h	20 Jul 2004 07:51:14 -0000	1.6
--- glitz_glxext.h	21 Sep 2004 12:01:25 -0000	1.7
***************
*** 109,112 ****
--- 109,115 ----
  typedef Bool (* glitz_glx_make_context_current_t)
       (Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+ typedef GLXContext (* glitz_glx_create_new_context_t)
+      (Display *display, GLXFBConfig config, int render_type,
+       GLXContext share_list, Bool direct);
  
  #ifndef GLX_ARB_multisample

Index: glitz_glxint.h
===================================================================
RCS file: /cvs/cairo/glitz/src/glitz_glxint.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** glitz_glxint.h	7 Sep 2004 14:28:21 -0000	1.16
--- glitz_glxint.h	21 Sep 2004 12:01:25 -0000	1.17
***************
*** 65,68 ****
--- 65,69 ----
    glitz_glx_destroy_pbuffer_t destroy_pbuffer;
    glitz_glx_make_context_current_t make_context_current;
+   glitz_glx_create_new_context_t create_new_context;
    glitz_bool_t need_lookup;
  } glitz_glx_static_proc_address_list_t;
***************
*** 156,159 ****
--- 157,161 ----
  extern void __internal_linkage
  glitz_glx_context_make_current (glitz_glx_surface_t *surface,
+                                 GLXContext context,
                                  glitz_bool_t flush);
  




More information about the cairo-commit mailing list