[cairo-commit] glitz/src/agl glitz_agl_context.c, 1.8, 1.9 glitz_agl_drawable.c, 1.6, 1.7 glitz_aglint.h, 1.6, 1.7

David Reveman commit at pdx.freedesktop.org
Mon Mar 13 06:23:46 PST 2006


Committed by: davidr

Update of /cvs/cairo/glitz/src/agl
In directory kemper:/tmp/cvs-serv20671/src/agl

Modified Files:
	glitz_agl_context.c glitz_agl_drawable.c glitz_aglint.h 
Log Message:
Add support for avoiding context switches

Index: glitz_agl_context.c
===================================================================
RCS file: /cvs/cairo/glitz/src/agl/glitz_agl_context.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- glitz_agl_context.c	13 Mar 2006 13:42:46 -0000	1.8
+++ glitz_agl_context.c	13 Mar 2006 14:23:44 -0000	1.9
@@ -424,6 +424,8 @@
 {
     AGLContext context;
 
+    drawable->base.flushed = drawable->base.finished = 0;
+
     switch (constraint) {
     case GLITZ_NONE:
 	break;
@@ -473,13 +475,17 @@
 glitz_bool_t
 glitz_agl_push_current (void               *abstract_drawable,
 			glitz_surface_t    *surface,
-			glitz_constraint_t constraint)
+			glitz_constraint_t constraint,
+			glitz_bool_t       *restore_state)
 {
     glitz_agl_drawable_t *drawable = (glitz_agl_drawable_t *)
 	abstract_drawable;
     glitz_agl_context_info_t *context_info;
     int index;
 
+    if (restore_state)
+	*restore_state = 0;
+
     index = drawable->thread_info->context_stack_size++;
 
     context_info = &drawable->thread_info->context_stack[index];

Index: glitz_agl_drawable.c
===================================================================
RCS file: /cvs/cairo/glitz/src/agl/glitz_agl_drawable.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- glitz_agl_drawable.c	13 Mar 2006 13:42:46 -0000	1.6
+++ glitz_agl_drawable.c	13 Mar 2006 14:23:44 -0000	1.7
@@ -57,7 +57,7 @@
 			  width, height);
 
     if (!context->initialized) {
-	glitz_agl_push_current (drawable, NULL, GLITZ_CONTEXT_CURRENT);
+	glitz_agl_push_current (drawable, NULL, GLITZ_CONTEXT_CURRENT, NULL);
 	glitz_agl_pop_current (drawable);
     }
 
@@ -203,7 +203,7 @@
 	 * be our last chance to have a context current.
 	 */
 	glitz_agl_push_current (abstract_drawable, NULL,
-				GLITZ_CONTEXT_CURRENT);
+				GLITZ_CONTEXT_CURRENT, NULL);
 	glitz_program_map_fini (drawable->base.backend->gl,
 				&drawable->thread_info->program_map);
 	glitz_program_map_init (&drawable->thread_info->program_map);
@@ -241,7 +241,8 @@
     glitz_agl_drawable_t *drawable = (glitz_agl_drawable_t *)
 	abstract_drawable;
 
-    glitz_agl_push_current (abstract_drawable, NULL, GLITZ_DRAWABLE_CURRENT);
+    glitz_agl_push_current (abstract_drawable, NULL, GLITZ_DRAWABLE_CURRENT,
+			    NULL);
     aglSwapBuffers (drawable->context->context);
     glitz_agl_pop_current (abstract_drawable);
 

Index: glitz_aglint.h
===================================================================
RCS file: /cvs/cairo/glitz/src/agl/glitz_aglint.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- glitz_aglint.h	13 Mar 2006 13:42:46 -0000	1.6
+++ glitz_aglint.h	13 Mar 2006 14:23:44 -0000	1.7
@@ -119,7 +119,8 @@
 extern glitz_bool_t __internal_linkage
 glitz_agl_push_current (void               *abstract_drawable,
 			glitz_surface_t    *surface,
-			glitz_constraint_t constraint);
+			glitz_constraint_t constraint,
+			glitz_bool_t       *restore_state);
 
 extern glitz_surface_t __internal_linkage *
 glitz_agl_pop_current (void *abstract_drawable);



More information about the cairo-commit mailing list