aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/swrast
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-01-22 14:07:34 +0100
committermarha <marha@users.sourceforge.net>2013-01-22 14:07:34 +0100
commit470f7ca9f0be348faf2f03fc16811844c5eeffce (patch)
tree3071ab9b9fbabc772ee68c86fe587f260bde26c6 /mesalib/src/mesa/swrast
parent4fc6b34d1c14cc61f553ca59264d0909656933f3 (diff)
downloadvcxsrv-470f7ca9f0be348faf2f03fc16811844c5eeffce.tar.gz
vcxsrv-470f7ca9f0be348faf2f03fc16811844c5eeffce.tar.bz2
vcxsrv-470f7ca9f0be348faf2f03fc16811844c5eeffce.zip
fontconfig libfontenc mesa mkfontscale pixman xserver xkeyboard-config
fontconfig: 000ca9ccb03013a5b151f0d21148ab0ca4c2f2de libfontenc: f5d1208172e965fdd7fae8927bd3e29b3cc3a975 mesa: 148fc6d53716f39971a453792570c2b8c207efb6 mkfontscale: 547517571e695728278a264eedbac47b6e1f43bc pixman: 2c6577476e5b18e17904ae8af244a39c352e2e33 xserver: 70b127c9f1c53bdb42f078265e67f76b464deae2 xkeyboard-config: 6b35b1b43d2fdff30f530d7cf65fffd6c3504690
Diffstat (limited to 'mesalib/src/mesa/swrast')
-rw-r--r--mesalib/src/mesa/swrast/s_blit.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/mesalib/src/mesa/swrast/s_blit.c b/mesalib/src/mesa/swrast/s_blit.c
index 043b578a5..3a4e7eec0 100644
--- a/mesalib/src/mesa/swrast/s_blit.c
+++ b/mesalib/src/mesa/swrast/s_blit.c
@@ -114,7 +114,7 @@ blit_nearest(struct gl_context *ctx,
struct gl_renderbuffer_attachment *readAtt, *drawAtt;
struct gl_framebuffer *readFb = ctx->ReadBuffer;
struct gl_framebuffer *drawFb = ctx->DrawBuffer;
- GLint NumDrawBuffers = 0;
+ GLuint numDrawBuffers = 0;
GLuint i;
const GLint srcWidth = ABS(srcX1 - srcX0);
@@ -153,14 +153,14 @@ blit_nearest(struct gl_context *ctx,
case GL_COLOR_BUFFER_BIT:
readAtt = &readFb->Attachment[readFb->_ColorReadBufferIndex];
readRb = readFb->_ColorReadBuffer;
- NumDrawBuffers = drawFb->_NumColorDrawBuffers;
+ numDrawBuffers = drawFb->_NumColorDrawBuffers;
break;
case GL_DEPTH_BUFFER_BIT:
readAtt = &readFb->Attachment[BUFFER_DEPTH];
drawAtt = &drawFb->Attachment[BUFFER_DEPTH];
readRb = readAtt->Renderbuffer;
drawRb = drawAtt->Renderbuffer;
- NumDrawBuffers = 1;
+ numDrawBuffers = 1;
/* Note that for depth/stencil, the formats of src/dst must match. By
* using the core helpers for pack/unpack, we avoid needing to handle
@@ -179,7 +179,7 @@ blit_nearest(struct gl_context *ctx,
drawAtt = &drawFb->Attachment[BUFFER_STENCIL];
readRb = readAtt->Renderbuffer;
drawRb = drawAtt->Renderbuffer;
- NumDrawBuffers = 1;
+ numDrawBuffers = 1;
mode = UNPACK_S;
pixelSize = 1;
break;
@@ -212,7 +212,7 @@ blit_nearest(struct gl_context *ctx,
}
/* Blit to all the draw buffers */
- for (i = 0; i < NumDrawBuffers; i++) {
+ for (i = 0; i < numDrawBuffers; i++) {
if (buffer == GL_COLOR_BUFFER_BIT) {
int idx = drawFb->_ColorDrawBufferIndexes[i];
if (idx == -1)
@@ -220,6 +220,9 @@ blit_nearest(struct gl_context *ctx,
drawAtt = &drawFb->Attachment[idx];
drawRb = drawAtt->Renderbuffer;
+ if (!drawRb)
+ continue;
+
if (readRb->Format == drawRb->Format) {
mode = DIRECT;
pixelSize = _mesa_get_format_bytes(readRb->Format);
@@ -514,8 +517,6 @@ blit_linear(struct gl_context *ctx,
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1)
{
struct gl_framebuffer *drawFb = ctx->DrawBuffer;
- struct gl_renderbuffer *drawRb = NULL;
- struct gl_renderbuffer_attachment *drawAtt = NULL;
struct gl_framebuffer *readFb = ctx->ReadBuffer;
struct gl_renderbuffer *readRb = readFb->_ColorReadBuffer;
struct gl_renderbuffer_attachment *readAtt =
@@ -543,7 +544,6 @@ blit_linear(struct gl_context *ctx,
GLvoid *dstBuffer;
gl_format readFormat = _mesa_get_srgb_format_linear(readRb->Format);
- gl_format drawFormat = _mesa_get_srgb_format_linear(drawRb->Format);
GLuint bpp = _mesa_get_format_bytes(readFormat);
GLenum pixelType;
@@ -587,17 +587,27 @@ blit_linear(struct gl_context *ctx,
}
for (i = 0; i < drawFb->_NumColorDrawBuffers; i++) {
- int idx = drawFb->_ColorDrawBufferIndexes[i];
+ GLint idx = drawFb->_ColorDrawBufferIndexes[i];
+ struct gl_renderbuffer_attachment *drawAtt;
+ struct gl_renderbuffer *drawRb;
+ gl_format drawFormat;
+
if (idx == -1)
continue;
+
drawAtt = &drawFb->Attachment[idx];
drawRb = drawAtt->Renderbuffer;
+ if (!drawRb)
+ continue;
+
+ drawFormat = _mesa_get_srgb_format_linear(drawRb->Format);
+
/*
* Map src / dst renderbuffers
*/
if ((readRb == drawRb) ||
(readAtt->Texture && drawAtt->Texture &&
- (readAtt->Texture = drawAtt->Texture))) {
+ (readAtt->Texture == drawAtt->Texture))) {
/* map whole buffer for read/write */
ctx->Driver.MapRenderbuffer(ctx, readRb,
0, 0, readRb->Width, readRb->Height,