| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 3853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3864 ASSERT_TRUE(texture_ref != NULL); | 3864 ASSERT_TRUE(texture_ref != NULL); |
| 3865 Texture* texture = texture_ref->texture(); | 3865 Texture* texture = texture_ref->texture(); |
| 3866 EXPECT_EQ(kServiceTextureId, texture->service_id()); | 3866 EXPECT_EQ(kServiceTextureId, texture->service_id()); |
| 3867 | 3867 |
| 3868 const int32_t kImageId = 1; | 3868 const int32_t kImageId = 1; |
| 3869 scoped_refptr<MockGLImage> image(new MockGLImage); | 3869 scoped_refptr<MockGLImage> image(new MockGLImage); |
| 3870 GetImageManager()->AddImage(image.get(), kImageId); | 3870 GetImageManager()->AddImage(image.get(), kImageId); |
| 3871 | 3871 |
| 3872 // Bind image to texture. | 3872 // Bind image to texture. |
| 3873 EXPECT_CALL(*image.get(), BindTexImage(GL_TEXTURE_2D)) | 3873 EXPECT_CALL(*image.get(), BindTexImage(GL_TEXTURE_2D)) |
| 3874 .Times(1) | 3874 .Times(2) |
| 3875 .WillOnce(Return(false)) | 3875 .WillRepeatedly(Return(false)) |
| 3876 .RetiresOnSaturation(); | 3876 .RetiresOnSaturation(); |
| 3877 EXPECT_CALL(*image.get(), GetSize()) | 3877 EXPECT_CALL(*image.get(), GetSize()) |
| 3878 .Times(1) | 3878 .Times(1) |
| 3879 .WillOnce(Return(gfx::Size(1, 1))) | 3879 .WillOnce(Return(gfx::Size(1, 1))) |
| 3880 .RetiresOnSaturation(); | 3880 .RetiresOnSaturation(); |
| 3881 EXPECT_CALL(*image.get(), GetInternalFormat()) | 3881 EXPECT_CALL(*image.get(), GetInternalFormat()) |
| 3882 .Times(1) | 3882 .Times(1) |
| 3883 .WillOnce(Return(GL_RGBA)) | 3883 .WillOnce(Return(GL_RGBA)) |
| 3884 .RetiresOnSaturation(); | 3884 .RetiresOnSaturation(); |
| 3885 // ScopedGLErrorSuppressor calls GetError on its constructor and destructor. | 3885 // ScopedGLErrorSuppressor calls GetError on its constructor and destructor. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 3900 .RetiresOnSaturation(); | 3900 .RetiresOnSaturation(); |
| 3901 EXPECT_CALL(*gl_, DrawArrays(GL_TRIANGLES, 0, kNumVertices)) | 3901 EXPECT_CALL(*gl_, DrawArrays(GL_TRIANGLES, 0, kNumVertices)) |
| 3902 .Times(1) | 3902 .Times(1) |
| 3903 .RetiresOnSaturation(); | 3903 .RetiresOnSaturation(); |
| 3904 DrawArrays cmd; | 3904 DrawArrays cmd; |
| 3905 cmd.Init(GL_TRIANGLES, 0, kNumVertices); | 3905 cmd.Init(GL_TRIANGLES, 0, kNumVertices); |
| 3906 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 3906 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 3907 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 3907 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 3908 | 3908 |
| 3909 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 3909 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 3910 |
| 3911 Mock::VerifyAndClearExpectations(gl_.get()); |
| 3910 // Re-bind image to texture. | 3912 // Re-bind image to texture. |
| 3911 ReleaseTexImage2DCHROMIUM release_tex_image_2d_cmd; | 3913 ReleaseTexImage2DCHROMIUM release_tex_image_2d_cmd; |
| 3912 release_tex_image_2d_cmd.Init(GL_TEXTURE_2D, kImageId); | 3914 release_tex_image_2d_cmd.Init(GL_TEXTURE_2D, kImageId); |
| 3913 EXPECT_EQ(error::kNoError, ExecuteCmd(release_tex_image_2d_cmd)); | 3915 EXPECT_EQ(error::kNoError, ExecuteCmd(release_tex_image_2d_cmd)); |
| 3914 EXPECT_CALL(*image.get(), BindTexImage(GL_TEXTURE_2D)) | 3916 EXPECT_CALL(*image.get(), BindTexImage(GL_TEXTURE_2D)) |
| 3915 .Times(1) | 3917 .Times(2) |
| 3916 .WillOnce(Return(false)) | 3918 .WillRepeatedly(Return(false)) |
| 3917 .RetiresOnSaturation(); | 3919 .RetiresOnSaturation(); |
| 3918 EXPECT_CALL(*image.get(), GetSize()) | 3920 EXPECT_CALL(*image.get(), GetSize()) |
| 3919 .Times(1) | 3921 .Times(1) |
| 3920 .WillOnce(Return(gfx::Size(1, 1))) | 3922 .WillOnce(Return(gfx::Size(1, 1))) |
| 3921 .RetiresOnSaturation(); | 3923 .RetiresOnSaturation(); |
| 3922 EXPECT_CALL(*image.get(), GetInternalFormat()) | 3924 EXPECT_CALL(*image.get(), GetInternalFormat()) |
| 3923 .Times(1) | 3925 .Times(1) |
| 3924 .WillOnce(Return(GL_RGBA)) | 3926 .WillOnce(Return(GL_RGBA)) |
| 3925 .RetiresOnSaturation(); | 3927 .RetiresOnSaturation(); |
| 3926 DoBindTexImage2DCHROMIUM(GL_TEXTURE_2D, kImageId); | 3928 DoBindTexImage2DCHROMIUM(GL_TEXTURE_2D, kImageId); |
| (...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4954 // TODO(gman): CompressedTexSubImage2DImmediate | 4956 // TODO(gman): CompressedTexSubImage2DImmediate |
| 4955 | 4957 |
| 4956 // TODO(gman): TexImage2D | 4958 // TODO(gman): TexImage2D |
| 4957 | 4959 |
| 4958 // TODO(gman): TexImage2DImmediate | 4960 // TODO(gman): TexImage2DImmediate |
| 4959 | 4961 |
| 4960 // TODO(gman): TexSubImage2DImmediate | 4962 // TODO(gman): TexSubImage2DImmediate |
| 4961 | 4963 |
| 4962 } // namespace gles2 | 4964 } // namespace gles2 |
| 4963 } // namespace gpu | 4965 } // namespace gpu |
| OLD | NEW |