diff options
author | vmiura <vmiura@chromium.org> | 2014-12-25 15:11:14 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-25 23:12:02 +0000 |
commit | 188a15c6786087d9be2b0fd92ef05d73b3e8fb27 (patch) | |
tree | c54cc28f70b76ef1794e0213dc492d98b28e792a /cc/test/test_web_graphics_context_3d.cc | |
parent | 2015fdb99a431c52f27706ba0206f942dc21997a (diff) | |
download | chromium_src-188a15c6786087d9be2b0fd92ef05d73b3e8fb27.zip chromium_src-188a15c6786087d9be2b0fd92ef05d73b3e8fb27.tar.gz chromium_src-188a15c6786087d9be2b0fd92ef05d73b3e8fb27.tar.bz2 |
cc: TextureUploader - Reset GL_UNPACK_ALIGNMENT after Gpu Raster.
TextureUploader assumes GL_UNPACK_ALIGNMENT is 4 for performance reasons
however Ganesh may modify GL_UNPACK_ALIGNMENT.
Explicitly reset GL_UNPACK_ALIGNMENT to 4 after Gpu Raster.
BUG=442966
Review URL: https://codereview.chromium.org/817673004
Cr-Commit-Position: refs/heads/master@{#309653}
Diffstat (limited to 'cc/test/test_web_graphics_context_3d.cc')
-rw-r--r-- | cc/test/test_web_graphics_context_3d.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/cc/test/test_web_graphics_context_3d.cc b/cc/test/test_web_graphics_context_3d.cc index 9fae995..2d82f89 100644 --- a/cc/test/test_web_graphics_context_3d.cc +++ b/cc/test/test_web_graphics_context_3d.cc @@ -67,6 +67,7 @@ TestWebGraphicsContext3D::TestWebGraphicsContext3D() last_update_type_(NoUpdate), next_insert_sync_point_(1), last_waited_sync_point_(0), + unpack_alignment_(4), bound_buffer_(0), weak_ptr_factory_(this) { CreateNamespace(); @@ -367,6 +368,8 @@ void TestWebGraphicsContext3D::getIntegerv( *value = max_texture_size_; else if (pname == GL_ACTIVE_TEXTURE) *value = GL_TEXTURE0; + else if (pname == GL_UNPACK_ALIGNMENT) + *value = unpack_alignment_; } void TestWebGraphicsContext3D::getProgramiv(GLuint program, @@ -518,6 +521,28 @@ void TestWebGraphicsContext3D::bufferData(GLenum target, current_used_transfer_buffer_usage_bytes_); } +void TestWebGraphicsContext3D::pixelStorei(GLenum pname, GLint param) { + switch (pname) { + case GL_UNPACK_ALIGNMENT: + // Param should be a power of two <= 8. + EXPECT_EQ(0, param & (param - 1)); + EXPECT_GE(8, param); + switch (param) { + case 1: + case 2: + case 4: + case 8: + unpack_alignment_ = param; + break; + default: + break; + } + break; + default: + break; + } +} + void* TestWebGraphicsContext3D::mapBufferCHROMIUM(GLenum target, GLenum access) { base::AutoLock lock(namespace_->lock); |