Commit 48590358 by Jeff Gilbert Committed by Commit Bot

Remove formatType arg from computeCompressedImageSize.

BUG=angleproject:2230 Change-Id: Ie291ba05efa89bc4ea52966e975d5a21431a461f Reviewed-on: https://chromium-review.googlesource.com/757877 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent cac94a91
......@@ -1075,7 +1075,7 @@ ErrorOrResult<GLuint> InternalFormat::computeRowPitch(GLenum formatType,
if (compressed)
{
ASSERT(rowLength == 0);
return computeCompressedImageSize(formatType, Extents(width, 1, 1));
return computeCompressedImageSize(Extents(width, 1, 1));
}
CheckedNumeric<GLuint> checkedWidth(rowLength > 0 ? rowLength : width);
......@@ -1113,8 +1113,7 @@ ErrorOrResult<GLuint> InternalFormat::computeDepthPitch(GLenum formatType,
return computeDepthPitch(height, imageHeight, rowPitch);
}
ErrorOrResult<GLuint> InternalFormat::computeCompressedImageSize(GLenum formatType,
const Extents &size) const
ErrorOrResult<GLuint> InternalFormat::computeCompressedImageSize(const Extents &size) const
{
CheckedNumeric<GLuint> checkedWidth(size.width);
CheckedNumeric<GLuint> checkedHeight(size.height);
......@@ -1171,7 +1170,7 @@ ErrorOrResult<GLuint> InternalFormat::computePackUnpackEndByte(
CheckedNumeric<GLuint> checkedCopyBytes = 0;
if (compressed)
{
ANGLE_TRY_RESULT(computeCompressedImageSize(formatType, size), checkedCopyBytes);
ANGLE_TRY_RESULT(computeCompressedImageSize(size), checkedCopyBytes);
}
else if (size.height != 0 && (!is3D || size.depth != 0))
{
......
......@@ -68,8 +68,7 @@ struct InternalFormat
GLint rowLength,
GLint imageHeight) const;
ErrorOrResult<GLuint> computeCompressedImageSize(GLenum formatType,
const Extents &size) const;
ErrorOrResult<GLuint> computeCompressedImageSize(const Extents &size) const;
ErrorOrResult<GLuint> computeSkipBytes(GLuint rowPitch,
GLuint depthPitch,
......
......@@ -852,8 +852,7 @@ gl::Error TextureGL::setStorage(const gl::Context *context,
internalFormat);
GLuint dataSize = 0;
ANGLE_TRY_RESULT(internalFormatInfo.computeCompressedImageSize(
GL_UNSIGNED_BYTE, levelSize),
ANGLE_TRY_RESULT(internalFormatInfo.computeCompressedImageSize(levelSize),
dataSize);
mFunctions->compressedTexImage2D(target, static_cast<GLint>(level),
compressedTexImageFormat.format,
......@@ -883,8 +882,7 @@ gl::Error TextureGL::setStorage(const gl::Context *context,
internalFormat);
GLuint dataSize = 0;
ANGLE_TRY_RESULT(internalFormatInfo.computeCompressedImageSize(
GL_UNSIGNED_BYTE, levelSize),
ANGLE_TRY_RESULT(internalFormatInfo.computeCompressedImageSize(levelSize),
dataSize);
mFunctions->compressedTexImage2D(
face, static_cast<GLint>(level), compressedTexImageFormat.format,
......@@ -944,7 +942,7 @@ gl::Error TextureGL::setStorage(const gl::Context *context,
GLuint dataSize = 0;
ANGLE_TRY_RESULT(
internalFormatInfo.computeCompressedImageSize(GL_UNSIGNED_BYTE, levelSize),
internalFormatInfo.computeCompressedImageSize(levelSize),
dataSize);
mFunctions->compressedTexImage3D(target, i, compressedTexImageFormat.format,
levelSize.width, levelSize.height,
......
......@@ -2713,8 +2713,7 @@ bool ValidateCompressedTexImage2D(Context *context,
}
const InternalFormat &formatInfo = GetSizedInternalFormatInfo(internalformat);
auto blockSizeOrErr =
formatInfo.computeCompressedImageSize(GL_UNSIGNED_BYTE, gl::Extents(width, height, 1));
auto blockSizeOrErr = formatInfo.computeCompressedImageSize(gl::Extents(width, height, 1));
if (blockSizeOrErr.isError())
{
context->handleError(blockSizeOrErr.getError());
......@@ -2807,8 +2806,7 @@ bool ValidateCompressedTexSubImage2D(Context *context,
}
const InternalFormat &formatInfo = GetSizedInternalFormatInfo(format);
auto blockSizeOrErr =
formatInfo.computeCompressedImageSize(GL_UNSIGNED_BYTE, gl::Extents(width, height, 1));
auto blockSizeOrErr = formatInfo.computeCompressedImageSize(gl::Extents(width, height, 1));
if (blockSizeOrErr.isError())
{
context->handleError(blockSizeOrErr.getError());
......
......@@ -1386,8 +1386,7 @@ bool ValidateCompressedTexImage3D(Context *context,
return false;
}
auto blockSizeOrErr =
formatInfo.computeCompressedImageSize(GL_UNSIGNED_BYTE, gl::Extents(width, height, depth));
auto blockSizeOrErr = formatInfo.computeCompressedImageSize(gl::Extents(width, height, depth));
if (blockSizeOrErr.isError())
{
context->handleError(InvalidValue());
......@@ -2015,8 +2014,7 @@ bool ValidateCompressedTexSubImage3D(Context *context,
return false;
}
auto blockSizeOrErr =
formatInfo.computeCompressedImageSize(GL_UNSIGNED_BYTE, gl::Extents(width, height, depth));
auto blockSizeOrErr = formatInfo.computeCompressedImageSize(gl::Extents(width, height, depth));
if (blockSizeOrErr.isError())
{
context->handleError(blockSizeOrErr.getError());
......
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