-/* $Id: teximage.c,v 1.66 2000/12/08 18:09:33 brianp Exp $ */
+/* $Id: teximage.c,v 1.67 2000/12/09 21:30:43 brianp Exp $ */
/*
* Mesa 3-D graphics library
GLsizei width, GLint border, GLenum format,
GLenum type, const GLvoid *pixels )
{
- GLsizei postConvWidth;
+ GLsizei postConvWidth = width;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glTexImage1D");
- postConvWidth = width;
adjust_texture_size_for_convolution(ctx, 1, &postConvWidth, NULL);
if (target==GL_TEXTURE_1D) {
GLenum format, GLenum type,
const GLvoid *pixels )
{
- GLsizei postConvWidth, postConvHeight;
+ GLsizei postConvWidth = width, postConvHeight = height;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glTexImage2D");
- postConvWidth = width;
- postConvHeight = height;
adjust_texture_size_for_convolution(ctx, 2, &postConvWidth,&postConvHeight);
if (target==GL_TEXTURE_2D ||
GLenum format, GLenum type,
const GLvoid *pixels )
{
+ GLsizei postConvWidth = width;
GET_CURRENT_CONTEXT(ctx);
struct gl_texture_unit *texUnit;
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
GLboolean success = GL_FALSE;
- GLsizei postConvWidth;
- postConvWidth = width;
adjust_texture_size_for_convolution(ctx, 1, &postConvWidth, NULL);
if (subtexture_error_check(ctx, 1, target, level, xoffset, 0, 0,
GLenum format, GLenum type,
const GLvoid *pixels )
{
+ GLsizei postConvWidth = width, postConvHeight = height;
GET_CURRENT_CONTEXT(ctx);
struct gl_texture_unit *texUnit;
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
GLboolean success = GL_FALSE;
- GLsizei postConvWidth, postConvHeight;
- postConvWidth = width;
- postConvHeight = height;
adjust_texture_size_for_convolution(ctx, 2, &postConvWidth,&postConvHeight);
if (subtexture_error_check(ctx, 2, target, level, xoffset, yoffset, 0,
GLint x, GLint y,
GLsizei width, GLint border )
{
+ GLsizei postConvWidth = width;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCopyTexImage1D");
- if (copytexture_error_check(ctx, 1, target, level, internalFormat,
- width, 1, border))
- return;
-
if (ctx->NewState & _NEW_PIXEL)
gl_update_state(ctx);
+ adjust_texture_size_for_convolution(ctx, 1, &postConvWidth, NULL);
+
+ if (copytexture_error_check(ctx, 1, target, level, internalFormat,
+ postConvWidth, 1, border))
+ return;
+
if (ctx->_ImageTransferState || !ctx->Driver.CopyTexImage1D
|| !(*ctx->Driver.CopyTexImage1D)(ctx, target, level,
internalFormat, x, y, width, border)) {
GLint x, GLint y, GLsizei width, GLsizei height,
GLint border )
{
+ GLsizei postConvWidth = width, postConvHeight = height;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCopyTexImage2D");
- if (copytexture_error_check(ctx, 2, target, level, internalFormat,
- width, height, border))
- return;
-
if (ctx->NewState & _NEW_PIXEL)
gl_update_state(ctx);
+ adjust_texture_size_for_convolution(ctx, 2, &postConvWidth,&postConvHeight);
+
+ if (copytexture_error_check(ctx, 2, target, level, internalFormat,
+ postConvWidth, postConvHeight, border))
+ return;
+
if (ctx->_ImageTransferState || !ctx->Driver.CopyTexImage2D
|| !(*ctx->Driver.CopyTexImage2D)(ctx, target, level,
internalFormat, x, y, width, height, border)) {
_mesa_CopyTexSubImage1D( GLenum target, GLint level,
GLint xoffset, GLint x, GLint y, GLsizei width )
{
+ GLsizei postConvWidth = width;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCopyTexSubImage1D");
- if (copytexsubimage_error_check(ctx, 1, target, level,
- xoffset, 0, 0, width, 1))
- return;
-
if (ctx->NewState & _NEW_PIXEL)
gl_update_state(ctx);
+ adjust_texture_size_for_convolution(ctx, 1, &postConvWidth, NULL);
+
+ if (copytexsubimage_error_check(ctx, 1, target, level,
+ xoffset, 0, 0, postConvWidth, 1))
+ return;
+
if (ctx->_ImageTransferState || !ctx->Driver.CopyTexSubImage1D
|| !(*ctx->Driver.CopyTexSubImage1D)(ctx, target, level,
xoffset, x, y, width)) {
/* get image from frame buffer */
image = read_color_image(ctx, x, y, width, 1);
if (!image) {
- gl_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage2D" );
+ gl_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage1D" );
return;
}
GLint xoffset, GLint yoffset,
GLint x, GLint y, GLsizei width, GLsizei height )
{
+ GLsizei postConvWidth = width, postConvHeight = height;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCopyTexSubImage2D");
- if (copytexsubimage_error_check(ctx, 2, target, level,
- xoffset, yoffset, 0, width, height))
- return;
-
if (ctx->NewState & _NEW_PIXEL)
gl_update_state(ctx);
+ adjust_texture_size_for_convolution(ctx, 2, &postConvWidth,&postConvHeight);
+
+ if (copytexsubimage_error_check(ctx, 2, target, level, xoffset, yoffset, 0,
+ postConvWidth, postConvHeight))
+ return;
+
if (ctx->_ImageTransferState || !ctx->Driver.CopyTexSubImage2D
|| !(*ctx->Driver.CopyTexSubImage2D)(ctx, target, level,
xoffset, yoffset, x, y, width, height )) {
GLint xoffset, GLint yoffset, GLint zoffset,
GLint x, GLint y, GLsizei width, GLsizei height )
{
+ GLsizei postConvWidth = width, postConvHeight = height;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCopyTexSubImage3D");
- if (copytexsubimage_error_check(ctx, 3, target, level,
- xoffset, yoffset, zoffset, width, height))
- return;
-
if (ctx->NewState & _NEW_PIXEL)
gl_update_state(ctx);
+ adjust_texture_size_for_convolution(ctx, 2, &postConvWidth,&postConvHeight);
+
+ if (copytexsubimage_error_check(ctx, 3, target, level, xoffset, yoffset,
+ zoffset, postConvWidth, postConvHeight))
+ return;
+
if (ctx->_ImageTransferState || !ctx->Driver.CopyTexSubImage3D
|| !(*ctx->Driver.CopyTexSubImage3D)(ctx, target, level,
xoffset, yoffset, zoffset, x, y, width, height )) {