[cairo-commit] glitz/src/wgl glitz_wgl_context.c, 1.3, 1.4 glitz_wgl_drawable.c, 1.3, 1.4 glitz_wglint.h, 1.2, 1.3

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


Committed by: davidr

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

Modified Files:
	glitz_wgl_context.c glitz_wgl_drawable.c glitz_wglint.h 
Log Message:
Add support for avoiding context switches

Index: glitz_wgl_context.c
===================================================================
RCS file: /cvs/cairo/glitz/src/wgl/glitz_wgl_context.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- glitz_wgl_context.c	13 Mar 2006 13:42:46 -0000	1.3
+++ glitz_wgl_context.c	13 Mar 2006 14:23:44 -0000	1.4
@@ -266,6 +266,8 @@
 {
     HGLRC context;
 
+    drawable->base.flushed = drawable->base.finished = 0;
+
     switch (constraint) {
     case GLITZ_NONE:
 	break;
@@ -291,12 +293,16 @@
 glitz_bool_t
 glitz_wgl_push_current (void               *abstract_drawable,
 			glitz_surface_t    *surface,
-			glitz_constraint_t constraint)
+			glitz_constraint_t constraint,
+			glitz_bool_t       *restore_state)
 {
     glitz_wgl_drawable_t *drawable = (glitz_wgl_drawable_t *) abstract_drawable;
     glitz_wgl_context_info_t *context_info;
     int index;
 
+    if (restore_state)
+	*restore_state = 0;
+
     index = drawable->screen_info->context_stack_size++;
 
     context_info = &drawable->screen_info->context_stack[index];

Index: glitz_wgl_drawable.c
===================================================================
RCS file: /cvs/cairo/glitz/src/wgl/glitz_wgl_drawable.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- glitz_wgl_drawable.c	13 Mar 2006 13:42:46 -0000	1.3
+++ glitz_wgl_drawable.c	13 Mar 2006 14:23:44 -0000	1.4
@@ -75,7 +75,7 @@
 			  height);
 
     if (!context->initialized) {
-	glitz_wgl_push_current (drawable, NULL, GLITZ_CONTEXT_CURRENT);
+	glitz_wgl_push_current (drawable, NULL, GLITZ_CONTEXT_CURRENT, NULL);
 	glitz_wgl_pop_current (drawable);
     }
 
@@ -199,7 +199,8 @@
 	 * Last drawable? We have to destroy all fragment programs as this may
 	 * be our last chance to have a context current.
 	 */
-	glitz_wgl_push_current (abstract_drawable, NULL, GLITZ_CONTEXT_CURRENT);
+	glitz_wgl_push_current (abstract_drawable, NULL, GLITZ_CONTEXT_CURRENT,
+				NULL);
 	glitz_program_map_fini (drawable->base.backend->gl,
 				&drawable->screen_info->program_map);
 	glitz_program_map_init (&drawable->screen_info->program_map);

Index: glitz_wglint.h
===================================================================
RCS file: /cvs/cairo/glitz/src/wgl/glitz_wglint.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- glitz_wglint.h	13 Mar 2006 13:42:46 -0000	1.2
+++ glitz_wglint.h	13 Mar 2006 14:23:44 -0000	1.3
@@ -173,7 +173,8 @@
 extern glitz_bool_t __internal_linkage
 glitz_wgl_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_wgl_pop_current (void *abstract_drawable);



More information about the cairo-commit mailing list