Mesa (mesa_7_6_branch): mesa: code refactoring- new _mesa_finish(), _mesa_flush()

Brian Paul brianp at kemper.freedesktop.org
Fri Oct 23 00:33:51 UTC 2009


Module: Mesa
Branch: mesa_7_6_branch
Commit: 4837e01bcd3d011a38d75cc9f1eff629c3de6fd6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4837e01bcd3d011a38d75cc9f1eff629c3de6fd6

Author: Brian Paul <brianp at vmware.com>
Date:   Thu Oct 22 18:16:10 2009 -0600

mesa: code refactoring- new _mesa_finish(), _mesa_flush()

---

 src/mesa/main/context.c |   37 +++++++++++++++++++++++++++++--------
 src/mesa/main/context.h |    8 ++++++++
 2 files changed, 37 insertions(+), 8 deletions(-)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index ac6540f..e844a74 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1544,6 +1544,33 @@ _mesa_record_error(GLcontext *ctx, GLenum error)
 
 
 /**
+ * Flush commands and wait for completion.
+ */
+void
+_mesa_finish(GLcontext *ctx)
+{
+   FLUSH_CURRENT( ctx, 0 );
+   if (ctx->Driver.Finish) {
+      ctx->Driver.Finish(ctx);
+   }
+}
+
+
+/**
+ * Flush commands.
+ */
+void
+_mesa_flush(GLcontext *ctx)
+{
+   FLUSH_CURRENT( ctx, 0 );
+   if (ctx->Driver.Flush) {
+      ctx->Driver.Flush(ctx);
+   }
+}
+
+
+
+/**
  * Execute glFinish().
  *
  * Calls the #ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH macro and the
@@ -1554,10 +1581,7 @@ _mesa_Finish(void)
 {
    GET_CURRENT_CONTEXT(ctx);
    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-   FLUSH_CURRENT( ctx, 0 );
-   if (ctx->Driver.Finish) {
-      ctx->Driver.Finish(ctx);
-   }
+   _mesa_finish(ctx);
 }
 
 
@@ -1572,10 +1596,7 @@ _mesa_Flush(void)
 {
    GET_CURRENT_CONTEXT(ctx);
    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-   FLUSH_CURRENT( ctx, 0 );
-   if (ctx->Driver.Flush) {
-      ctx->Driver.Flush(ctx);
-   }
+   _mesa_flush(ctx);
 }
 
 
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index 5587695..c3be106 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -170,6 +170,14 @@ _mesa_valid_to_render(GLcontext *ctx, const char *where);
 extern void
 _mesa_record_error( GLcontext *ctx, GLenum error );
 
+
+extern void
+_mesa_finish(GLcontext *ctx);
+
+extern void
+_mesa_flush(GLcontext *ctx);
+
+
 extern void GLAPIENTRY
 _mesa_Finish( void );
 




More information about the mesa-commit mailing list