• Home
  • Raw
  • Download

Lines Matching refs:ac

101 is_context_valid(struct apple_glx_context *ac)  in is_context_valid()  argument
108 if (ac == i) { in is_context_valid()
130 struct apple_glx_context *ac; in apple_glx_create_context() local
136 ac = malloc(sizeof *ac); in apple_glx_create_context()
138 if (NULL == ac) { in apple_glx_create_context()
147 free(ac); in apple_glx_create_context()
151 ac->context_obj = NULL; in apple_glx_create_context()
152 ac->pixel_format_obj = NULL; in apple_glx_create_context()
153 ac->drawable = NULL; in apple_glx_create_context()
154 ac->thread_id = pthread_self(); in apple_glx_create_context()
155 ac->screen = screen; in apple_glx_create_context()
156 ac->double_buffered = false; in apple_glx_create_context()
157 ac->uses_stereo = false; in apple_glx_create_context()
158 ac->need_update = false; in apple_glx_create_context()
159 ac->is_current = false; in apple_glx_create_context()
160 ac->made_current = false; in apple_glx_create_context()
161 ac->last_surface_window = None; in apple_glx_create_context()
163 apple_visual_create_pfobj(&ac->pixel_format_obj, mode, in apple_glx_create_context()
164 &ac->double_buffered, &ac->uses_stereo, in apple_glx_create_context()
167 error = apple_cgl.create_context(ac->pixel_format_obj, in apple_glx_create_context()
169 &ac->context_obj); in apple_glx_create_context()
173 (void) apple_cgl.destroy_pixel_format(ac->pixel_format_obj); in apple_glx_create_context()
175 free(ac); in apple_glx_create_context()
196 context_list->previous = ac; in apple_glx_create_context()
198 ac->previous = NULL; in apple_glx_create_context()
199 ac->next = context_list; in apple_glx_create_context()
200 context_list = ac; in apple_glx_create_context()
202 *ptr = ac; in apple_glx_create_context()
205 __func__, (void *) ac, (void *) ac->context_obj); in apple_glx_create_context()
215 struct apple_glx_context *ac = *ptr; in apple_glx_destroy_context() local
217 if (NULL == ac) in apple_glx_destroy_context()
221 __func__, (void *) ac, (void *) ac->context_obj); in apple_glx_destroy_context()
223 if (apple_cgl.get_current_context() == ac->context_obj) { in apple_glx_destroy_context()
226 (void *) ac->context_obj); in apple_glx_destroy_context()
235 if (ac->previous) { in apple_glx_destroy_context()
236 ac->previous->next = ac->next; in apple_glx_destroy_context()
239 context_list = ac->next; in apple_glx_destroy_context()
242 if (ac->next) { in apple_glx_destroy_context()
243 ac->next->previous = ac->previous; in apple_glx_destroy_context()
249 if (apple_cgl.clear_drawable(ac->context_obj)) { in apple_glx_destroy_context()
261 if (ac->drawable) { in apple_glx_destroy_context()
262 ac->drawable->destroy(ac->drawable); in apple_glx_destroy_context()
265 if (apple_cgl.destroy_pixel_format(ac->pixel_format_obj)) { in apple_glx_destroy_context()
270 if (apple_cgl.destroy_context(ac->context_obj)) { in apple_glx_destroy_context()
275 free(ac); in apple_glx_destroy_context()
289 struct apple_glx_context *ac = ptr; in apple_glx_make_current_context() local
296 __func__, (void *) oldac, (void *) ac, drawable); in apple_glx_make_current_context()
301 (void *) (ac ? ac->context_obj : NULL)); in apple_glx_make_current_context()
305 if (ac && ac->drawable && ac->drawable->drawable == drawable) { in apple_glx_make_current_context()
308 if (ac->is_current) in apple_glx_make_current_context()
313 if (oldac && (ac != oldac)) in apple_glx_make_current_context()
316 if (NULL == ac) { in apple_glx_make_current_context()
340 if (apple_cgl.set_current_context(ac->context_obj)) in apple_glx_make_current_context()
343 if (apple_cgl.clear_drawable(ac->context_obj)) in apple_glx_make_current_context()
346 if (ac->drawable) { in apple_glx_make_current_context()
347 ac->drawable->destroy(ac->drawable); in apple_glx_make_current_context()
348 ac->drawable = NULL; in apple_glx_make_current_context()
352 ac->last_surface_window = None; in apple_glx_make_current_context()
361 if (ac->drawable && ac->drawable->drawable == drawable) { in apple_glx_make_current_context()
362 newagd = ac->drawable; in apple_glx_make_current_context()
374 if (ac->drawable && !same_drawable) { in apple_glx_make_current_context()
375 ac->drawable->destroy(ac->drawable); in apple_glx_make_current_context()
376 ac->drawable = NULL; in apple_glx_make_current_context()
380 if (apple_glx_surface_create(dpy, ac->screen, drawable, &newagd)) in apple_glx_make_current_context()
407 ac->drawable = newagd; in apple_glx_make_current_context()
413 assert(ac->drawable == newagd); in apple_glx_make_current_context()
417 ac->drawable = newagd; in apple_glx_make_current_context()
426 if (same_drawable && ac->is_current) { in apple_glx_make_current_context()
431 cglerr = apple_cgl.set_current_context(ac->context_obj); in apple_glx_make_current_context()
439 ac->is_current = true; in apple_glx_make_current_context()
441 assert(NULL != ac->context_obj); in apple_glx_make_current_context()
442 assert(NULL != ac->drawable); in apple_glx_make_current_context()
444 ac->thread_id = pthread_self(); in apple_glx_make_current_context()
447 ac->last_surface_window = None; in apple_glx_make_current_context()
449 switch (ac->drawable->type) { in apple_glx_make_current_context()
453 if (ac->drawable->callbacks.make_current) { in apple_glx_make_current_context()
454 if (ac->drawable->callbacks.make_current(ac, ac->drawable)) in apple_glx_make_current_context()
461 ac->drawable->type); in apple_glx_make_current_context()
471 struct apple_glx_context *ac = ptr; in apple_glx_is_current_drawable() local
473 if (ac->drawable && ac->drawable->drawable == drawable) { in apple_glx_is_current_drawable()
476 else if (NULL == ac->drawable && None != ac->last_surface_window) { in apple_glx_is_current_drawable()
477 apple_glx_context_update(dpy, ac); in apple_glx_is_current_drawable()
479 return (ac->drawable && ac->drawable->drawable == drawable); in apple_glx_is_current_drawable()
532 struct apple_glx_context *ac; in apple_glx_context_surface_changed() local
537 for (ac = context_list; ac; ac = ac->next) { in apple_glx_context_surface_changed()
538 if (ac->drawable && APPLE_GLX_DRAWABLE_SURFACE == ac->drawable->type in apple_glx_context_surface_changed()
539 && ac->drawable->types.surface.uid == uid) { in apple_glx_context_surface_changed()
541 if (caller == ac->thread_id) { in apple_glx_context_surface_changed()
545 xp_update_gl_context(ac->context_obj); in apple_glx_context_surface_changed()
548 ac->need_update = true; in apple_glx_context_surface_changed()
562 struct apple_glx_context *ac = ptr; in apple_glx_context_update() local
564 if (NULL == ac->drawable && None != ac->last_surface_window) { in apple_glx_context_update()
569 apple_glx_make_current_context(dpy, ac, ac, ac->last_surface_window); in apple_glx_context_update()
575 if (ac->need_update) { in apple_glx_context_update()
576 xp_update_gl_context(ac->context_obj); in apple_glx_context_update()
577 ac->need_update = false; in apple_glx_context_update()
582 if (ac->drawable && APPLE_GLX_DRAWABLE_SURFACE == ac->drawable->type in apple_glx_context_update()
583 && ac->drawable->types.surface.pending_destroy) { in apple_glx_context_update()
585 apple_cgl.clear_drawable(ac->context_obj); in apple_glx_context_update()
587 if (ac->drawable) { in apple_glx_context_update()
593 __func__, ac->drawable->drawable); in apple_glx_context_update()
595 d = ac->drawable; in apple_glx_context_update()
597 ac->last_surface_window = d->drawable; in apple_glx_context_update()
599 ac->drawable = NULL; in apple_glx_context_update()
616 struct apple_glx_context *ac = ptr; in apple_glx_context_uses_stereo() local
618 return ac->uses_stereo; in apple_glx_context_uses_stereo()