summaryrefslogtreecommitdiff
path: root/chromium/gpu/command_buffer
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-06-05 17:27:05 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-06-18 08:33:46 +0000
commit9f4560b1027ae06fdb497023cdcaf91b8511fa74 (patch)
treef9789c1b2941956c5cc104cf03c6b6cc93759152 /chromium/gpu/command_buffer
parentd17ea114e5ef69ad5d5d7413280a13e6428098aa (diff)
downloadqtwebengine-chromium-9f4560b1027ae06fdb497023cdcaf91b8511fa74.tar.gz
BASELINE: Update Chromium to 67.0.3396.76
Change-Id: I9a14af4efb092ab203e9364f0779fca781909a38 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'chromium/gpu/command_buffer')
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder.cc5
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc38
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h8
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc43
4 files changed, 63 insertions, 31 deletions
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder.cc b/chromium/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 1f86d22f500..b1976ea7d0d 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -14753,7 +14753,10 @@ void GLES2DecoderImpl::DoCopyTexImage2D(
}
if (src.x() != x || src.y() != y ||
- src.width() != width || src.height() != height) {
+ src.width() != width || src.height() != height ||
+ final_internal_format == GL_BGRA_EXT) {
+ // GL_BGRA_EXT is not allowed as internalformat for glCopyTexImage2D,
+ // which is a bit of a quirk in the spec, but this path works.
{
// Add extra scope to destroy zero and the object it owns right
// after its usage.
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
index 5aa853b9f1f..54971241efb 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
@@ -1516,6 +1516,44 @@ void GLES2DecoderTestBase::DoTexImage3D(GLenum target,
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
}
+void GLES2DecoderTestBase::DoCopyTexImage2D(
+ GLenum target,
+ GLint level,
+ GLenum internal_format,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height,
+ GLint border) {
+ // For GL_BGRA_EXT, we have to fall back to TexImage2D and
+ // CopyTexSubImage2D, since GL_BGRA_EXT is not accepted by CopyTexImage2D.
+ // In some cases this fallback further triggers set and restore of
+ // GL_UNPACK_ALIGNMENT.
+ if (internal_format == GL_BGRA_EXT) {
+ EXPECT_CALL(*gl_, PixelStorei(GL_UNPACK_ALIGNMENT, _))
+ .Times(2)
+ .RetiresOnSaturation();
+
+ EXPECT_CALL(*gl_, TexImage2D(target, level, internal_format,
+ width, height, border,
+ internal_format, GL_UNSIGNED_BYTE, _))
+ .Times(1)
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, CopyTexSubImage2D(target, level, 0, 0, 0, 0,
+ width, height))
+ .Times(1)
+ .RetiresOnSaturation();
+ } else {
+ EXPECT_CALL(*gl_, CopyTexImage2D(target, level, internal_format, 0, 0,
+ width, height, border))
+ .Times(1)
+ .RetiresOnSaturation();
+ }
+ cmds::CopyTexImage2D cmd;
+ cmd.Init(target, level, internal_format, 0, 0, width, height);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+}
+
void GLES2DecoderTestBase::DoRenderbufferStorage(
GLenum target, GLenum internal_format, GLenum actual_format,
GLsizei width, GLsizei height, GLenum error) {
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
index bcc64f7a0dc..98622b5a2a2 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
@@ -366,6 +366,14 @@ class GLES2DecoderTestBase : public ::testing::TestWithParam<bool>,
GLenum type,
uint32_t shared_memory_id,
uint32_t shared_memory_offset);
+ void DoCopyTexImage2D(GLenum target,
+ GLint level,
+ GLenum internal_format,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height,
+ GLint border);
void DoRenderbufferStorage(
GLenum target, GLenum internal_format, GLenum actual_format,
GLsizei width, GLsizei height, GLenum error);
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc
index 9aa5db650a6..64beb12d588 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc
@@ -699,13 +699,7 @@ TEST_P(GLES2DecoderManualInitTest, CopyTexImage2DUnsizedInternalFormat) {
DoBindFramebuffer(GL_FRAMEBUFFER, 0, 0);
GLenum internal_format = kUnsizedInternalFormats[i];
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
- EXPECT_CALL(*gl_, CopyTexImage2D(target, level, internal_format, 0, 0,
- width, height, border))
- .Times(1)
- .RetiresOnSaturation();
- CopyTexImage2D cmd;
- cmd.Init(target, level, internal_format, 0, 0, width, height);
- EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ DoCopyTexImage2D(target, level, internal_format, 0, 0, width, height, border);
EXPECT_EQ(GL_NO_ERROR, GetGLError());
TextureRef* ref = manager->GetTexture(client_texture_id_);
@@ -732,16 +726,13 @@ TEST_P(GLES2DecoderManualInitTest, CopyTexImage2DUnsizedInternalFormat) {
bool complete =
(DoCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE);
if (complete) {
- EXPECT_CALL(*gl_, CopyTexImage2D(target, level, internal_format, 0, 0,
- width, height, border))
- .Times(1)
- .RetiresOnSaturation();
- }
- cmd.Init(target, level, internal_format, 0, 0, width, height);
- EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
- if (complete) {
+ DoCopyTexImage2D(target, level, internal_format,
+ 0, 0, width, height, border);
EXPECT_EQ(GL_NO_ERROR, GetGLError());
} else {
+ CopyTexImage2D cmd;
+ cmd.Init(target, level, internal_format, 0, 0, width, height);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_INVALID_FRAMEBUFFER_OPERATION, GetGLError());
}
}
@@ -789,13 +780,8 @@ TEST_P(GLES2DecoderManualInitTest, CopyTexImage2DUnsizedInternalFormatES3) {
DoBindFramebuffer(GL_FRAMEBUFFER, 0, 0);
GLenum internal_format = kUnsizedInternalFormats[i].unsized;
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
- EXPECT_CALL(*gl_, CopyTexImage2D(target, level, internal_format, 0, 0,
- width, height, border))
- .Times(1)
- .RetiresOnSaturation();
- CopyTexImage2D cmd;
- cmd.Init(target, level, internal_format, 0, 0, width, height);
- EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ DoCopyTexImage2D(target, level, internal_format,
+ 0, 0, width, height, border);
EXPECT_EQ(GL_NO_ERROR, GetGLError());
TextureRef* ref = manager->GetTexture(client_texture_id_);
@@ -827,16 +813,13 @@ TEST_P(GLES2DecoderManualInitTest, CopyTexImage2DUnsizedInternalFormatES3) {
bool complete =
(DoCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE);
if (complete) {
- EXPECT_CALL(*gl_, CopyTexImage2D(target, level, internal_format, 0, 0,
- width, height, border))
- .Times(1)
- .RetiresOnSaturation();
- }
- cmd.Init(target, level, internal_format, 0, 0, width, height);
- EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
- if (complete) {
+ DoCopyTexImage2D(target, level, internal_format,
+ 0, 0, width, height, border);
EXPECT_EQ(GL_NO_ERROR, GetGLError());
} else {
+ CopyTexImage2D cmd;
+ cmd.Init(target, level, internal_format, 0, 0, width, height);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_INVALID_FRAMEBUFFER_OPERATION, GetGLError());
}
}