mesa: Remove Driver.GetBufferSize and its callers.

Only the GDI driver set it to non-NULL any more, and that driver has a
Viewport hook that should keep it limping along as well as it ever has.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Eric Anholt
2013-06-20 09:39:11 -07:00
parent 61bfed2d09
commit bab755ad1b
9 changed files with 0 additions and 129 deletions

View File

@@ -75,7 +75,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
driver->GetString = NULL; /* REQUIRED! */
driver->UpdateState = NULL; /* REQUIRED! */
driver->GetBufferSize = NULL; /* REQUIRED! */
driver->ResizeBuffers = _mesa_resize_framebuffer;
driver->Finish = NULL;

View File

@@ -139,7 +139,6 @@ static const struct tnl_pipeline_stage *r200_pipeline[] = {
*/
static void r200InitDriverFuncs( struct dd_function_table *functions )
{
functions->GetBufferSize = NULL; /* OBSOLETE */
functions->GetString = r200GetString;
}

View File

@@ -642,7 +642,6 @@ swrast_init_driver_functions(struct dd_function_table *driver)
{
driver->GetString = get_string;
driver->UpdateState = update_state;
driver->GetBufferSize = NULL;
driver->Viewport = viewport;
driver->ChooseTextureFormat = swrastChooseTextureFormat;
driver->MapRenderbuffer = swrast_map_renderbuffer;

View File

@@ -710,7 +710,6 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
/* override with our functions */
functions.GetString = get_string;
functions.UpdateState = osmesa_update_state;
functions.GetBufferSize = NULL;
if (!_mesa_initialize_context(&osmesa->mesa,
API_OPENGL_COMPAT,

View File

@@ -605,7 +605,6 @@ WMesaContext WMesaCreateContext(HDC hDC,
_mesa_init_driver_functions(&functions);
functions.GetString = wmesa_get_string;
functions.UpdateState = wmesa_update_state;
functions.GetBufferSize = wmesa_get_buffer_size;
functions.Flush = wmesa_flush;
functions.Clear = clear;
functions.ResizeBuffers = wmesa_resize_buffers;

View File

@@ -841,7 +841,6 @@ xmesa_init_driver_functions( XMesaVisual xmvisual,
{
driver->GetString = get_string;
driver->UpdateState = xmesa_update_state;
driver->GetBufferSize = NULL; /* OBSOLETE */
driver->Flush = finish_or_flush;
driver->Finish = finish_or_flush;
driver->ColorMask = color_mask;

View File

@@ -1387,25 +1387,6 @@ check_compatible(const struct gl_context *ctx,
}
/**
* Do one-time initialization for the given framebuffer. Specifically,
* ask the driver for the window's current size and update the framebuffer
* object to match.
* Really, the device driver should totally take care of this.
*/
static void
initialize_framebuffer_size(struct gl_context *ctx, struct gl_framebuffer *fb)
{
GLuint width, height;
if (ctx->Driver.GetBufferSize) {
ctx->Driver.GetBufferSize(fb, &width, &height);
if (ctx->Driver.ResizeBuffers)
ctx->Driver.ResizeBuffers(ctx, fb, width, height);
fb->Initialized = GL_TRUE;
}
}
/**
* Check if the viewport/scissor size has not yet been initialized.
* Initialize the size if the given width and height are non-zero.
@@ -1508,32 +1489,6 @@ _mesa_make_current( struct gl_context *newCtx,
*/
newCtx->NewState |= _NEW_BUFFERS;
#if 1
/* We want to get rid of these lines: */
if (!drawBuffer->Initialized) {
initialize_framebuffer_size(newCtx, drawBuffer);
}
if (readBuffer != drawBuffer && !readBuffer->Initialized) {
initialize_framebuffer_size(newCtx, readBuffer);
}
_mesa_resizebuffers(newCtx);
#else
/* We want the drawBuffer and readBuffer to be initialized by
* the driver.
* This generally means the Width and Height match the actual
* window size and the renderbuffers (both hardware and software
* based) are allocated to match. The later can generally be
* done with a call to _mesa_resize_framebuffer().
*
* It's theoretically possible for a buffer to have zero width
* or height, but for now, assert check that the driver did what's
* expected of it.
*/
ASSERT(drawBuffer->Width > 0);
ASSERT(drawBuffer->Height > 0);
#endif
if (drawBuffer) {
_mesa_check_init_viewport(newCtx,
drawBuffer->Width, drawBuffer->Height);

View File

@@ -92,15 +92,6 @@ struct dd_function_table {
*/
void (*UpdateState)( struct gl_context *ctx, GLbitfield new_state );
/**
* Get the width and height of the named buffer/window.
*
* Mesa uses this to determine when the driver's window size has changed.
* XXX OBSOLETE: this function will be removed in the future.
*/
void (*GetBufferSize)( struct gl_framebuffer *buffer,
GLuint *width, GLuint *height );
/**
* Resize the given framebuffer to the given size.
* XXX OBSOLETE: this function will be removed in the future.

View File

@@ -319,81 +319,12 @@ _mesa_resize_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
}
}
/**
* XXX THIS IS OBSOLETE - drivers should take care of detecting window
* size changes and act accordingly, likely calling _mesa_resize_framebuffer().
*
* GL_MESA_resize_buffers extension.
*
* When this function is called, we'll ask the window system how large
* the current window is. If it's a new size, we'll call the driver's
* ResizeBuffers function. The driver will then resize its color buffers
* as needed, and maybe call the swrast's routine for reallocating
* swrast-managed depth/stencil/accum/etc buffers.
* \note This function should only be called through the GL API, not
* from device drivers (as was done in the past).
*/
void
_mesa_resizebuffers( struct gl_context *ctx )
{
FLUSH_VERTICES(ctx, 0);
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glResizeBuffersMESA\n");
if (!ctx->Driver.GetBufferSize) {
return;
}
if (ctx->WinSysDrawBuffer) {
GLuint newWidth, newHeight;
struct gl_framebuffer *buffer = ctx->WinSysDrawBuffer;
assert(_mesa_is_winsys_fbo(buffer));
/* ask device driver for size of output buffer */
ctx->Driver.GetBufferSize( buffer, &newWidth, &newHeight );
/* see if size of device driver's color buffer (window) has changed */
if (buffer->Width != newWidth || buffer->Height != newHeight) {
if (ctx->Driver.ResizeBuffers)
ctx->Driver.ResizeBuffers(ctx, buffer, newWidth, newHeight );
}
}
if (ctx->WinSysReadBuffer
&& ctx->WinSysReadBuffer != ctx->WinSysDrawBuffer) {
GLuint newWidth, newHeight;
struct gl_framebuffer *buffer = ctx->WinSysReadBuffer;
assert(_mesa_is_winsys_fbo(buffer));
/* ask device driver for size of read buffer */
ctx->Driver.GetBufferSize( buffer, &newWidth, &newHeight );
/* see if size of device driver's color buffer (window) has changed */
if (buffer->Width != newWidth || buffer->Height != newHeight) {
if (ctx->Driver.ResizeBuffers)
ctx->Driver.ResizeBuffers(ctx, buffer, newWidth, newHeight );
}
}
ctx->NewState |= _NEW_BUFFERS; /* to update scissor / window bounds */
}
/*
* XXX THIS IS OBSOLETE
*/
void GLAPIENTRY
_mesa_ResizeBuffersMESA( void )
{
GET_CURRENT_CONTEXT(ctx);
if (ctx->Extensions.MESA_resize_buffers)
_mesa_resizebuffers( ctx );
}