From 0336b13e1e6307429efdf560d523727d88d556aa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 14 Jun 2021 16:56:57 -0400 Subject: [PATCH] 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 Reviewed-by: Adam Jackson Part-of: --- 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 2b7ee72..6183a67 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 8f3f9fc..d83fab6 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 9113ecd..0f064d8 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); -- 2.7.4