summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-10-22 18:16:10 -0600
committerBrian Paul <brianp@vmware.com>2009-10-22 18:16:10 -0600
commit4837e01bcd3d011a38d75cc9f1eff629c3de6fd6 (patch)
treea377f11390e83b3b89dc010b7d8a20fc01556b04
parent61a96a2ac72b3f071151de436a48c6ec985e3653 (diff)
mesa: code refactoring- new _mesa_finish(), _mesa_flush()
-rw-r--r--src/mesa/main/context.c37
-rw-r--r--src/mesa/main/context.h8
2 files changed, 37 insertions, 8 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index ac6540f4a0..e844a7432d 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 5587695fa0..c3be1063f8 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 );