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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc

Issue 180723023: gpu: Mailbox emulation with EGLImage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 6 years, 9 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "gpu/command_buffer/common/gles2_cmd_format.h" 9 #include "gpu/command_buffer/common/gles2_cmd_format.h"
10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 10 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
(...skipping 7853 matching lines...) Expand 10 before | Expand all | Expand 10 after
7864 TEST_F(GLES2DecoderTest, BindTexImage2DCHROMIUMCubeMapNotAllowed) { 7864 TEST_F(GLES2DecoderTest, BindTexImage2DCHROMIUMCubeMapNotAllowed) {
7865 group().image_manager()->AddImage(gfx::GLImage::CreateGLImage(0).get(), 1); 7865 group().image_manager()->AddImage(gfx::GLImage::CreateGLImage(0).get(), 1);
7866 DoBindTexture(GL_TEXTURE_CUBE_MAP, client_texture_id_, kServiceTextureId); 7866 DoBindTexture(GL_TEXTURE_CUBE_MAP, client_texture_id_, kServiceTextureId);
7867 7867
7868 BindTexImage2DCHROMIUM bind_tex_image_2d_cmd; 7868 BindTexImage2DCHROMIUM bind_tex_image_2d_cmd;
7869 bind_tex_image_2d_cmd.Init(GL_TEXTURE_CUBE_MAP, 1); 7869 bind_tex_image_2d_cmd.Init(GL_TEXTURE_CUBE_MAP, 1);
7870 EXPECT_EQ(error::kNoError, ExecuteCmd(bind_tex_image_2d_cmd)); 7870 EXPECT_EQ(error::kNoError, ExecuteCmd(bind_tex_image_2d_cmd));
7871 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); 7871 EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
7872 } 7872 }
7873 7873
7874 TEST_F(GLES2DecoderTest, OrphanGLImageWithTexImage2D) {
7875 group().image_manager()->AddImage(gfx::GLImage::CreateGLImage(0).get(), 1);
7876 DoBindTexture(GL_TEXTURE_CUBE_MAP, client_texture_id_, kServiceTextureId);
7877
7878 BindTexImage2DCHROMIUM bind_tex_image_2d_cmd;
7879 bind_tex_image_2d_cmd.Init(GL_TEXTURE_CUBE_MAP, 1);
7880 EXPECT_EQ(error::kNoError, ExecuteCmd(bind_tex_image_2d_cmd));
7881 EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
7882
7883 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 3, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE,
7884 0, 0);
7885 TextureRef* texture_ref = group().texture_manager()->GetTexture(
7886 client_texture_id_);
7887 ASSERT_TRUE(texture_ref != NULL);
7888 Texture* texture = texture_ref->texture();
7889 EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == NULL);
7890 }
7891
7874 TEST_F(GLES2DecoderTest, ReleaseTexImage2DCHROMIUM) { 7892 TEST_F(GLES2DecoderTest, ReleaseTexImage2DCHROMIUM) {
7875 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); 7893 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
7876 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 3, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 7894 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 3, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE,
7877 0, 0); 7895 0, 0);
7878 TextureRef* texture_ref = group().texture_manager()->GetTexture( 7896 TextureRef* texture_ref = group().texture_manager()->GetTexture(
7879 client_texture_id_); 7897 client_texture_id_);
7880 ASSERT_TRUE(texture_ref != NULL); 7898 ASSERT_TRUE(texture_ref != NULL);
7881 Texture* texture = texture_ref->texture(); 7899 Texture* texture = texture_ref->texture();
7882 EXPECT_EQ(kServiceTextureId, texture->service_id()); 7900 EXPECT_EQ(kServiceTextureId, texture->service_id());
7883 7901
(...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after
9213 // TODO(gman): TexImage2DImmediate 9231 // TODO(gman): TexImage2DImmediate
9214 9232
9215 // TODO(gman): TexSubImage2DImmediate 9233 // TODO(gman): TexSubImage2DImmediate
9216 9234
9217 // TODO(gman): UseProgram 9235 // TODO(gman): UseProgram
9218 9236
9219 // TODO(gman): SwapBuffers 9237 // TODO(gman): SwapBuffers
9220 9238
9221 } // namespace gles2 9239 } // namespace gles2
9222 } // namespace gpu 9240 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | gpu/command_buffer/service/in_process_command_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698