Mesa (main): mesa: move _mesa_notifySwapBuffers into the x11 swrast driver

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 17 02:54:23 UTC 2021


Module: Mesa
Branch: main
Commit: 0336b13e1e6307429efdf560d523727d88d556aa
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0336b13e1e6307429efdf560d523727d88d556aa

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Mon Jun 14 16:56:57 2021 -0400

mesa: move _mesa_notifySwapBuffers into the x11 swrast driver

It has no other use and no relevance to DRI drivers despite the name.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Reviewed-by: Adam Jackson <ajax at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11341>

---

 src/mesa/drivers/x11/xm_api.c | 24 ++++++++++++++++++++++--
 src/mesa/main/context.c       | 21 ---------------------
 src/mesa/main/context.h       |  4 ----
 3 files changed, 22 insertions(+), 27 deletions(-)

diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c
index 2b7ee72720d..6183a67b484 100644
--- a/src/mesa/drivers/x11/xm_api.c
+++ b/src/mesa/drivers/x11/xm_api.c
@@ -1300,6 +1300,26 @@ Display *XMesaGetCurrentDisplay(void)
 }
 
 
+/**
+ * Swap buffers notification callback.
+ *
+ * \param ctx GL context.
+ *
+ * Called by window system just before swapping buffers.
+ * We have to finish any pending rendering.
+ */
+static void
+XMesaNotifySwapBuffers(struct gl_context *ctx)
+{
+   if (MESA_VERBOSE & VERBOSE_SWAPBUFFERS)
+      _mesa_debug(ctx, "SwapBuffers\n");
+
+   FLUSH_VERTICES(ctx, 0, 0);
+   if (ctx->Driver.Flush) {
+      ctx->Driver.Flush(ctx, 0);
+   }
+}
+
 
 /*
  * Copy the back buffer to the front buffer.  If there's no back buffer
@@ -1319,7 +1339,7 @@ void XMesaSwapBuffers( XMesaBuffer b )
     * we have to flush any pending rendering commands first.
     */
    if (ctx && ctx->DrawBuffer == &(b->mesa_buffer))
-      _mesa_notifySwapBuffers(ctx);
+      XMesaNotifySwapBuffers(ctx);
 
    if (b->db_mode) {
       if (b->backxrb->ximage) {
@@ -1374,7 +1394,7 @@ void XMesaCopySubBuffer( XMesaBuffer b, int x, int y, int width, int height )
     * we have to flush any pending rendering commands first.
     */
    if (ctx && ctx->DrawBuffer == &(b->mesa_buffer))
-      _mesa_notifySwapBuffers(ctx);
+      XMesaNotifySwapBuffers(ctx);
 
    if (!b->backxrb) {
       /* single buffered */
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 8f3f9fc287a..d83fab6954f 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -168,27 +168,6 @@ int MESA_DEBUG_FLAGS = 0;
 GLfloat _mesa_ubyte_to_float_color_tab[256];
 
 
-
-/**
- * Swap buffers notification callback.
- *
- * \param ctx GL context.
- *
- * Called by window system just before swapping buffers.
- * We have to finish any pending rendering.
- */
-void
-_mesa_notifySwapBuffers(struct gl_context *ctx)
-{
-   if (MESA_VERBOSE & VERBOSE_SWAPBUFFERS)
-      _mesa_debug(ctx, "SwapBuffers\n");
-   FLUSH_VERTICES(ctx, 0, 0);
-   if (ctx->Driver.Flush) {
-      ctx->Driver.Flush(ctx, 0);
-   }
-}
-
-
 /**********************************************************************/
 /** \name GL Visual initialization                                    */
 /**********************************************************************/
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index 9113ecd6ad9..0f064d83ca6 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -120,10 +120,6 @@ _mesa_get_current_context(void);
 extern void
 _mesa_init_constants(struct gl_constants *consts, gl_api api);
 
-extern void
-_mesa_notifySwapBuffers(struct gl_context *gc);
-
-
 extern struct _glapi_table *
 _mesa_get_dispatch(struct gl_context *ctx);
 



More information about the mesa-commit mailing list