Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc

Issue 2693273002: Handle GLES2::ConsumeTextureCHROMIUM consuming the currently bound texture. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698