| 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 266869dfdb44b51bf0aeddbf1500af73cfd029b4..e7a689dd7a29a6ee44c8dc73692d1dc0a55b3f78 100644
|
| --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc
|
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc
|
| @@ -3267,6 +3267,38 @@ TEST_P(GLES2DecoderTest, ProduceAndConsumeTextureCHROMIUM) {
|
| EXPECT_EQ(kServiceTextureId, texture->service_id());
|
| }
|
|
|
| +TEST_P(GLES2DecoderTest, ConsumeAlreadyBoundTexture) {
|
| + Mailbox mailbox = Mailbox::Generate();
|
| +
|
| + DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
|
| + DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 3, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0,
|
| + 0);
|
| +
|
| + TextureRef* texture_ref1 =
|
| + group().texture_manager()->GetTexture(client_texture_id_);
|
| +
|
| + ProduceTextureCHROMIUMImmediate& produce_cmd =
|
| + *GetImmediateAs<ProduceTextureCHROMIUMImmediate>();
|
| + produce_cmd.Init(GL_TEXTURE_2D, mailbox.name);
|
| + EXPECT_EQ(error::kNoError,
|
| + ExecuteImmediateCmd(produce_cmd, sizeof(mailbox.name)));
|
| + EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| +
|
| + // Consume texture that is already bound. Operation should succeed, leaving
|
| + // existing texture bound with no extra GL calls expected.
|
| + ConsumeTextureCHROMIUMImmediate& consume_cmd =
|
| + *GetImmediateAs<ConsumeTextureCHROMIUMImmediate>();
|
| + consume_cmd.Init(GL_TEXTURE_2D, mailbox.name);
|
| + EXPECT_EQ(error::kNoError,
|
| + ExecuteImmediateCmd(consume_cmd, sizeof(mailbox.name)));
|
| + EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| +
|
| + TextureRef* texture_ref2 =
|
| + group().texture_manager()->GetTexture(client_texture_id_);
|
| +
|
| + EXPECT_EQ(texture_ref1, texture_ref2);
|
| +}
|
| +
|
| TEST_P(GLES2DecoderTest, ProduceAndConsumeDirectTextureCHROMIUM) {
|
| Mailbox mailbox = Mailbox::Generate();
|
|
|
|
|