Commit ba4ed7d9 authored by Geoff Lang's avatar Geoff Lang Committed by Commit Bot

Reset GL_PACK_ROW_LENGTH to 0 before calls to glReadPixels.

The client side of the command buffer handles emulation of the
GL_PACK_ROW_LENGTH parameter.

TEST=conformance2/reading/read-pixels-pack-parameters.html

BUG=602688

Change-Id: Id3415d56c565504b423f2a32d91d865274667037
Reviewed-on: https://chromium-review.googlesource.com/567430
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486005}
parent 063509f9
...@@ -201,8 +201,6 @@ class WebGL2ConformanceExpectations(WebGLConformanceExpectations): ...@@ -201,8 +201,6 @@ class WebGL2ConformanceExpectations(WebGLConformanceExpectations):
self.Skip('conformance2/textures/misc/' + self.Skip('conformance2/textures/misc/' +
'copy-texture-image-webgl-specific.html', 'copy-texture-image-webgl-specific.html',
['win', 'passthrough', 'd3d11'], bug=602688) ['win', 'passthrough', 'd3d11'], bug=602688)
self.Skip('conformance2/reading/read-pixels-pack-parameters.html',
['win', 'passthrough', 'd3d11'], bug=602688)
self.Skip('conformance2/reading/read-pixels-into-pixel-pack-buffer.html', self.Skip('conformance2/reading/read-pixels-into-pixel-pack-buffer.html',
['win', 'passthrough', 'd3d11'], bug=602688) ['win', 'passthrough', 'd3d11'], bug=602688)
......
...@@ -250,6 +250,27 @@ class ScopedUnpackStateButAlignmentReset { ...@@ -250,6 +250,27 @@ class ScopedUnpackStateButAlignmentReset {
GLint image_height_ = 0; GLint image_height_ = 0;
}; };
class ScopedPackStateRowLengthReset {
public:
ScopedPackStateRowLengthReset(bool enable) {
if (!enable) {
return;
}
glGetIntegerv(GL_PACK_ROW_LENGTH, &row_length_);
glPixelStorei(GL_PACK_ROW_LENGTH, 0);
}
~ScopedPackStateRowLengthReset() {
if (row_length_ != 0) {
glPixelStorei(GL_PACK_ROW_LENGTH, row_length_);
}
}
private:
GLint row_length_ = 0;
};
} // anonymous namespace } // anonymous namespace
// Implementations of commands // Implementations of commands
...@@ -1757,6 +1778,8 @@ error::Error GLES2DecoderPassthroughImpl::DoReadPixels(GLint x, ...@@ -1757,6 +1778,8 @@ error::Error GLES2DecoderPassthroughImpl::DoReadPixels(GLint x,
void* pixels, void* pixels,
int32_t* success) { int32_t* success) {
FlushErrors(); FlushErrors();
ScopedPackStateRowLengthReset reset_row_length(
bufsize != 0 && feature_info_->gl_version_info().is_es3);
glReadPixelsRobustANGLE(x, y, width, height, format, type, bufsize, length, glReadPixelsRobustANGLE(x, y, width, height, format, type, bufsize, length,
columns, rows, pixels); columns, rows, pixels);
*success = FlushErrors() ? 0 : 1; *success = FlushErrors() ? 0 : 1;
......
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