| Index: gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc
|
| diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc
|
| index e250553aba61d6018a5a16abead22ca3940f83a2..0b167790a8878e26f804351e11257870c9b15da5 100644
|
| --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc
|
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc
|
| @@ -1342,7 +1342,7 @@ TEST_P(GLES3DecoderTest, CopyTexSubImage3DFeedbackLoopFails) {
|
| // The source and the target for CopyTexSubImage3D are the same 3d texture.
|
| // And level / zoffset of 3D texture equal to level / layer of read attachment
|
| // in fbo.
|
| - GLint kLevel = 1;
|
| + GLint kLevel = 0; // This has to be base level, or fbo is incomplete.
|
| GLint kLayer = 0; // kZoffset is 0
|
| EXPECT_CALL(*gl_, FramebufferTextureLayer(GL_FRAMEBUFFER,
|
| GL_COLOR_ATTACHMENT0,
|
| @@ -4400,24 +4400,36 @@ class GLES2DecoderTexStorageFormatAndTypeTest
|
| void DoTexStorageFormatAndType(const InitState& init,
|
| GLenum format,
|
| GLenum adjusted_internal_format) {
|
| + GLsizei kWidth = 512;
|
| + GLsizei kHeight = 512;
|
| + // Purposely set kLevels to be smaller than 10 = log2(512) + 1.
|
| + GLsizei kLevels = 5;
|
| InitDecoder(init);
|
| DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
|
| - EXPECT_CALL(*gl_, TexStorage2DEXT(GL_TEXTURE_2D, 2, format, 2, 2))
|
| + EXPECT_CALL(
|
| + *gl_, TexStorage2DEXT(GL_TEXTURE_2D, kLevels, format, kWidth, kHeight))
|
| .Times(1)
|
| .RetiresOnSaturation();
|
| TexStorage2DEXT cmd;
|
| - cmd.Init(GL_TEXTURE_2D, 2, format, 2, 2);
|
| + cmd.Init(GL_TEXTURE_2D, kLevels, format, kWidth, kHeight);
|
| EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| TextureRef* texture_ref =
|
| group().texture_manager()->GetTexture(client_texture_id_);
|
| Texture* texture = texture_ref->texture();
|
| - GLenum type;
|
| - GLenum internal_format;
|
| - EXPECT_TRUE(
|
| - texture->GetLevelType(GL_TEXTURE_2D, 0, &type, &internal_format));
|
| - EXPECT_EQ(static_cast<GLenum>(adjusted_internal_format), internal_format);
|
| - EXPECT_EQ(static_cast<GLenum>(GL_UNSIGNED_BYTE), type);
|
| + for (GLsizei ii = 0; ii < kLevels; ++ii) {
|
| + GLenum type = 0, internal_format = 0;
|
| + GLsizei level_width = 0, level_height = 0;
|
| + EXPECT_TRUE(texture->GetLevelType(GL_TEXTURE_2D, static_cast<GLint>(ii),
|
| + &type, &internal_format));
|
| + EXPECT_EQ(static_cast<GLenum>(adjusted_internal_format), internal_format);
|
| + EXPECT_EQ(static_cast<GLenum>(GL_UNSIGNED_BYTE), type);
|
| + EXPECT_TRUE(texture->GetLevelSize(GL_TEXTURE_2D, static_cast<GLint>(ii),
|
| + &level_width, &level_height, nullptr));
|
| + EXPECT_EQ(kWidth >> ii, level_width);
|
| + EXPECT_EQ(kHeight >> ii, level_height);
|
| + }
|
| + EXPECT_TRUE(texture->texture_complete());
|
| }
|
| };
|
|
|
|
|