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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include "base/atomicops.h" 7 #include "base/atomicops.h"
8 #include "gpu/command_buffer/common/gles2_cmd_format.h" 8 #include "gpu/command_buffer/common/gles2_cmd_format.h"
9 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 9 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
10 #include "gpu/command_buffer/common/gl_mock.h" 10 #include "gpu/command_buffer/common/gl_mock.h"
(...skipping 4329 matching lines...) Expand 10 before | Expand all | Expand 10 after
4340 ASSERT_TRUE(bucket != NULL); 4340 ASSERT_TRUE(bucket != NULL);
4341 EXPECT_EQ(sizeof(ProgramInfoHeader), bucket->size()); 4341 EXPECT_EQ(sizeof(ProgramInfoHeader), bucket->size());
4342 ProgramInfoHeader* info = bucket->GetDataAs<ProgramInfoHeader*>( 4342 ProgramInfoHeader* info = bucket->GetDataAs<ProgramInfoHeader*>(
4343 0, sizeof(ProgramInfoHeader)); 4343 0, sizeof(ProgramInfoHeader));
4344 ASSERT_TRUE(info != 0); 4344 ASSERT_TRUE(info != 0);
4345 EXPECT_EQ(0u, info->link_status); 4345 EXPECT_EQ(0u, info->link_status);
4346 EXPECT_EQ(0u, info->num_attribs); 4346 EXPECT_EQ(0u, info->num_attribs);
4347 EXPECT_EQ(0u, info->num_uniforms); 4347 EXPECT_EQ(0u, info->num_uniforms);
4348 } 4348 }
4349 4349
4350 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalBindTexture) {
4351 InitDecoder(
4352 "GL_OES_EGL_image_external", // extensions
4353 false, // has alpha
4354 false, // has depth
4355 false, // has stencil
4356 false, // request alpha
4357 false, // request depth
4358 false); // request stencil
4359 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_EXTERNAL_OES, kNewServiceId));
4360 EXPECT_CALL(*gl_, GenTextures(1, _))
4361 .WillOnce(SetArgumentPointee<1>(kNewServiceId));
4362 BindTexture bind;
4363 bind.Init(GL_TEXTURE_EXTERNAL_OES, kNewClientId);
4364 EXPECT_EQ(error::kNoError, ExecuteCmd(bind));
4365 EXPECT_EQ(GL_NO_ERROR, GetGLError());
4366 TextureManager::TextureInfo* info = GetTextureInfo(kNewClientId);
4367 EXPECT_TRUE(info != NULL);
4368 EXPECT_TRUE(info->target() == GL_TEXTURE_EXTERNAL_OES);
4369 }
4370
4371 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureDefaults) {
4372 InitDecoder(
4373 "GL_OES_EGL_image_external", // extensions
4374 false, // has alpha
4375 false, // has depth
4376 false, // has stencil
4377 false, // request alpha
4378 false, // request depth
4379 false); // request stencil
4380 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_EXTERNAL_OES, kNewServiceId));
4381 EXPECT_CALL(*gl_, GenTextures(1, _))
4382 .WillOnce(SetArgumentPointee<1>(kNewServiceId));
4383 BindTexture bind;
4384 bind.Init(GL_TEXTURE_EXTERNAL_OES, kNewClientId);
4385 EXPECT_EQ(error::kNoError, ExecuteCmd(bind));
4386 EXPECT_EQ(GL_NO_ERROR, GetGLError());
4387 TextureManager::TextureInfo* info = GetTextureInfo(kNewClientId);
4388 EXPECT_TRUE(info != NULL);
4389 EXPECT_TRUE(info->target() == GL_TEXTURE_EXTERNAL_OES);
4390 EXPECT_TRUE(info->min_filter() == GL_LINEAR);
4391 EXPECT_TRUE(info->wrap_s() == GL_CLAMP_TO_EDGE);
4392 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
4393 }
4394
4350 // TODO(gman): Complete this test. 4395 // TODO(gman): Complete this test.
4351 // TEST_F(GLES2DecoderTest, CompressedTexImage2DGLError) { 4396 // TEST_F(GLES2DecoderTest, CompressedTexImage2DGLError) {
4352 // } 4397 // }
4353 4398
4354 // TODO(gman): BufferData 4399 // TODO(gman): BufferData
4355 4400
4356 // TODO(gman): BufferDataImmediate 4401 // TODO(gman): BufferDataImmediate
4357 4402
4358 // TODO(gman): BufferSubData 4403 // TODO(gman): BufferSubData
4359 4404
(...skipping 16 matching lines...) Expand all
4376 // TODO(gman): TexImage2DImmediate 4421 // TODO(gman): TexImage2DImmediate
4377 4422
4378 // TODO(gman): TexSubImage2DImmediate 4423 // TODO(gman): TexSubImage2DImmediate
4379 4424
4380 // TODO(gman): UseProgram 4425 // TODO(gman): UseProgram
4381 4426
4382 // TODO(gman): SwapBuffers 4427 // TODO(gman): SwapBuffers
4383 4428
4384 } // namespace gles2 4429 } // namespace gles2
4385 } // namespace gpu 4430 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698