OLD | NEW |
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/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/id_allocator.h" | 10 #include "gpu/command_buffer/common/id_allocator.h" |
(...skipping 7921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7932 TEST_F(GLES2DecoderTest, BindTexImage2DCHROMIUM) { | 7932 TEST_F(GLES2DecoderTest, BindTexImage2DCHROMIUM) { |
7933 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 7933 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
7934 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 3, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, | 7934 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 3, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, |
7935 0, 0); | 7935 0, 0); |
7936 TextureRef* texture_ref = group().texture_manager()->GetTexture( | 7936 TextureRef* texture_ref = group().texture_manager()->GetTexture( |
7937 client_texture_id_); | 7937 client_texture_id_); |
7938 ASSERT_TRUE(texture_ref != NULL); | 7938 ASSERT_TRUE(texture_ref != NULL); |
7939 Texture* texture = texture_ref->texture(); | 7939 Texture* texture = texture_ref->texture(); |
7940 EXPECT_EQ(kServiceTextureId, texture->service_id()); | 7940 EXPECT_EQ(kServiceTextureId, texture->service_id()); |
7941 | 7941 |
7942 group().image_manager()->AddImage(gfx::GLImage::CreateGLImage(0), 1); | 7942 group().image_manager()->AddImage(gfx::GLImage::CreateGLImage(0).get(), 1); |
7943 EXPECT_FALSE(group().image_manager()->LookupImage(1) == NULL); | 7943 EXPECT_FALSE(group().image_manager()->LookupImage(1) == NULL); |
7944 | 7944 |
7945 GLsizei width; | 7945 GLsizei width; |
7946 GLsizei height; | 7946 GLsizei height; |
7947 GLenum type; | 7947 GLenum type; |
7948 GLenum internal_format; | 7948 GLenum internal_format; |
7949 | 7949 |
7950 EXPECT_TRUE(texture->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height)); | 7950 EXPECT_TRUE(texture->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height)); |
7951 EXPECT_EQ(3, width); | 7951 EXPECT_EQ(3, width); |
7952 EXPECT_EQ(1, height); | 7952 EXPECT_EQ(1, height); |
(...skipping 26 matching lines...) Expand all Loading... |
7979 TEST_F(GLES2DecoderTest, ReleaseTexImage2DCHROMIUM) { | 7979 TEST_F(GLES2DecoderTest, ReleaseTexImage2DCHROMIUM) { |
7980 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 7980 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
7981 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 3, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, | 7981 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 3, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, |
7982 0, 0); | 7982 0, 0); |
7983 TextureRef* texture_ref = group().texture_manager()->GetTexture( | 7983 TextureRef* texture_ref = group().texture_manager()->GetTexture( |
7984 client_texture_id_); | 7984 client_texture_id_); |
7985 ASSERT_TRUE(texture_ref != NULL); | 7985 ASSERT_TRUE(texture_ref != NULL); |
7986 Texture* texture = texture_ref->texture(); | 7986 Texture* texture = texture_ref->texture(); |
7987 EXPECT_EQ(kServiceTextureId, texture->service_id()); | 7987 EXPECT_EQ(kServiceTextureId, texture->service_id()); |
7988 | 7988 |
7989 group().image_manager()->AddImage(gfx::GLImage::CreateGLImage(0), 1); | 7989 group().image_manager()->AddImage(gfx::GLImage::CreateGLImage(0).get(), 1); |
7990 EXPECT_FALSE(group().image_manager()->LookupImage(1) == NULL); | 7990 EXPECT_FALSE(group().image_manager()->LookupImage(1) == NULL); |
7991 | 7991 |
7992 GLsizei width; | 7992 GLsizei width; |
7993 GLsizei height; | 7993 GLsizei height; |
7994 GLenum type; | 7994 GLenum type; |
7995 GLenum internal_format; | 7995 GLenum internal_format; |
7996 | 7996 |
7997 EXPECT_TRUE(texture->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height)); | 7997 EXPECT_TRUE(texture->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height)); |
7998 EXPECT_EQ(3, width); | 7998 EXPECT_EQ(3, width); |
7999 EXPECT_EQ(1, height); | 7999 EXPECT_EQ(1, height); |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8639 // TODO(gman): TexImage2DImmediate | 8639 // TODO(gman): TexImage2DImmediate |
8640 | 8640 |
8641 // TODO(gman): TexSubImage2DImmediate | 8641 // TODO(gman): TexSubImage2DImmediate |
8642 | 8642 |
8643 // TODO(gman): UseProgram | 8643 // TODO(gman): UseProgram |
8644 | 8644 |
8645 // TODO(gman): SwapBuffers | 8645 // TODO(gman): SwapBuffers |
8646 | 8646 |
8647 } // namespace gles2 | 8647 } // namespace gles2 |
8648 } // namespace gpu | 8648 } // namespace gpu |
OLD | NEW |