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 4731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4742 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 4742 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
4743 EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError()); | 4743 EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError()); |
4744 EXPECT_FALSE(texture->GetLevelSize(GL_TEXTURE_2D, level, &width, &height)); | 4744 EXPECT_FALSE(texture->GetLevelSize(GL_TEXTURE_2D, level, &width, &height)); |
4745 } | 4745 } |
4746 | 4746 |
4747 TEST_F(GLES2DecoderTest, BufferDataGLError) { | 4747 TEST_F(GLES2DecoderTest, BufferDataGLError) { |
4748 GLenum target = GL_ARRAY_BUFFER; | 4748 GLenum target = GL_ARRAY_BUFFER; |
4749 GLsizeiptr size = 4; | 4749 GLsizeiptr size = 4; |
4750 DoBindBuffer(GL_ARRAY_BUFFER, client_buffer_id_, kServiceBufferId); | 4750 DoBindBuffer(GL_ARRAY_BUFFER, client_buffer_id_, kServiceBufferId); |
4751 BufferManager* manager = group().buffer_manager(); | 4751 BufferManager* manager = group().buffer_manager(); |
4752 Buffer* info = | 4752 Buffer* buffer = manager->GetBuffer(client_buffer_id_); |
4753 manager->GetBuffer(client_buffer_id_); | 4753 ASSERT_TRUE(buffer != NULL); |
4754 ASSERT_TRUE(info != NULL); | 4754 EXPECT_EQ(0, buffer->size()); |
4755 EXPECT_EQ(0, info->size()); | |
4756 EXPECT_CALL(*gl_, GetError()) | 4755 EXPECT_CALL(*gl_, GetError()) |
4757 .WillOnce(Return(GL_NO_ERROR)) | 4756 .WillOnce(Return(GL_NO_ERROR)) |
4758 .WillOnce(Return(GL_OUT_OF_MEMORY)) | 4757 .WillOnce(Return(GL_OUT_OF_MEMORY)) |
4759 .RetiresOnSaturation(); | 4758 .RetiresOnSaturation(); |
4760 EXPECT_CALL(*gl_, BufferData(target, size, _, GL_STREAM_DRAW)) | 4759 EXPECT_CALL(*gl_, BufferData(target, size, _, GL_STREAM_DRAW)) |
4761 .Times(1) | 4760 .Times(1) |
4762 .RetiresOnSaturation(); | 4761 .RetiresOnSaturation(); |
4763 BufferData cmd; | 4762 BufferData cmd; |
4764 cmd.Init(target, size, 0, 0, GL_STREAM_DRAW); | 4763 cmd.Init(target, size, 0, 0, GL_STREAM_DRAW); |
4765 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 4764 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
4766 EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError()); | 4765 EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError()); |
4767 EXPECT_EQ(0, info->size()); | 4766 EXPECT_EQ(0, buffer->size()); |
4768 } | 4767 } |
4769 | 4768 |
4770 TEST_F(GLES2DecoderTest, CopyTexImage2DGLError) { | 4769 TEST_F(GLES2DecoderTest, CopyTexImage2DGLError) { |
4771 GLenum target = GL_TEXTURE_2D; | 4770 GLenum target = GL_TEXTURE_2D; |
4772 GLint level = 0; | 4771 GLint level = 0; |
4773 GLenum internal_format = GL_RGBA; | 4772 GLenum internal_format = GL_RGBA; |
4774 GLsizei width = 2; | 4773 GLsizei width = 2; |
4775 GLsizei height = 4; | 4774 GLsizei height = 4; |
4776 GLint border = 0; | 4775 GLint border = 0; |
4777 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 4776 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
(...skipping 3653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8431 // TODO(gman): TexImage2DImmediate | 8430 // TODO(gman): TexImage2DImmediate |
8432 | 8431 |
8433 // TODO(gman): TexSubImage2DImmediate | 8432 // TODO(gman): TexSubImage2DImmediate |
8434 | 8433 |
8435 // TODO(gman): UseProgram | 8434 // TODO(gman): UseProgram |
8436 | 8435 |
8437 // TODO(gman): SwapBuffers | 8436 // TODO(gman): SwapBuffers |
8438 | 8437 |
8439 } // namespace gles2 | 8438 } // namespace gles2 |
8440 } // namespace gpu | 8439 } // namespace gpu |
OLD | NEW |