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

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

Issue 1344373004: TexSubImage2D no longer needs to match the type in ES3. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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') | gpu/command_buffer/service/texture_manager.h » ('j') | 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 90a81b0a0ad07918f4ac0d09b26baa88640d4478..1b30d0ba43dd00caf8d5e2e43254daaafd7e8106 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc
@@ -402,6 +402,90 @@ TEST_P(GLES2DecoderTest, TexSubImage2DBadArgs) {
EXPECT_NE(error::kNoError, ExecuteCmd(cmd));
}
+TEST_P(GLES3DecoderTest, TexSubImage2DTypesDoNotMatchUnsizedFormat) {
+ const int kWidth = 16;
+ const int kHeight = 8;
+ DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
+ DoTexImage2D(GL_TEXTURE_2D,
+ 1,
+ GL_RGBA,
+ kWidth,
+ kHeight,
+ 0,
+ GL_RGBA,
+ GL_UNSIGNED_SHORT_4_4_4_4,
+ kSharedMemoryId,
+ kSharedMemoryOffset);
+ EXPECT_CALL(*gl_,
+ TexSubImage2D(GL_TEXTURE_2D,
+ 1,
+ 1,
+ 0,
+ kWidth - 1,
+ kHeight,
+ GL_RGBA,
+ GL_UNSIGNED_BYTE,
+ shared_memory_address_))
+ .Times(1)
+ .RetiresOnSaturation();
+ TexSubImage2D cmd;
+ cmd.Init(GL_TEXTURE_2D,
+ 1,
+ 1,
+ 0,
+ kWidth - 1,
+ kHeight,
+ GL_RGBA,
+ GL_UNSIGNED_BYTE,
+ kSharedMemoryId,
+ kSharedMemoryOffset,
+ GL_FALSE);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
+TEST_P(GLES3DecoderTest, TexSubImage2DTypesDoNotMatchSizedFormat) {
+ const int kWidth = 16;
+ const int kHeight = 8;
+ DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
+ DoTexImage2D(GL_TEXTURE_2D,
+ 1,
+ GL_RGBA4,
+ kWidth,
+ kHeight,
+ 0,
+ GL_RGBA,
+ GL_UNSIGNED_BYTE,
+ kSharedMemoryId,
+ kSharedMemoryOffset);
+ EXPECT_CALL(*gl_,
+ TexSubImage2D(GL_TEXTURE_2D,
+ 1,
+ 1,
+ 0,
+ kWidth - 1,
+ kHeight,
+ GL_RGBA,
+ GL_UNSIGNED_SHORT_4_4_4_4,
+ shared_memory_address_))
+ .Times(1)
+ .RetiresOnSaturation();
+ TexSubImage2D cmd;
+ cmd.Init(GL_TEXTURE_2D,
+ 1,
+ 1,
+ 0,
+ kWidth - 1,
+ kHeight,
+ GL_RGBA,
+ GL_UNSIGNED_SHORT_4_4_4_4,
+ kSharedMemoryId,
+ kSharedMemoryOffset,
+ GL_FALSE);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
TEST_P(GLES2DecoderTest, CopyTexSubImage2DValidArgs) {
const int kWidth = 16;
const int kHeight = 8;
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | gpu/command_buffer/service/texture_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698