|
|
@@ -56,12 +56,18 @@ _mesa_DrawPixels( GLsizei width, GLsizei height, |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (!ctx->Current.RasterPosValid) { |
|
|
|
if (ctx->NewState) { |
|
|
|
_mesa_update_state(ctx); |
|
|
|
} |
|
|
|
|
|
|
|
if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { |
|
|
|
_mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, |
|
|
|
"glDrawPixels(incomplete framebuffer)" ); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (ctx->NewState) { |
|
|
|
_mesa_update_state(ctx); |
|
|
|
if (!ctx->Current.RasterPosValid) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (ctx->RenderMode == GL_RENDER) { |
|
|
@@ -111,6 +117,13 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height, |
|
|
|
_mesa_update_state(ctx); |
|
|
|
} |
|
|
|
|
|
|
|
if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT || |
|
|
|
ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { |
|
|
|
_mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, |
|
|
|
"glCopyPixels(incomplete framebuffer)" ); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (!ctx->Current.RasterPosValid) { |
|
|
|
return; |
|
|
|
} |
|
|
@@ -147,6 +160,7 @@ _mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, |
|
|
|
GLenum format, GLenum type, GLvoid *pixels ) |
|
|
|
{ |
|
|
|
GET_CURRENT_CONTEXT(ctx); |
|
|
|
const struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer; |
|
|
|
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); |
|
|
|
|
|
|
|
if (width < 0 || height < 0) { |
|
|
@@ -158,6 +172,17 @@ _mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, |
|
|
|
if (ctx->NewState) |
|
|
|
_mesa_update_state(ctx); |
|
|
|
|
|
|
|
if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { |
|
|
|
_mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, |
|
|
|
"glReadPixels(incomplete framebuffer)" ); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (!rb) { |
|
|
|
_mesa_error(ctx, GL_INVALID_OPERATION, "glReadPixels(no readbuffer)"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
ctx->Driver.ReadPixels(ctx, x, y, width, height, |
|
|
|
format, type, &ctx->Pack, pixels); |
|
|
|
} |
|
|
@@ -191,6 +216,12 @@ _mesa_Bitmap( GLsizei width, GLsizei height, |
|
|
|
_mesa_update_state(ctx); |
|
|
|
} |
|
|
|
|
|
|
|
if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { |
|
|
|
_mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, |
|
|
|
"glBitmap(incomplete framebuffer)"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (ctx->RenderMode == GL_RENDER) { |
|
|
|
/* Truncate, to satisfy conformance tests (matches SGI's OpenGL). */ |
|
|
|
GLint x = IFLOOR(ctx->Current.RasterPos[0] - xorig); |
|
|
@@ -252,6 +283,12 @@ _mesa_DrawDepthPixelsMESA( GLsizei width, GLsizei height, |
|
|
|
_mesa_update_state(ctx); |
|
|
|
} |
|
|
|
|
|
|
|
if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { |
|
|
|
_mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, |
|
|
|
"glDrawDepthPixelsMESA(incomplete framebuffer)"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (ctx->RenderMode == GL_RENDER) { |
|
|
|
/* Round, to satisfy conformance tests (matches SGI's OpenGL) */ |
|
|
|
GLint x = IROUND(ctx->Current.RasterPos[0]); |