mesa: move _mesa_notifySwapBuffers into the x11 swrast driver
authorMarek Olšák <marek.olsak@amd.com>
Mon, 14 Jun 2021 20:56:57 +0000 (16:56 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 17 Jun 2021 02:24:22 +0000 (02:24 +0000)
It has no other use and no relevance to DRI drivers despite the name.

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

src/mesa/drivers/x11/xm_api.c
src/mesa/main/context.c
src/mesa/main/context.h

index 2b7ee72..6183a67 100644 (file)
@@ -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 */
index 8f3f9fc..d83fab6 100644 (file)
@@ -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                                    */
 /**********************************************************************/
index 9113ecd..0f064d8 100644 (file)
@@ -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);