summaryrefslogtreecommitdiffstats
path: root/src/glx/x11/glxext.c
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2004-12-21 23:06:02 +0000
committerIan Romanick <[email protected]>2004-12-21 23:06:02 +0000
commit990dec7ea0ad9eca8340d39fd022baa151c05a03 (patch)
tree2ac437f3d6d859fe3308ecf6c863f80c11ef666b /src/glx/x11/glxext.c
parent302c5694c681fb19e4b1855ed82a87c2d0ba5de4 (diff)
Used GCC's __builtin_expect when available. Change the way code is
generated for commands that can use RenderLarge packets. Tweak the code for __glXFlushRenderBuffer slightly.
Diffstat (limited to 'src/glx/x11/glxext.c')
-rw-r--r--src/glx/x11/glxext.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c
index c24e22ff4f8..1155cd92acf 100644
--- a/src/glx/x11/glxext.c
+++ b/src/glx/x11/glxext.c
@@ -1263,23 +1263,23 @@ CARD8 __glXSetupForCommand(Display *dpy)
return priv->majorOpcode;
}
-/*
-** Flush the drawing command transport buffer.
-*/
+/**
+ * Flush the drawing command transport buffer.
+ *
+ * \param ctx Context whose transport buffer is to be flushed.
+ * \param pc Pointer to first unused buffer location.
+ *
+ * \todo
+ * Modify this function to use \c ctx->pc instead of the explicit
+ * \c pc parameter.
+ */
GLubyte *__glXFlushRenderBuffer(__GLXcontext *ctx, GLubyte *pc)
{
- Display *dpy;
+ Display * const dpy = ctx->currentDpy;
xGLXRenderReq *req;
- GLint size;
-
- if (!(dpy = ctx->currentDpy)) {
- /* Using the dummy context */
- ctx->pc = ctx->buf;
- return ctx->pc;
- }
+ const GLint size = pc - ctx->buf;
- size = pc - ctx->buf;
- if (size) {
+ if ( (dpy != NULL) && (size > 0) ) {
/* Send the entire buffer as an X request */
LockDisplay(dpy);
GetReq(GLXRender,req);