Skip to content

Commit

Permalink
Add more diagnostics to try to figure out what is causing Togl/Chimera
Browse files Browse the repository at this point in the history
problems, beyond the CGL display list incompatibilities.

git-svn-id: https://svn.macosforge.org/repository/xquartz/AppleSGLX/trunk@271 9052f27e-8171-453d-b9bb-b0e8541e09c8
  • Loading branch information
George Staplin committed Feb 27, 2009
1 parent 9f95a86 commit ccc9604
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
26 changes: 23 additions & 3 deletions apple_glx_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,13 @@ bool apple_glx_create_context(void **ptr, Display *dpy, int screen,
ac->next = context_list;
context_list = ac;

unlock_context_list();

*ptr = ac;

apple_glx_diagnostic("%s: ac %p ac->context_obj %p\n",
__func__, (void *)ac, (void *)ac->context_obj);

unlock_context_list();

return false;
}

Expand All @@ -193,7 +196,13 @@ void apple_glx_destroy_context(void **ptr, Display *dpy) {
if(NULL == ac)
return;

apple_glx_diagnostic("%s: ac %p ac->context_obj %p\n",
__func__, (void *)ac, (void *)ac->context_obj);

if(apple_cgl.get_current_context() == ac->context_obj) {
apple_glx_diagnostic("%s: context ac->context_obj %p "
"is still current!\n", __func__,
(void *)ac->context_obj);
if(apple_cgl.set_current_context(NULL)) {
abort();
}
Expand Down Expand Up @@ -258,6 +267,15 @@ bool apple_glx_make_current_context(Display *dpy, void *oldptr, void *ptr,
CGLError cglerr;
bool same_drawable = false;

apple_glx_diagnostic("%s: oldac %p ac %p drawable 0x%lx\n",
__func__, (void *)oldac, (void *)ac,
drawable);

apple_glx_diagnostic("%s: oldac->context_obj %p ac->context_obj %p\n",
__func__,
(void *)(oldac ? oldac->context_obj : NULL),
(void *)(ac ? ac->context_obj : NULL));

assert(NULL != dpy);

/* Reset the is_current state of the old context, if non-NULL. */
Expand Down Expand Up @@ -341,8 +359,10 @@ bool apple_glx_make_current_context(Display *dpy, void *oldptr, void *ptr,
* context is already current.
*/

if(same_drawable && ac->is_current)
if(same_drawable && ac->is_current) {
apple_glx_diagnostic("%s: same_drawable and ac->is_current\n");
return false;
}

cglerr = apple_cgl.set_current_context(ac->context_obj);

Expand Down
3 changes: 3 additions & 0 deletions apple_glx_surface.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ static bool surface_make_current(struct apple_glx_context *ac,

assert(APPLE_GLX_DRAWABLE_SURFACE == d->type);

apple_glx_diagnostic("%s: ac->context_obj %p s->surface_id %u\n",
__func__, (void *)ac->context_obj, s->surface_id);

error = xp_attach_gl_context(ac->context_obj, s->surface_id);

if(error) {
Expand Down

0 comments on commit ccc9604

Please sign in to comment.