Remove duplicate error checks from Texture subImage and subImageCompressed.

Issue=306 Signed-of-by: Nicolas Capens These errors are validated by validateSubImageParams* now, no need to do it twice. git-svn-id: https://angleproject.googlecode.com/svn/trunk@1083 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 4df88e8a
#define MAJOR_VERSION 1 #define MAJOR_VERSION 1
#define MINOR_VERSION 0 #define MINOR_VERSION 0
#define BUILD_VERSION 0 #define BUILD_VERSION 0
#define BUILD_REVISION 1074 #define BUILD_REVISION 1083
#define STRINGIFY(x) #x #define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x) #define MACRO_STRINGIFY(x) STRINGIFY(x)
......
...@@ -1534,24 +1534,6 @@ void Texture::setCompressedImage(GLsizei imageSize, const void *pixels, Image *i ...@@ -1534,24 +1534,6 @@ void Texture::setCompressedImage(GLsizei imageSize, const void *pixels, Image *i
bool Texture::subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *image) bool Texture::subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *image)
{ {
if (width + xoffset > image->getWidth() || height + yoffset > image->getHeight())
{
error(GL_INVALID_VALUE);
return false;
}
if (IsCompressed(image->getFormat()))
{
error(GL_INVALID_OPERATION);
return false;
}
if (format != image->getFormat())
{
error(GL_INVALID_OPERATION);
return false;
}
if (pixels != NULL) if (pixels != NULL)
{ {
image->loadData(xoffset, yoffset, width, height, type, unpackAlignment, pixels); image->loadData(xoffset, yoffset, width, height, type, unpackAlignment, pixels);
...@@ -1563,12 +1545,6 @@ bool Texture::subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei heig ...@@ -1563,12 +1545,6 @@ bool Texture::subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei heig
bool Texture::subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *image) bool Texture::subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *image)
{ {
if (width + xoffset > image->getWidth() || height + yoffset > image->getHeight())
{
error(GL_INVALID_VALUE);
return false;
}
if (pixels != NULL) if (pixels != NULL)
{ {
image->loadCompressedData(xoffset, yoffset, width, height, pixels); image->loadCompressedData(xoffset, yoffset, width, height, pixels);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment