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@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11341>
This commit is contained in:
Marek Olšák 2021-06-14 16:56:57 -04:00 committed by Marge Bot
parent b7dc72380a
commit 0336b13e1e
3 changed files with 22 additions and 27 deletions

View 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 * 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. * we have to flush any pending rendering commands first.
*/ */
if (ctx && ctx->DrawBuffer == &(b->mesa_buffer)) if (ctx && ctx->DrawBuffer == &(b->mesa_buffer))
_mesa_notifySwapBuffers(ctx); XMesaNotifySwapBuffers(ctx);
if (b->db_mode) { if (b->db_mode) {
if (b->backxrb->ximage) { 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. * we have to flush any pending rendering commands first.
*/ */
if (ctx && ctx->DrawBuffer == &(b->mesa_buffer)) if (ctx && ctx->DrawBuffer == &(b->mesa_buffer))
_mesa_notifySwapBuffers(ctx); XMesaNotifySwapBuffers(ctx);
if (!b->backxrb) { if (!b->backxrb) {
/* single buffered */ /* single buffered */

View File

@ -168,27 +168,6 @@ int MESA_DEBUG_FLAGS = 0;
GLfloat _mesa_ubyte_to_float_color_tab[256]; 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 */ /** \name GL Visual initialization */
/**********************************************************************/ /**********************************************************************/

View File

@ -120,10 +120,6 @@ _mesa_get_current_context(void);
extern void extern void
_mesa_init_constants(struct gl_constants *consts, gl_api api); _mesa_init_constants(struct gl_constants *consts, gl_api api);
extern void
_mesa_notifySwapBuffers(struct gl_context *gc);
extern struct _glapi_table * extern struct _glapi_table *
_mesa_get_dispatch(struct gl_context *ctx); _mesa_get_dispatch(struct gl_context *ctx);