summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorLaura Ekstrand <[email protected]>2015-01-30 14:03:53 -0800
committerLaura Ekstrand <[email protected]>2015-02-02 13:21:20 -0800
commite187c2f5432466c7b49dba266026fb9b01f5f667 (patch)
tree6232bca416174ed9c15bdbc69b8c6e650cad76c8 /src/mesa/main
parentad2c64abbd7326be35fa1f94c7e056e868ee6185 (diff)
DD: Refactor BlitFramebuffer.
In preparation for glBlitNamedFramebuffer, the DD table function BlitFramebuffer needs to accept two arbitrary framebuffer objects rather than assuming ctx->ReadBuffer and ctx->DrawBuffer. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/blit.c2
-rw-r--r--src/mesa/main/dd.h2
-rw-r--r--src/mesa/main/image.c14
-rw-r--r--src/mesa/main/image.h3
4 files changed, 14 insertions, 7 deletions
diff --git a/src/mesa/main/blit.c b/src/mesa/main/blit.c
index 0b70a3da43f..b97b564793c 100644
--- a/src/mesa/main/blit.c
+++ b/src/mesa/main/blit.c
@@ -506,7 +506,7 @@ _mesa_BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
}
ASSERT(ctx->Driver.BlitFramebuffer);
- ctx->Driver.BlitFramebuffer(ctx,
+ ctx->Driver.BlitFramebuffer(ctx, ctx->ReadBuffer, ctx->DrawBuffer,
srcX0, srcY0, srcX1, srcY1,
dstX0, dstY0, dstX1, dstY1,
mask, filter);
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 6883e1808f9..40f68b4a7fd 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -713,6 +713,8 @@ struct dd_function_table {
struct gl_framebuffer *fb);
/*@}*/
void (*BlitFramebuffer)(struct gl_context *ctx,
+ struct gl_framebuffer *readFb,
+ struct gl_framebuffer *drawFb,
GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
GLbitfield mask, GLenum filter);
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index 9ad97c56e40..c37900cf954 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -861,19 +861,21 @@ clip_left_or_bottom(GLint *srcX0, GLint *srcX1,
*/
GLboolean
_mesa_clip_blit(struct gl_context *ctx,
+ const struct gl_framebuffer *readFb,
+ const struct gl_framebuffer *drawFb,
GLint *srcX0, GLint *srcY0, GLint *srcX1, GLint *srcY1,
GLint *dstX0, GLint *dstY0, GLint *dstX1, GLint *dstY1)
{
const GLint srcXmin = 0;
- const GLint srcXmax = ctx->ReadBuffer->Width;
+ const GLint srcXmax = readFb->Width;
const GLint srcYmin = 0;
- const GLint srcYmax = ctx->ReadBuffer->Height;
+ const GLint srcYmax = readFb->Height;
/* these include scissor bounds */
- const GLint dstXmin = ctx->DrawBuffer->_Xmin;
- const GLint dstXmax = ctx->DrawBuffer->_Xmax;
- const GLint dstYmin = ctx->DrawBuffer->_Ymin;
- const GLint dstYmax = ctx->DrawBuffer->_Ymax;
+ const GLint dstXmin = drawFb->_Xmin;
+ const GLint dstXmax = drawFb->_Xmax;
+ const GLint dstYmin = drawFb->_Ymin;
+ const GLint dstYmax = drawFb->_Ymax;
/*
printf("PreClipX: src: %d .. %d dst: %d .. %d\n",
diff --git a/src/mesa/main/image.h b/src/mesa/main/image.h
index 44863cc5927..501586bfbd3 100644
--- a/src/mesa/main/image.h
+++ b/src/mesa/main/image.h
@@ -32,6 +32,7 @@
struct gl_context;
struct gl_pixelstore_attrib;
+struct gl_framebuffer;
extern void
_mesa_swap2_copy(GLushort *dst, GLushort *src, GLuint n);
@@ -140,6 +141,8 @@ _mesa_clip_to_region(GLint xmin, GLint ymin,
extern GLboolean
_mesa_clip_blit(struct gl_context *ctx,
+ const struct gl_framebuffer *readFb,
+ const struct gl_framebuffer *drawFb,
GLint *srcX0, GLint *srcY0, GLint *srcX1, GLint *srcY1,
GLint *dstX0, GLint *dstY0, GLint *dstX1, GLint *dstY1);