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

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

Issue 7458008: Support GL_OES_EGL_image_external (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 5 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
Index: gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
index eadfbcd663781b0946dc556ae09a8d9c8aea0031..3e7d91f85743cff2e108c8d0e7b2aa316141258c 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
@@ -4347,6 +4347,51 @@ TEST_F(GLES2DecoderWithShaderTest, GetProgramInfoCHROMIUMInvalidArgs) {
EXPECT_EQ(0u, info->num_uniforms);
}
+TEST_F(GLES2DecoderManualInitTest, EGLImageExternalBindTexture) {
+ InitDecoder(
+ "GL_OES_EGL_image_external", // extensions
+ false, // has alpha
+ false, // has depth
+ false, // has stencil
+ false, // request alpha
+ false, // request depth
+ false); // request stencil
+ EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_EXTERNAL_OES, kNewServiceId));
+ EXPECT_CALL(*gl_, GenTextures(1, _))
+ .WillOnce(SetArgumentPointee<1>(kNewServiceId));
+ BindTexture bind;
+ bind.Init(GL_TEXTURE_EXTERNAL_OES, kNewClientId);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(bind));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ TextureManager::TextureInfo* info = GetTextureInfo(kNewClientId);
+ EXPECT_TRUE(info != NULL);
+ EXPECT_TRUE(info->target() == GL_TEXTURE_EXTERNAL_OES);
+}
+
+TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureDefaults) {
+ InitDecoder(
+ "GL_OES_EGL_image_external", // extensions
+ false, // has alpha
+ false, // has depth
+ false, // has stencil
+ false, // request alpha
+ false, // request depth
+ false); // request stencil
+ EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_EXTERNAL_OES, kNewServiceId));
+ EXPECT_CALL(*gl_, GenTextures(1, _))
+ .WillOnce(SetArgumentPointee<1>(kNewServiceId));
+ BindTexture bind;
+ bind.Init(GL_TEXTURE_EXTERNAL_OES, kNewClientId);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(bind));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ TextureManager::TextureInfo* info = GetTextureInfo(kNewClientId);
+ EXPECT_TRUE(info != NULL);
+ EXPECT_TRUE(info->target() == GL_TEXTURE_EXTERNAL_OES);
+ EXPECT_TRUE(info->min_filter() == GL_LINEAR);
+ EXPECT_TRUE(info->wrap_s() == GL_CLAMP_TO_EDGE);
+ EXPECT_TRUE(info->wrap_t() == GL_CLAMP_TO_EDGE);
no sievers 2011/07/20 00:58:16 Darn, although it's easy to setup the 'default tex
greggman 2011/07/20 01:41:18 Yea, it seems like you need to set the defaults in
no sievers 2011/07/20 23:00:37 That was the place I was looking for. Also elimina
+}
+
// TODO(gman): Complete this test.
// TEST_F(GLES2DecoderTest, CompressedTexImage2DGLError) {
// }

Powered by Google App Engine
This is Rietveld 408576698