Commit 5ec53c82 by Geoff Lang

Handle the remaining pixel unpack parameters in TextureGL.

BUG=angleproject:884 Change-Id: I9e248e623f3b342f878bf65c9686768b90cf5ed8 Reviewed-on: https://chromium-review.googlesource.com/275692Tested-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarBrandon Jones <bajones@chromium.org>
parent afce829a
......@@ -30,6 +30,10 @@ StateManagerGL::StateManagerGL(const FunctionsGL *functions, const gl::Caps &ren
mTextures(),
mUnpackAlignment(4),
mUnpackRowLength(0),
mUnpackSkipRows(0),
mUnpackSkipPixels(0),
mUnpackImageHeight(0),
mUnpackSkipImages(0),
mPackAlignment(4),
mPackRowLength(0),
mPackSkipRows(0),
......@@ -235,7 +239,8 @@ void StateManagerGL::bindTexture(GLenum type, GLuint texture)
}
}
void StateManagerGL::setPixelUnpackState(GLint alignment, GLint rowLength)
void StateManagerGL::setPixelUnpackState(GLint alignment, GLint rowLength, GLint skipRows, GLint skipPixels,
GLint imageHeight, GLint skipImages)
{
if (mUnpackAlignment != alignment)
{
......@@ -248,6 +253,30 @@ void StateManagerGL::setPixelUnpackState(GLint alignment, GLint rowLength)
mUnpackRowLength = rowLength;
mFunctions->pixelStorei(GL_UNPACK_ROW_LENGTH, mUnpackRowLength);
}
if (mUnpackSkipRows != skipRows)
{
mUnpackSkipRows = rowLength;
mFunctions->pixelStorei(GL_UNPACK_SKIP_ROWS, mUnpackSkipRows);
}
if (mUnpackSkipPixels != skipPixels)
{
mUnpackSkipPixels = skipPixels;
mFunctions->pixelStorei(GL_UNPACK_SKIP_PIXELS, mUnpackSkipPixels);
}
if (mUnpackImageHeight != imageHeight)
{
mUnpackImageHeight = imageHeight;
mFunctions->pixelStorei(GL_UNPACK_IMAGE_HEIGHT, mUnpackImageHeight);
}
if (mUnpackSkipImages != skipImages)
{
mUnpackSkipImages = skipImages;
mFunctions->pixelStorei(GL_UNPACK_SKIP_IMAGES, mUnpackSkipImages);
}
}
void StateManagerGL::setPixelPackState(GLint alignment, GLint rowLength, GLint skipRows, GLint skipPixels)
......
......@@ -45,7 +45,8 @@ class StateManagerGL : angle::NonCopyable
void bindBuffer(GLenum type, GLuint buffer);
void activeTexture(size_t unit);
void bindTexture(GLenum type, GLuint texture);
void setPixelUnpackState(GLint alignment, GLint rowLength);
void setPixelUnpackState(GLint alignment, GLint rowLength, GLint skipRows, GLint skipPixels,
GLint imageHeight, GLint skipImages);
void setPixelPackState(GLint alignment, GLint rowLength, GLint skipRows, GLint skipPixels);
void bindFramebuffer(GLenum type, GLuint framebuffer);
void bindRenderbuffer(GLenum type, GLuint renderbuffer);
......@@ -116,6 +117,10 @@ class StateManagerGL : angle::NonCopyable
GLint mUnpackAlignment;
GLint mUnpackRowLength;
GLint mUnpackSkipRows;
GLint mUnpackSkipPixels;
GLint mUnpackImageHeight;
GLint mUnpackSkipImages;
GLint mPackAlignment;
GLint mPackRowLength;
......
......@@ -29,11 +29,8 @@ static void SetUnpackStateForTexImage(StateManagerGL *stateManager, const gl::Pi
{
UNIMPLEMENTED();
}
if (unpack.skipRows != 0 || unpack.skipPixels != 0 || unpack.imageHeight != 0 || unpack.skipImages != 0)
{
UNIMPLEMENTED();
}
stateManager->setPixelUnpackState(unpack.alignment, unpack.rowLength);
stateManager->setPixelUnpackState(unpack.alignment, unpack.rowLength, unpack.skipRows,
unpack.skipPixels, unpack.imageHeight, unpack.skipImages);
}
static bool UseTexImage2D(GLenum textureType)
......
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