diff options
author | Brian <brian.paul@tungstengraphics.com> | 2007-08-11 17:04:12 +0100 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2007-08-11 17:04:12 +0100 |
commit | bf383d1f5496f6c2ce318bbe1c02e7c7953a9153 (patch) | |
tree | 00865a8d14cef90a770a6761892045ae1eccbced /src/mesa/drivers/x11/xm_buffer.c | |
parent | 37fdc69a99a7692d337fb4efaea97df842490f21 (diff) |
repair breakage from recent pipe_winsys re-org
Diffstat (limited to 'src/mesa/drivers/x11/xm_buffer.c')
-rw-r--r-- | src/mesa/drivers/x11/xm_buffer.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c index fb6815ae1e..4cd2ab7c6b 100644 --- a/src/mesa/drivers/x11/xm_buffer.c +++ b/src/mesa/drivers/x11/xm_buffer.c @@ -248,6 +248,20 @@ xmesa_delete_renderbuffer(struct gl_renderbuffer *rb) } +static void +finish_surface_init(GLcontext *ctx, struct xmesa_renderbuffer *xrb) +{ + struct pipe_context *pipe = ctx->st->pipe; + + if (!xrb->St.surface) { + xrb->St.surface = xmesa_new_surface(ctx, xrb); + } + if (!xrb->St.surface->region) { + xrb->St.surface->region = pipe->region_alloc(pipe, 1, 0, 0, 0x0); + } +} + + /** * Reallocate renderbuffer storage for front color buffer. * Called via gl_renderbuffer::AllocStorage() @@ -271,8 +285,9 @@ xmesa_alloc_front_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->Height = height; rb->InternalFormat = internalFormat; - if (!xrb->St.surface) - xrb->St.surface = xmesa_new_surface(ctx, xrb); + if (!xrb->St.surface || !xrb->St.surface->region) + finish_surface_init(ctx, xrb); + xrb->St.surface->width = width; xrb->St.surface->height = height; @@ -325,8 +340,9 @@ xmesa_alloc_back_storage(GLcontext *ctx, struct gl_renderbuffer *rb, xrb->origin4 = NULL; } - if (!xrb->St.surface) - xrb->St.surface = xmesa_new_surface(ctx, xrb); + if (!xrb->St.surface || !xrb->St.surface->region) + finish_surface_init(ctx, xrb); + xrb->St.surface->width = width; xrb->St.surface->height = height; @@ -340,7 +356,7 @@ xmesa_alloc_back_storage(GLcontext *ctx, struct gl_renderbuffer *rb, */ struct xmesa_renderbuffer * xmesa_create_renderbuffer(GLcontext *ctx, GLuint name, const GLvisual *visual, - GLboolean backBuffer) + GLboolean backBuffer) { struct xmesa_renderbuffer *xrb = CALLOC_STRUCT(xmesa_renderbuffer); struct pipe_context *pipe = NULL;/*ctx->st->pipe;*/ |