| 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 29 matching lines...) Expand all Loading... |
| 40 using ::testing::Return; | 40 using ::testing::Return; |
| 41 using ::testing::SetArrayArgument; | 41 using ::testing::SetArrayArgument; |
| 42 using ::testing::SetArgumentPointee; | 42 using ::testing::SetArgumentPointee; |
| 43 using ::testing::SetArgPointee; | 43 using ::testing::SetArgPointee; |
| 44 using ::testing::StrEq; | 44 using ::testing::StrEq; |
| 45 using ::testing::StrictMock; | 45 using ::testing::StrictMock; |
| 46 | 46 |
| 47 namespace gpu { | 47 namespace gpu { |
| 48 namespace gles2 { | 48 namespace gles2 { |
| 49 | 49 |
| 50 using namespace cmds; |
| 51 |
| 50 class GLES2DecoderTest : public GLES2DecoderTestBase { | 52 class GLES2DecoderTest : public GLES2DecoderTestBase { |
| 51 public: | 53 public: |
| 52 GLES2DecoderTest() { } | 54 GLES2DecoderTest() { } |
| 53 | 55 |
| 54 protected: | 56 protected: |
| 55 void CheckReadPixelsOutOfRange( | 57 void CheckReadPixelsOutOfRange( |
| 56 GLint in_read_x, GLint in_read_y, | 58 GLint in_read_x, GLint in_read_y, |
| 57 GLsizei in_read_width, GLsizei in_read_height, | 59 GLsizei in_read_width, GLsizei in_read_height, |
| 58 bool init); | 60 bool init); |
| 59 }; | 61 }; |
| (...skipping 1748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1808 0, 0); | 1810 0, 0); |
| 1809 GenerateMipmap cmd; | 1811 GenerateMipmap cmd; |
| 1810 cmd.Init(GL_TEXTURE_2D); | 1812 cmd.Init(GL_TEXTURE_2D); |
| 1811 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 1813 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 1812 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 1814 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 1813 } | 1815 } |
| 1814 | 1816 |
| 1815 TEST_F(GLES2DecoderTest, GenerateMipmapHandlesOutOfMemory) { | 1817 TEST_F(GLES2DecoderTest, GenerateMipmapHandlesOutOfMemory) { |
| 1816 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 1818 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 1817 TextureManager* manager = group().texture_manager(); | 1819 TextureManager* manager = group().texture_manager(); |
| 1818 TextureManager::TextureInfo* info = | 1820 Texture* info = |
| 1819 manager->GetTextureInfo(client_texture_id_); | 1821 manager->GetTexture(client_texture_id_); |
| 1820 ASSERT_TRUE(info != NULL); | 1822 ASSERT_TRUE(info != NULL); |
| 1821 GLint width = 0; | 1823 GLint width = 0; |
| 1822 GLint height = 0; | 1824 GLint height = 0; |
| 1823 EXPECT_FALSE(info->GetLevelSize(GL_TEXTURE_2D, 2, &width, &height)); | 1825 EXPECT_FALSE(info->GetLevelSize(GL_TEXTURE_2D, 2, &width, &height)); |
| 1824 DoTexImage2D( | 1826 DoTexImage2D( |
| 1825 GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, GL_RGBA, GL_UNSIGNED_BYTE, | 1827 GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, GL_RGBA, GL_UNSIGNED_BYTE, |
| 1826 kSharedMemoryId, kSharedMemoryOffset); | 1828 kSharedMemoryId, kSharedMemoryOffset); |
| 1827 EXPECT_CALL(*gl_, TexParameteri( | 1829 EXPECT_CALL(*gl_, TexParameteri( |
| 1828 GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST)) | 1830 GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST)) |
| 1829 .Times(1) | 1831 .Times(1) |
| (...skipping 2883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4713 GLenum target = GL_TEXTURE_2D; | 4715 GLenum target = GL_TEXTURE_2D; |
| 4714 GLint level = 0; | 4716 GLint level = 0; |
| 4715 GLenum internal_format = GL_RGBA; | 4717 GLenum internal_format = GL_RGBA; |
| 4716 GLsizei width = 2; | 4718 GLsizei width = 2; |
| 4717 GLsizei height = 4; | 4719 GLsizei height = 4; |
| 4718 GLint border = 0; | 4720 GLint border = 0; |
| 4719 GLenum format = GL_RGBA; | 4721 GLenum format = GL_RGBA; |
| 4720 GLenum type = GL_UNSIGNED_BYTE; | 4722 GLenum type = GL_UNSIGNED_BYTE; |
| 4721 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 4723 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 4722 TextureManager* manager = group().texture_manager(); | 4724 TextureManager* manager = group().texture_manager(); |
| 4723 TextureManager::TextureInfo* info = | 4725 Texture* info = |
| 4724 manager->GetTextureInfo(client_texture_id_); | 4726 manager->GetTexture(client_texture_id_); |
| 4725 ASSERT_TRUE(info != NULL); | 4727 ASSERT_TRUE(info != NULL); |
| 4726 EXPECT_FALSE(info->GetLevelSize(GL_TEXTURE_2D, level, &width, &height)); | 4728 EXPECT_FALSE(info->GetLevelSize(GL_TEXTURE_2D, level, &width, &height)); |
| 4727 EXPECT_CALL(*gl_, GetError()) | 4729 EXPECT_CALL(*gl_, GetError()) |
| 4728 .WillOnce(Return(GL_NO_ERROR)) | 4730 .WillOnce(Return(GL_NO_ERROR)) |
| 4729 .WillOnce(Return(GL_OUT_OF_MEMORY)) | 4731 .WillOnce(Return(GL_OUT_OF_MEMORY)) |
| 4730 .RetiresOnSaturation(); | 4732 .RetiresOnSaturation(); |
| 4731 EXPECT_CALL(*gl_, TexImage2D(target, level, internal_format, | 4733 EXPECT_CALL(*gl_, TexImage2D(target, level, internal_format, |
| 4732 width, height, border, format, type, _)) | 4734 width, height, border, format, type, _)) |
| 4733 .Times(1) | 4735 .Times(1) |
| 4734 .RetiresOnSaturation(); | 4736 .RetiresOnSaturation(); |
| 4735 TexImage2D cmd; | 4737 TexImage2D cmd; |
| 4736 cmd.Init(target, level, internal_format, width, height, border, format, | 4738 cmd.Init(target, level, internal_format, width, height, border, format, |
| 4737 type, kSharedMemoryId, kSharedMemoryOffset); | 4739 type, kSharedMemoryId, kSharedMemoryOffset); |
| 4738 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 4740 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 4739 EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError()); | 4741 EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError()); |
| 4740 EXPECT_FALSE(info->GetLevelSize(GL_TEXTURE_2D, level, &width, &height)); | 4742 EXPECT_FALSE(info->GetLevelSize(GL_TEXTURE_2D, level, &width, &height)); |
| 4741 } | 4743 } |
| 4742 | 4744 |
| 4743 TEST_F(GLES2DecoderTest, BufferDataGLError) { | 4745 TEST_F(GLES2DecoderTest, BufferDataGLError) { |
| 4744 GLenum target = GL_ARRAY_BUFFER; | 4746 GLenum target = GL_ARRAY_BUFFER; |
| 4745 GLsizeiptr size = 4; | 4747 GLsizeiptr size = 4; |
| 4746 DoBindBuffer(GL_ARRAY_BUFFER, client_buffer_id_, kServiceBufferId); | 4748 DoBindBuffer(GL_ARRAY_BUFFER, client_buffer_id_, kServiceBufferId); |
| 4747 BufferManager* manager = group().buffer_manager(); | 4749 BufferManager* manager = group().buffer_manager(); |
| 4748 BufferManager::BufferInfo* info = | 4750 BufferManager::Buffer* info = |
| 4749 manager->GetBufferInfo(client_buffer_id_); | 4751 manager->GetBuffer(client_buffer_id_); |
| 4750 ASSERT_TRUE(info != NULL); | 4752 ASSERT_TRUE(info != NULL); |
| 4751 EXPECT_EQ(0, info->size()); | 4753 EXPECT_EQ(0, info->size()); |
| 4752 EXPECT_CALL(*gl_, GetError()) | 4754 EXPECT_CALL(*gl_, GetError()) |
| 4753 .WillOnce(Return(GL_NO_ERROR)) | 4755 .WillOnce(Return(GL_NO_ERROR)) |
| 4754 .WillOnce(Return(GL_OUT_OF_MEMORY)) | 4756 .WillOnce(Return(GL_OUT_OF_MEMORY)) |
| 4755 .RetiresOnSaturation(); | 4757 .RetiresOnSaturation(); |
| 4756 EXPECT_CALL(*gl_, BufferData(target, size, _, GL_STREAM_DRAW)) | 4758 EXPECT_CALL(*gl_, BufferData(target, size, _, GL_STREAM_DRAW)) |
| 4757 .Times(1) | 4759 .Times(1) |
| 4758 .RetiresOnSaturation(); | 4760 .RetiresOnSaturation(); |
| 4759 BufferData cmd; | 4761 BufferData cmd; |
| 4760 cmd.Init(target, size, 0, 0, GL_STREAM_DRAW); | 4762 cmd.Init(target, size, 0, 0, GL_STREAM_DRAW); |
| 4761 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 4763 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 4762 EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError()); | 4764 EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError()); |
| 4763 EXPECT_EQ(0, info->size()); | 4765 EXPECT_EQ(0, info->size()); |
| 4764 } | 4766 } |
| 4765 | 4767 |
| 4766 TEST_F(GLES2DecoderTest, CopyTexImage2DGLError) { | 4768 TEST_F(GLES2DecoderTest, CopyTexImage2DGLError) { |
| 4767 GLenum target = GL_TEXTURE_2D; | 4769 GLenum target = GL_TEXTURE_2D; |
| 4768 GLint level = 0; | 4770 GLint level = 0; |
| 4769 GLenum internal_format = GL_RGBA; | 4771 GLenum internal_format = GL_RGBA; |
| 4770 GLsizei width = 2; | 4772 GLsizei width = 2; |
| 4771 GLsizei height = 4; | 4773 GLsizei height = 4; |
| 4772 GLint border = 0; | 4774 GLint border = 0; |
| 4773 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 4775 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 4774 TextureManager* manager = group().texture_manager(); | 4776 TextureManager* manager = group().texture_manager(); |
| 4775 TextureManager::TextureInfo* info = | 4777 Texture* info = |
| 4776 manager->GetTextureInfo(client_texture_id_); | 4778 manager->GetTexture(client_texture_id_); |
| 4777 ASSERT_TRUE(info != NULL); | 4779 ASSERT_TRUE(info != NULL); |
| 4778 EXPECT_FALSE(info->GetLevelSize(GL_TEXTURE_2D, level, &width, &height)); | 4780 EXPECT_FALSE(info->GetLevelSize(GL_TEXTURE_2D, level, &width, &height)); |
| 4779 EXPECT_CALL(*gl_, GetError()) | 4781 EXPECT_CALL(*gl_, GetError()) |
| 4780 .WillOnce(Return(GL_NO_ERROR)) | 4782 .WillOnce(Return(GL_NO_ERROR)) |
| 4781 .WillOnce(Return(GL_OUT_OF_MEMORY)) | 4783 .WillOnce(Return(GL_OUT_OF_MEMORY)) |
| 4782 .RetiresOnSaturation(); | 4784 .RetiresOnSaturation(); |
| 4783 EXPECT_CALL(*gl_, CopyTexImage2D( | 4785 EXPECT_CALL(*gl_, CopyTexImage2D( |
| 4784 target, level, internal_format, 0, 0, width, height, border)) | 4786 target, level, internal_format, 0, 0, width, height, border)) |
| 4785 .Times(1) | 4787 .Times(1) |
| 4786 .RetiresOnSaturation(); | 4788 .RetiresOnSaturation(); |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5297 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 5299 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 5298 | 5300 |
| 5299 // Test CompressedTexSubImage not allowed | 5301 // Test CompressedTexSubImage not allowed |
| 5300 CompressedTexSubImage2DBucket sub_cmd; | 5302 CompressedTexSubImage2DBucket sub_cmd; |
| 5301 bucket->SetSize(kBlockSize); | 5303 bucket->SetSize(kBlockSize); |
| 5302 sub_cmd.Init(GL_TEXTURE_2D, 0, 0, 0, 4, 4, kFormat, kBucketId); | 5304 sub_cmd.Init(GL_TEXTURE_2D, 0, 0, 0, 4, 4, kFormat, kBucketId); |
| 5303 EXPECT_EQ(error::kNoError, ExecuteCmd(sub_cmd)); | 5305 EXPECT_EQ(error::kNoError, ExecuteCmd(sub_cmd)); |
| 5304 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 5306 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 5305 | 5307 |
| 5306 // Test TexSubImage not allowed for ETC1 compressed texture | 5308 // Test TexSubImage not allowed for ETC1 compressed texture |
| 5307 TextureManager::TextureInfo* info = GetTextureInfo(client_texture_id_); | 5309 Texture* info = GetTexture(client_texture_id_); |
| 5308 ASSERT_TRUE(info != NULL); | 5310 ASSERT_TRUE(info != NULL); |
| 5309 GLenum type, internal_format; | 5311 GLenum type, internal_format; |
| 5310 EXPECT_TRUE(info->GetLevelType(GL_TEXTURE_2D, 0, &type, &internal_format)); | 5312 EXPECT_TRUE(info->GetLevelType(GL_TEXTURE_2D, 0, &type, &internal_format)); |
| 5311 EXPECT_EQ(kFormat, internal_format); | 5313 EXPECT_EQ(kFormat, internal_format); |
| 5312 TexSubImage2D texsub_cmd; | 5314 TexSubImage2D texsub_cmd; |
| 5313 texsub_cmd.Init(GL_TEXTURE_2D, 0, 0, 0, 4, 4, GL_RGBA, GL_UNSIGNED_BYTE, | 5315 texsub_cmd.Init(GL_TEXTURE_2D, 0, 0, 0, 4, 4, GL_RGBA, GL_UNSIGNED_BYTE, |
| 5314 kSharedMemoryId, kSharedMemoryOffset, GL_FALSE); | 5316 kSharedMemoryId, kSharedMemoryOffset, GL_FALSE); |
| 5315 EXPECT_EQ(error::kNoError, ExecuteCmd(texsub_cmd)); | 5317 EXPECT_EQ(error::kNoError, ExecuteCmd(texsub_cmd)); |
| 5316 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 5318 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 5317 | 5319 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5407 false, // request depth | 5409 false, // request depth |
| 5408 false, // request stencil | 5410 false, // request stencil |
| 5409 true); // bind generates resource | 5411 true); // bind generates resource |
| 5410 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_EXTERNAL_OES, kNewServiceId)); | 5412 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_EXTERNAL_OES, kNewServiceId)); |
| 5411 EXPECT_CALL(*gl_, GenTextures(1, _)) | 5413 EXPECT_CALL(*gl_, GenTextures(1, _)) |
| 5412 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); | 5414 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); |
| 5413 BindTexture cmd; | 5415 BindTexture cmd; |
| 5414 cmd.Init(GL_TEXTURE_EXTERNAL_OES, kNewClientId); | 5416 cmd.Init(GL_TEXTURE_EXTERNAL_OES, kNewClientId); |
| 5415 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 5417 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 5416 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 5418 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 5417 TextureManager::TextureInfo* info = GetTextureInfo(kNewClientId); | 5419 Texture* info = GetTexture(kNewClientId); |
| 5418 EXPECT_TRUE(info != NULL); | 5420 EXPECT_TRUE(info != NULL); |
| 5419 EXPECT_TRUE(info->target() == GL_TEXTURE_EXTERNAL_OES); | 5421 EXPECT_TRUE(info->target() == GL_TEXTURE_EXTERNAL_OES); |
| 5420 } | 5422 } |
| 5421 | 5423 |
| 5422 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalGetBinding) { | 5424 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalGetBinding) { |
| 5423 InitDecoder( | 5425 InitDecoder( |
| 5424 "GL_OES_EGL_image_external", // extensions | 5426 "GL_OES_EGL_image_external", // extensions |
| 5425 false, // has alpha | 5427 false, // has alpha |
| 5426 false, // has depth | 5428 false, // has depth |
| 5427 false, // has stencil | 5429 false, // has stencil |
| (...skipping 29 matching lines...) Expand all Loading... |
| 5457 "GL_OES_EGL_image_external", // extensions | 5459 "GL_OES_EGL_image_external", // extensions |
| 5458 false, // has alpha | 5460 false, // has alpha |
| 5459 false, // has depth | 5461 false, // has depth |
| 5460 false, // has stencil | 5462 false, // has stencil |
| 5461 false, // request alpha | 5463 false, // request alpha |
| 5462 false, // request depth | 5464 false, // request depth |
| 5463 false, // request stencil | 5465 false, // request stencil |
| 5464 true); // bind generates resource | 5466 true); // bind generates resource |
| 5465 DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId); | 5467 DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId); |
| 5466 | 5468 |
| 5467 TextureManager::TextureInfo* info = GetTextureInfo(client_texture_id_); | 5469 Texture* info = GetTexture(client_texture_id_); |
| 5468 EXPECT_TRUE(info != NULL); | 5470 EXPECT_TRUE(info != NULL); |
| 5469 EXPECT_TRUE(info->target() == GL_TEXTURE_EXTERNAL_OES); | 5471 EXPECT_TRUE(info->target() == GL_TEXTURE_EXTERNAL_OES); |
| 5470 EXPECT_TRUE(info->min_filter() == GL_LINEAR); | 5472 EXPECT_TRUE(info->min_filter() == GL_LINEAR); |
| 5471 EXPECT_TRUE(info->wrap_s() == GL_CLAMP_TO_EDGE); | 5473 EXPECT_TRUE(info->wrap_s() == GL_CLAMP_TO_EDGE); |
| 5472 EXPECT_TRUE(info->wrap_t() == GL_CLAMP_TO_EDGE); | 5474 EXPECT_TRUE(info->wrap_t() == GL_CLAMP_TO_EDGE); |
| 5473 } | 5475 } |
| 5474 | 5476 |
| 5475 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureParam) { | 5477 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureParam) { |
| 5476 InitDecoder( | 5478 InitDecoder( |
| 5477 "GL_OES_EGL_image_external", // extensions | 5479 "GL_OES_EGL_image_external", // extensions |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5515 GL_CLAMP_TO_EDGE); | 5517 GL_CLAMP_TO_EDGE); |
| 5516 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 5518 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 5517 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 5519 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 5518 | 5520 |
| 5519 cmd.Init(GL_TEXTURE_EXTERNAL_OES, | 5521 cmd.Init(GL_TEXTURE_EXTERNAL_OES, |
| 5520 GL_TEXTURE_WRAP_T, | 5522 GL_TEXTURE_WRAP_T, |
| 5521 GL_CLAMP_TO_EDGE); | 5523 GL_CLAMP_TO_EDGE); |
| 5522 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 5524 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 5523 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 5525 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 5524 | 5526 |
| 5525 TextureManager::TextureInfo* info = GetTextureInfo(client_texture_id_); | 5527 Texture* info = GetTexture(client_texture_id_); |
| 5526 EXPECT_TRUE(info != NULL); | 5528 EXPECT_TRUE(info != NULL); |
| 5527 EXPECT_TRUE(info->target() == GL_TEXTURE_EXTERNAL_OES); | 5529 EXPECT_TRUE(info->target() == GL_TEXTURE_EXTERNAL_OES); |
| 5528 EXPECT_TRUE(info->min_filter() == GL_LINEAR); | 5530 EXPECT_TRUE(info->min_filter() == GL_LINEAR); |
| 5529 EXPECT_TRUE(info->wrap_s() == GL_CLAMP_TO_EDGE); | 5531 EXPECT_TRUE(info->wrap_s() == GL_CLAMP_TO_EDGE); |
| 5530 EXPECT_TRUE(info->wrap_t() == GL_CLAMP_TO_EDGE); | 5532 EXPECT_TRUE(info->wrap_t() == GL_CLAMP_TO_EDGE); |
| 5531 } | 5533 } |
| 5532 | 5534 |
| 5533 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureParamInvalid) { | 5535 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureParamInvalid) { |
| 5534 InitDecoder( | 5536 InitDecoder( |
| 5535 "GL_OES_EGL_image_external", // extensions | 5537 "GL_OES_EGL_image_external", // extensions |
| (...skipping 19 matching lines...) Expand all Loading... |
| 5555 GL_REPEAT); | 5557 GL_REPEAT); |
| 5556 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 5558 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 5557 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); | 5559 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); |
| 5558 | 5560 |
| 5559 cmd.Init(GL_TEXTURE_EXTERNAL_OES, | 5561 cmd.Init(GL_TEXTURE_EXTERNAL_OES, |
| 5560 GL_TEXTURE_WRAP_T, | 5562 GL_TEXTURE_WRAP_T, |
| 5561 GL_REPEAT); | 5563 GL_REPEAT); |
| 5562 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 5564 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 5563 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); | 5565 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); |
| 5564 | 5566 |
| 5565 TextureManager::TextureInfo* info = GetTextureInfo(client_texture_id_); | 5567 Texture* info = GetTexture(client_texture_id_); |
| 5566 EXPECT_TRUE(info != NULL); | 5568 EXPECT_TRUE(info != NULL); |
| 5567 EXPECT_TRUE(info->target() == GL_TEXTURE_EXTERNAL_OES); | 5569 EXPECT_TRUE(info->target() == GL_TEXTURE_EXTERNAL_OES); |
| 5568 EXPECT_TRUE(info->min_filter() == GL_LINEAR); | 5570 EXPECT_TRUE(info->min_filter() == GL_LINEAR); |
| 5569 EXPECT_TRUE(info->wrap_s() == GL_CLAMP_TO_EDGE); | 5571 EXPECT_TRUE(info->wrap_s() == GL_CLAMP_TO_EDGE); |
| 5570 EXPECT_TRUE(info->wrap_t() == GL_CLAMP_TO_EDGE); | 5572 EXPECT_TRUE(info->wrap_t() == GL_CLAMP_TO_EDGE); |
| 5571 } | 5573 } |
| 5572 | 5574 |
| 5573 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTexImage2DError) { | 5575 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTexImage2DError) { |
| 5574 InitDecoder( | 5576 InitDecoder( |
| 5575 "GL_OES_EGL_image_external", // extensions | 5577 "GL_OES_EGL_image_external", // extensions |
| 5576 false, // has alpha | 5578 false, // has alpha |
| 5577 false, // has depth | 5579 false, // has depth |
| 5578 false, // has stencil | 5580 false, // has stencil |
| 5579 false, // request alpha | 5581 false, // request alpha |
| 5580 false, // request depth | 5582 false, // request depth |
| 5581 false, // request stencil | 5583 false, // request stencil |
| 5582 true); // bind generates resource | 5584 true); // bind generates resource |
| 5583 | 5585 |
| 5584 GLenum target = GL_TEXTURE_EXTERNAL_OES; | 5586 GLenum target = GL_TEXTURE_EXTERNAL_OES; |
| 5585 GLint level = 0; | 5587 GLint level = 0; |
| 5586 GLenum internal_format = GL_RGBA; | 5588 GLenum internal_format = GL_RGBA; |
| 5587 GLsizei width = 2; | 5589 GLsizei width = 2; |
| 5588 GLsizei height = 4; | 5590 GLsizei height = 4; |
| 5589 GLint border = 0; | 5591 GLint border = 0; |
| 5590 GLenum format = GL_RGBA; | 5592 GLenum format = GL_RGBA; |
| 5591 GLenum type = GL_UNSIGNED_BYTE; | 5593 GLenum type = GL_UNSIGNED_BYTE; |
| 5592 DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId); | 5594 DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId); |
| 5593 ASSERT_TRUE(GetTextureInfo(client_texture_id_) != NULL); | 5595 ASSERT_TRUE(GetTexture(client_texture_id_) != NULL); |
| 5594 TexImage2D cmd; | 5596 TexImage2D cmd; |
| 5595 cmd.Init(target, level, internal_format, width, height, border, format, | 5597 cmd.Init(target, level, internal_format, width, height, border, format, |
| 5596 type, kSharedMemoryId, kSharedMemoryOffset); | 5598 type, kSharedMemoryId, kSharedMemoryOffset); |
| 5597 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 5599 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 5598 | 5600 |
| 5599 // TexImage2D is not allowed with GL_TEXTURE_EXTERNAL_OES targets. | 5601 // TexImage2D is not allowed with GL_TEXTURE_EXTERNAL_OES targets. |
| 5600 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); | 5602 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); |
| 5601 } | 5603 } |
| 5602 | 5604 |
| 5603 TEST_F(GLES2DecoderManualInitTest, BindGeneratesResourceFalse) { | 5605 TEST_F(GLES2DecoderManualInitTest, BindGeneratesResourceFalse) { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5648 .WillOnce(Return(kObjectId)) | 5650 .WillOnce(Return(kObjectId)) |
| 5649 .RetiresOnSaturation(); | 5651 .RetiresOnSaturation(); |
| 5650 | 5652 |
| 5651 CreateStreamTextureCHROMIUM cmd; | 5653 CreateStreamTextureCHROMIUM cmd; |
| 5652 CreateStreamTextureCHROMIUM::Result* result = | 5654 CreateStreamTextureCHROMIUM::Result* result = |
| 5653 static_cast<CreateStreamTextureCHROMIUM::Result*>(shared_memory_address_); | 5655 static_cast<CreateStreamTextureCHROMIUM::Result*>(shared_memory_address_); |
| 5654 cmd.Init(client_texture_id_, shared_memory_id_, shared_memory_offset_); | 5656 cmd.Init(client_texture_id_, shared_memory_id_, shared_memory_offset_); |
| 5655 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 5657 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 5656 EXPECT_EQ(kObjectId, *result); | 5658 EXPECT_EQ(kObjectId, *result); |
| 5657 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 5659 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 5658 TextureManager::TextureInfo* info = GetTextureInfo(client_texture_id_); | 5660 Texture* info = GetTexture(client_texture_id_); |
| 5659 EXPECT_TRUE(info != NULL); | 5661 EXPECT_TRUE(info != NULL); |
| 5660 EXPECT_TRUE(info->IsStreamTexture()); | 5662 EXPECT_TRUE(info->IsStreamTexture()); |
| 5661 } | 5663 } |
| 5662 | 5664 |
| 5663 TEST_F(GLES2DecoderManualInitTest, CreateStreamTextureCHROMIUMBadId) { | 5665 TEST_F(GLES2DecoderManualInitTest, CreateStreamTextureCHROMIUMBadId) { |
| 5664 InitDecoder( | 5666 InitDecoder( |
| 5665 "GL_CHROMIUM_stream_texture", // extensions | 5667 "GL_CHROMIUM_stream_texture", // extensions |
| 5666 false, // has alpha | 5668 false, // has alpha |
| 5667 false, // has depth | 5669 false, // has depth |
| 5668 false, // has stencil | 5670 false, // has stencil |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5705 InitDecoder( | 5707 InitDecoder( |
| 5706 "GL_CHROMIUM_stream_texture", // extensions | 5708 "GL_CHROMIUM_stream_texture", // extensions |
| 5707 false, // has alpha | 5709 false, // has alpha |
| 5708 false, // has depth | 5710 false, // has depth |
| 5709 false, // has stencil | 5711 false, // has stencil |
| 5710 false, // request alpha | 5712 false, // request alpha |
| 5711 false, // request depth | 5713 false, // request depth |
| 5712 false, // request stencil | 5714 false, // request stencil |
| 5713 true); // bind generates resource | 5715 true); // bind generates resource |
| 5714 | 5716 |
| 5715 TextureManager::TextureInfo* info = GetTextureInfo(client_texture_id_); | 5717 Texture* info = GetTexture(client_texture_id_); |
| 5716 info->SetStreamTexture(true); | 5718 info->SetStreamTexture(true); |
| 5717 | 5719 |
| 5718 CreateStreamTextureCHROMIUM cmd; | 5720 CreateStreamTextureCHROMIUM cmd; |
| 5719 cmd.Init(client_texture_id_, shared_memory_id_, shared_memory_offset_); | 5721 cmd.Init(client_texture_id_, shared_memory_id_, shared_memory_offset_); |
| 5720 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 5722 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 5721 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 5723 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 5722 } | 5724 } |
| 5723 | 5725 |
| 5724 TEST_F(GLES2DecoderManualInitTest, BindStreamTextureCHROMIUM) { | 5726 TEST_F(GLES2DecoderManualInitTest, BindStreamTextureCHROMIUM) { |
| 5725 InitDecoder( | 5727 InitDecoder( |
| 5726 "GL_CHROMIUM_stream_texture GL_OES_EGL_image_external", // extensions | 5728 "GL_CHROMIUM_stream_texture GL_OES_EGL_image_external", // extensions |
| 5727 false, // has alpha | 5729 false, // has alpha |
| 5728 false, // has depth | 5730 false, // has depth |
| 5729 false, // has stencil | 5731 false, // has stencil |
| 5730 false, // request alpha | 5732 false, // request alpha |
| 5731 false, // request depth | 5733 false, // request depth |
| 5732 false, // request stencil | 5734 false, // request stencil |
| 5733 true); // bind generates resource | 5735 true); // bind generates resource |
| 5734 | 5736 |
| 5735 StrictMock<MockStreamTextureManager> manager; | 5737 StrictMock<MockStreamTextureManager> manager; |
| 5736 StrictMock<MockStreamTexture> texture; | 5738 StrictMock<MockStreamTexture> texture; |
| 5737 decoder_->SetStreamTextureManager(&manager); | 5739 decoder_->SetStreamTextureManager(&manager); |
| 5738 | 5740 |
| 5739 TextureManager::TextureInfo* info = GetTextureInfo(client_texture_id_); | 5741 Texture* info = GetTexture(client_texture_id_); |
| 5740 info->SetStreamTexture(true); | 5742 info->SetStreamTexture(true); |
| 5741 | 5743 |
| 5742 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_EXTERNAL_OES, kServiceTextureId)) | 5744 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_EXTERNAL_OES, kServiceTextureId)) |
| 5743 .Times(1) | 5745 .Times(1) |
| 5744 .RetiresOnSaturation(); | 5746 .RetiresOnSaturation(); |
| 5745 EXPECT_CALL(manager, LookupStreamTexture(kServiceTextureId)) | 5747 EXPECT_CALL(manager, LookupStreamTexture(kServiceTextureId)) |
| 5746 .WillOnce(Return(&texture)) | 5748 .WillOnce(Return(&texture)) |
| 5747 .RetiresOnSaturation(); | 5749 .RetiresOnSaturation(); |
| 5748 EXPECT_CALL(texture, Update()) | 5750 EXPECT_CALL(texture, Update()) |
| 5749 .Times(1) | 5751 .Times(1) |
| 5750 .RetiresOnSaturation(); | 5752 .RetiresOnSaturation(); |
| 5751 | 5753 |
| 5752 BindTexture cmd; | 5754 BindTexture cmd; |
| 5753 cmd.Init(GL_TEXTURE_EXTERNAL_OES, client_texture_id_); | 5755 cmd.Init(GL_TEXTURE_EXTERNAL_OES, client_texture_id_); |
| 5754 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 5756 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 5755 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 5757 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 5756 } | 5758 } |
| 5757 | 5759 |
| 5758 TEST_F(GLES2DecoderManualInitTest, BindStreamTextureCHROMIUMInvalid) { | 5760 TEST_F(GLES2DecoderManualInitTest, BindStreamTextureCHROMIUMInvalid) { |
| 5759 InitDecoder( | 5761 InitDecoder( |
| 5760 "GL_CHROMIUM_stream_texture", // extensions | 5762 "GL_CHROMIUM_stream_texture", // extensions |
| 5761 false, // has alpha | 5763 false, // has alpha |
| 5762 false, // has depth | 5764 false, // has depth |
| 5763 false, // has stencil | 5765 false, // has stencil |
| 5764 false, // request alpha | 5766 false, // request alpha |
| 5765 false, // request depth | 5767 false, // request depth |
| 5766 false, // request stencil | 5768 false, // request stencil |
| 5767 true); // bind generates resource | 5769 true); // bind generates resource |
| 5768 | 5770 |
| 5769 TextureManager::TextureInfo* info = GetTextureInfo(client_texture_id_); | 5771 Texture* info = GetTexture(client_texture_id_); |
| 5770 info->SetStreamTexture(true); | 5772 info->SetStreamTexture(true); |
| 5771 | 5773 |
| 5772 BindTexture cmd; | 5774 BindTexture cmd; |
| 5773 cmd.Init(GL_TEXTURE_2D, client_texture_id_); | 5775 cmd.Init(GL_TEXTURE_2D, client_texture_id_); |
| 5774 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 5776 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 5775 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 5777 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 5776 | 5778 |
| 5777 BindTexture cmd2; | 5779 BindTexture cmd2; |
| 5778 cmd2.Init(GL_TEXTURE_CUBE_MAP, client_texture_id_); | 5780 cmd2.Init(GL_TEXTURE_CUBE_MAP, client_texture_id_); |
| 5779 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); | 5781 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); |
| 5780 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 5782 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 5781 } | 5783 } |
| 5782 | 5784 |
| 5783 TEST_F(GLES2DecoderManualInitTest, DestroyStreamTextureCHROMIUM) { | 5785 TEST_F(GLES2DecoderManualInitTest, DestroyStreamTextureCHROMIUM) { |
| 5784 InitDecoder( | 5786 InitDecoder( |
| 5785 "GL_CHROMIUM_stream_texture", // extensions | 5787 "GL_CHROMIUM_stream_texture", // extensions |
| 5786 false, // has alpha | 5788 false, // has alpha |
| 5787 false, // has depth | 5789 false, // has depth |
| 5788 false, // has stencil | 5790 false, // has stencil |
| 5789 false, // request alpha | 5791 false, // request alpha |
| 5790 false, // request depth | 5792 false, // request depth |
| 5791 false, // request stencil | 5793 false, // request stencil |
| 5792 true); // bind generates resource | 5794 true); // bind generates resource |
| 5793 | 5795 |
| 5794 StrictMock<MockStreamTextureManager> manager; | 5796 StrictMock<MockStreamTextureManager> manager; |
| 5795 decoder_->SetStreamTextureManager(&manager); | 5797 decoder_->SetStreamTextureManager(&manager); |
| 5796 | 5798 |
| 5797 TextureManager::TextureInfo* info = GetTextureInfo(client_texture_id_); | 5799 Texture* info = GetTexture(client_texture_id_); |
| 5798 info->SetStreamTexture(true); | 5800 info->SetStreamTexture(true); |
| 5799 | 5801 |
| 5800 EXPECT_CALL(manager, DestroyStreamTexture(kServiceTextureId)) | 5802 EXPECT_CALL(manager, DestroyStreamTexture(kServiceTextureId)) |
| 5801 .Times(1) | 5803 .Times(1) |
| 5802 .RetiresOnSaturation(); | 5804 .RetiresOnSaturation(); |
| 5803 | 5805 |
| 5804 DestroyStreamTextureCHROMIUM cmd; | 5806 DestroyStreamTextureCHROMIUM cmd; |
| 5805 cmd.Init(client_texture_id_); | 5807 cmd.Init(client_texture_id_); |
| 5806 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 5808 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 5807 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 5809 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 5808 EXPECT_FALSE(info->IsStreamTexture()); | 5810 EXPECT_FALSE(info->IsStreamTexture()); |
| 5809 EXPECT_EQ(0U, info->target()); | 5811 EXPECT_EQ(0U, info->target()); |
| 5810 } | 5812 } |
| 5811 | 5813 |
| 5812 TEST_F(GLES2DecoderManualInitTest, DestroyStreamTextureCHROMIUMInvalid) { | 5814 TEST_F(GLES2DecoderManualInitTest, DestroyStreamTextureCHROMIUMInvalid) { |
| 5813 InitDecoder( | 5815 InitDecoder( |
| 5814 "GL_CHROMIUM_stream_texture", // extensions | 5816 "GL_CHROMIUM_stream_texture", // extensions |
| 5815 false, // has alpha | 5817 false, // has alpha |
| 5816 false, // has depth | 5818 false, // has depth |
| 5817 false, // has stencil | 5819 false, // has stencil |
| 5818 false, // request alpha | 5820 false, // request alpha |
| 5819 false, // request depth | 5821 false, // request depth |
| 5820 false, // request stencil | 5822 false, // request stencil |
| 5821 true); // bind generates resource | 5823 true); // bind generates resource |
| 5822 | 5824 |
| 5823 TextureManager::TextureInfo* info = GetTextureInfo(client_texture_id_); | 5825 Texture* info = GetTexture(client_texture_id_); |
| 5824 info->SetStreamTexture(false); | 5826 info->SetStreamTexture(false); |
| 5825 | 5827 |
| 5826 DestroyStreamTextureCHROMIUM cmd; | 5828 DestroyStreamTextureCHROMIUM cmd; |
| 5827 cmd.Init(client_texture_id_); | 5829 cmd.Init(client_texture_id_); |
| 5828 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 5830 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 5829 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); | 5831 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); |
| 5830 } | 5832 } |
| 5831 | 5833 |
| 5832 TEST_F(GLES2DecoderManualInitTest, DestroyStreamTextureCHROMIUMBadId) { | 5834 TEST_F(GLES2DecoderManualInitTest, DestroyStreamTextureCHROMIUMBadId) { |
| 5833 InitDecoder( | 5835 InitDecoder( |
| (...skipping 21 matching lines...) Expand all Loading... |
| 5855 false, // request alpha | 5857 false, // request alpha |
| 5856 false, // request depth | 5858 false, // request depth |
| 5857 false, // request stencil | 5859 false, // request stencil |
| 5858 true); // bind generates resource | 5860 true); // bind generates resource |
| 5859 | 5861 |
| 5860 CreateStreamTextureCHROMIUM cmd; | 5862 CreateStreamTextureCHROMIUM cmd; |
| 5861 cmd.Init(client_texture_id_, shared_memory_id_, shared_memory_offset_); | 5863 cmd.Init(client_texture_id_, shared_memory_id_, shared_memory_offset_); |
| 5862 EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd)); | 5864 EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd)); |
| 5863 GetGLError(); // ignore internal error | 5865 GetGLError(); // ignore internal error |
| 5864 | 5866 |
| 5865 TextureManager::TextureInfo* info = GetTextureInfo(client_texture_id_); | 5867 Texture* info = GetTexture(client_texture_id_); |
| 5866 info->SetStreamTexture(true); | 5868 info->SetStreamTexture(true); |
| 5867 | 5869 |
| 5868 DestroyStreamTextureCHROMIUM cmd2; | 5870 DestroyStreamTextureCHROMIUM cmd2; |
| 5869 cmd2.Init(client_texture_id_); | 5871 cmd2.Init(client_texture_id_); |
| 5870 EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd2)); | 5872 EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd2)); |
| 5871 GetGLError(); // ignore internal error | 5873 GetGLError(); // ignore internal error |
| 5872 } | 5874 } |
| 5873 | 5875 |
| 5874 TEST_F(GLES2DecoderManualInitTest, ReCreateStreamTextureCHROMIUM) { | 5876 TEST_F(GLES2DecoderManualInitTest, ReCreateStreamTextureCHROMIUM) { |
| 5875 const GLuint kObjectId = 123; | 5877 const GLuint kObjectId = 123; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 5894 .Times(1) | 5896 .Times(1) |
| 5895 .RetiresOnSaturation(); | 5897 .RetiresOnSaturation(); |
| 5896 EXPECT_CALL(manager, DestroyStreamTexture(kServiceTextureId)) | 5898 EXPECT_CALL(manager, DestroyStreamTexture(kServiceTextureId)) |
| 5897 .Times(1) | 5899 .Times(1) |
| 5898 .RetiresOnSaturation(); | 5900 .RetiresOnSaturation(); |
| 5899 EXPECT_CALL(manager, CreateStreamTexture(kServiceTextureId, | 5901 EXPECT_CALL(manager, CreateStreamTexture(kServiceTextureId, |
| 5900 client_texture_id_)) | 5902 client_texture_id_)) |
| 5901 .WillOnce(Return(kObjectId)) | 5903 .WillOnce(Return(kObjectId)) |
| 5902 .RetiresOnSaturation(); | 5904 .RetiresOnSaturation(); |
| 5903 | 5905 |
| 5904 TextureManager::TextureInfo* info = GetTextureInfo(client_texture_id_); | 5906 Texture* info = GetTexture(client_texture_id_); |
| 5905 info->SetStreamTexture(true); | 5907 info->SetStreamTexture(true); |
| 5906 | 5908 |
| 5907 DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId); | 5909 DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId); |
| 5908 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 5910 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 5909 | 5911 |
| 5910 DestroyStreamTextureCHROMIUM cmd; | 5912 DestroyStreamTextureCHROMIUM cmd; |
| 5911 cmd.Init(client_texture_id_); | 5913 cmd.Init(client_texture_id_); |
| 5912 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 5914 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 5913 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 5915 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 5914 EXPECT_FALSE(info->IsStreamTexture()); | 5916 EXPECT_FALSE(info->IsStreamTexture()); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 5930 false, // request depth | 5932 false, // request depth |
| 5931 false, // request stencil | 5933 false, // request stencil |
| 5932 true); // bind generates resource | 5934 true); // bind generates resource |
| 5933 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_RECTANGLE_ARB, kNewServiceId)); | 5935 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_RECTANGLE_ARB, kNewServiceId)); |
| 5934 EXPECT_CALL(*gl_, GenTextures(1, _)) | 5936 EXPECT_CALL(*gl_, GenTextures(1, _)) |
| 5935 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); | 5937 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); |
| 5936 BindTexture cmd; | 5938 BindTexture cmd; |
| 5937 cmd.Init(GL_TEXTURE_RECTANGLE_ARB, kNewClientId); | 5939 cmd.Init(GL_TEXTURE_RECTANGLE_ARB, kNewClientId); |
| 5938 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 5940 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 5939 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 5941 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 5940 TextureManager::TextureInfo* info = GetTextureInfo(kNewClientId); | 5942 Texture* info = GetTexture(kNewClientId); |
| 5941 EXPECT_TRUE(info != NULL); | 5943 EXPECT_TRUE(info != NULL); |
| 5942 EXPECT_TRUE(info->target() == GL_TEXTURE_RECTANGLE_ARB); | 5944 EXPECT_TRUE(info->target() == GL_TEXTURE_RECTANGLE_ARB); |
| 5943 } | 5945 } |
| 5944 | 5946 |
| 5945 TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleGetBinding) { | 5947 TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleGetBinding) { |
| 5946 InitDecoder( | 5948 InitDecoder( |
| 5947 "GL_ARB_texture_rectangle", // extensions | 5949 "GL_ARB_texture_rectangle", // extensions |
| 5948 false, // has alpha | 5950 false, // has alpha |
| 5949 false, // has depth | 5951 false, // has depth |
| 5950 false, // has stencil | 5952 false, // has stencil |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5982 false, // has alpha | 5984 false, // has alpha |
| 5983 false, // has depth | 5985 false, // has depth |
| 5984 false, // has stencil | 5986 false, // has stencil |
| 5985 false, // request alpha | 5987 false, // request alpha |
| 5986 false, // request depth | 5988 false, // request depth |
| 5987 false, // request stencil | 5989 false, // request stencil |
| 5988 true); // bind generates resource | 5990 true); // bind generates resource |
| 5989 DoBindTexture( | 5991 DoBindTexture( |
| 5990 GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId); | 5992 GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId); |
| 5991 | 5993 |
| 5992 TextureManager::TextureInfo* info = GetTextureInfo(client_texture_id_); | 5994 Texture* info = GetTexture(client_texture_id_); |
| 5993 EXPECT_TRUE(info != NULL); | 5995 EXPECT_TRUE(info != NULL); |
| 5994 EXPECT_TRUE(info->target() == GL_TEXTURE_RECTANGLE_ARB); | 5996 EXPECT_TRUE(info->target() == GL_TEXTURE_RECTANGLE_ARB); |
| 5995 EXPECT_TRUE(info->min_filter() == GL_LINEAR); | 5997 EXPECT_TRUE(info->min_filter() == GL_LINEAR); |
| 5996 EXPECT_TRUE(info->wrap_s() == GL_CLAMP_TO_EDGE); | 5998 EXPECT_TRUE(info->wrap_s() == GL_CLAMP_TO_EDGE); |
| 5997 EXPECT_TRUE(info->wrap_t() == GL_CLAMP_TO_EDGE); | 5999 EXPECT_TRUE(info->wrap_t() == GL_CLAMP_TO_EDGE); |
| 5998 } | 6000 } |
| 5999 | 6001 |
| 6000 TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleTextureParam) { | 6002 TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleTextureParam) { |
| 6001 InitDecoder( | 6003 InitDecoder( |
| 6002 "GL_ARB_texture_rectangle", // extensions | 6004 "GL_ARB_texture_rectangle", // extensions |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6041 GL_CLAMP_TO_EDGE); | 6043 GL_CLAMP_TO_EDGE); |
| 6042 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 6044 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 6043 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 6045 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 6044 | 6046 |
| 6045 cmd.Init(GL_TEXTURE_RECTANGLE_ARB, | 6047 cmd.Init(GL_TEXTURE_RECTANGLE_ARB, |
| 6046 GL_TEXTURE_WRAP_T, | 6048 GL_TEXTURE_WRAP_T, |
| 6047 GL_CLAMP_TO_EDGE); | 6049 GL_CLAMP_TO_EDGE); |
| 6048 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 6050 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 6049 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 6051 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 6050 | 6052 |
| 6051 TextureManager::TextureInfo* info = GetTextureInfo(client_texture_id_); | 6053 Texture* info = GetTexture(client_texture_id_); |
| 6052 EXPECT_TRUE(info != NULL); | 6054 EXPECT_TRUE(info != NULL); |
| 6053 EXPECT_TRUE(info->target() == GL_TEXTURE_RECTANGLE_ARB); | 6055 EXPECT_TRUE(info->target() == GL_TEXTURE_RECTANGLE_ARB); |
| 6054 EXPECT_TRUE(info->min_filter() == GL_LINEAR); | 6056 EXPECT_TRUE(info->min_filter() == GL_LINEAR); |
| 6055 EXPECT_TRUE(info->wrap_s() == GL_CLAMP_TO_EDGE); | 6057 EXPECT_TRUE(info->wrap_s() == GL_CLAMP_TO_EDGE); |
| 6056 EXPECT_TRUE(info->wrap_t() == GL_CLAMP_TO_EDGE); | 6058 EXPECT_TRUE(info->wrap_t() == GL_CLAMP_TO_EDGE); |
| 6057 } | 6059 } |
| 6058 | 6060 |
| 6059 TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleTextureParamInvalid) { | 6061 TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleTextureParamInvalid) { |
| 6060 InitDecoder( | 6062 InitDecoder( |
| 6061 "GL_ARB_texture_rectangle", // extensions | 6063 "GL_ARB_texture_rectangle", // extensions |
| (...skipping 20 matching lines...) Expand all Loading... |
| 6082 GL_REPEAT); | 6084 GL_REPEAT); |
| 6083 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 6085 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 6084 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); | 6086 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); |
| 6085 | 6087 |
| 6086 cmd.Init(GL_TEXTURE_RECTANGLE_ARB, | 6088 cmd.Init(GL_TEXTURE_RECTANGLE_ARB, |
| 6087 GL_TEXTURE_WRAP_T, | 6089 GL_TEXTURE_WRAP_T, |
| 6088 GL_REPEAT); | 6090 GL_REPEAT); |
| 6089 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 6091 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 6090 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); | 6092 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); |
| 6091 | 6093 |
| 6092 TextureManager::TextureInfo* info = GetTextureInfo(client_texture_id_); | 6094 Texture* info = GetTexture(client_texture_id_); |
| 6093 EXPECT_TRUE(info != NULL); | 6095 EXPECT_TRUE(info != NULL); |
| 6094 EXPECT_TRUE(info->target() == GL_TEXTURE_RECTANGLE_ARB); | 6096 EXPECT_TRUE(info->target() == GL_TEXTURE_RECTANGLE_ARB); |
| 6095 EXPECT_TRUE(info->min_filter() == GL_LINEAR); | 6097 EXPECT_TRUE(info->min_filter() == GL_LINEAR); |
| 6096 EXPECT_TRUE(info->wrap_s() == GL_CLAMP_TO_EDGE); | 6098 EXPECT_TRUE(info->wrap_s() == GL_CLAMP_TO_EDGE); |
| 6097 EXPECT_TRUE(info->wrap_t() == GL_CLAMP_TO_EDGE); | 6099 EXPECT_TRUE(info->wrap_t() == GL_CLAMP_TO_EDGE); |
| 6098 } | 6100 } |
| 6099 | 6101 |
| 6100 TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleTexImage2DError) { | 6102 TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleTexImage2DError) { |
| 6101 InitDecoder( | 6103 InitDecoder( |
| 6102 "GL_ARB_texture_rectangle", // extensions | 6104 "GL_ARB_texture_rectangle", // extensions |
| 6103 false, // has alpha | 6105 false, // has alpha |
| 6104 false, // has depth | 6106 false, // has depth |
| 6105 false, // has stencil | 6107 false, // has stencil |
| 6106 false, // request alpha | 6108 false, // request alpha |
| 6107 false, // request depth | 6109 false, // request depth |
| 6108 false, // request stencil | 6110 false, // request stencil |
| 6109 true); // bind generates resource | 6111 true); // bind generates resource |
| 6110 | 6112 |
| 6111 GLenum target = GL_TEXTURE_RECTANGLE_ARB; | 6113 GLenum target = GL_TEXTURE_RECTANGLE_ARB; |
| 6112 GLint level = 0; | 6114 GLint level = 0; |
| 6113 GLenum internal_format = GL_RGBA; | 6115 GLenum internal_format = GL_RGBA; |
| 6114 GLsizei width = 2; | 6116 GLsizei width = 2; |
| 6115 GLsizei height = 4; | 6117 GLsizei height = 4; |
| 6116 GLint border = 0; | 6118 GLint border = 0; |
| 6117 GLenum format = GL_RGBA; | 6119 GLenum format = GL_RGBA; |
| 6118 GLenum type = GL_UNSIGNED_BYTE; | 6120 GLenum type = GL_UNSIGNED_BYTE; |
| 6119 DoBindTexture( | 6121 DoBindTexture( |
| 6120 GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId); | 6122 GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId); |
| 6121 ASSERT_TRUE(GetTextureInfo(client_texture_id_) != NULL); | 6123 ASSERT_TRUE(GetTexture(client_texture_id_) != NULL); |
| 6122 TexImage2D cmd; | 6124 TexImage2D cmd; |
| 6123 cmd.Init(target, level, internal_format, width, height, border, format, | 6125 cmd.Init(target, level, internal_format, width, height, border, format, |
| 6124 type, kSharedMemoryId, kSharedMemoryOffset); | 6126 type, kSharedMemoryId, kSharedMemoryOffset); |
| 6125 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 6127 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 6126 | 6128 |
| 6127 // TexImage2D is not allowed with GL_TEXTURE_RECTANGLE_ARB targets. | 6129 // TexImage2D is not allowed with GL_TEXTURE_RECTANGLE_ARB targets. |
| 6128 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); | 6130 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); |
| 6129 } | 6131 } |
| 6130 | 6132 |
| 6131 TEST_F(GLES2DecoderTest, EnableFeatureCHROMIUMBadBucket) { | 6133 TEST_F(GLES2DecoderTest, EnableFeatureCHROMIUMBadBucket) { |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6413 DrawArrays cmd; | 6415 DrawArrays cmd; |
| 6414 cmd.Init(GL_TRIANGLES, 0, kNumVertices); | 6416 cmd.Init(GL_TRIANGLES, 0, kNumVertices); |
| 6415 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 6417 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 6416 EXPECT_EQ(GL_INVALID_FRAMEBUFFER_OPERATION, GetGLError()); | 6418 EXPECT_EQ(GL_INVALID_FRAMEBUFFER_OPERATION, GetGLError()); |
| 6417 } | 6419 } |
| 6418 | 6420 |
| 6419 TEST_F(GLES2DecoderTest, CopyTexImage2DMarksTextureAsCleared) { | 6421 TEST_F(GLES2DecoderTest, CopyTexImage2DMarksTextureAsCleared) { |
| 6420 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 6422 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 6421 | 6423 |
| 6422 TextureManager* manager = group().texture_manager(); | 6424 TextureManager* manager = group().texture_manager(); |
| 6423 TextureManager::TextureInfo* info = | 6425 Texture* info = |
| 6424 manager->GetTextureInfo(client_texture_id_); | 6426 manager->GetTexture(client_texture_id_); |
| 6425 | 6427 |
| 6426 EXPECT_CALL(*gl_, GetError()) | 6428 EXPECT_CALL(*gl_, GetError()) |
| 6427 .WillOnce(Return(GL_NO_ERROR)) | 6429 .WillOnce(Return(GL_NO_ERROR)) |
| 6428 .RetiresOnSaturation(); | 6430 .RetiresOnSaturation(); |
| 6429 EXPECT_CALL(*gl_, CopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, 1, 1, 0)) | 6431 EXPECT_CALL(*gl_, CopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, 1, 1, 0)) |
| 6430 .Times(1) | 6432 .Times(1) |
| 6431 .RetiresOnSaturation(); | 6433 .RetiresOnSaturation(); |
| 6432 EXPECT_CALL(*gl_, GetError()) | 6434 EXPECT_CALL(*gl_, GetError()) |
| 6433 .WillOnce(Return(GL_NO_ERROR)) | 6435 .WillOnce(Return(GL_NO_ERROR)) |
| 6434 .RetiresOnSaturation(); | 6436 .RetiresOnSaturation(); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6475 .Times(1) | 6477 .Times(1) |
| 6476 .RetiresOnSaturation(); | 6478 .RetiresOnSaturation(); |
| 6477 EXPECT_CALL(*gl_, GetError()) | 6479 EXPECT_CALL(*gl_, GetError()) |
| 6478 .WillOnce(Return(GL_NO_ERROR)) | 6480 .WillOnce(Return(GL_NO_ERROR)) |
| 6479 .RetiresOnSaturation(); | 6481 .RetiresOnSaturation(); |
| 6480 CompressedTexImage2D cmd; | 6482 CompressedTexImage2D cmd; |
| 6481 cmd.Init(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, 4, 4, 0, | 6483 cmd.Init(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, 4, 4, 0, |
| 6482 8, kSharedMemoryId, kSharedMemoryOffset); | 6484 8, kSharedMemoryId, kSharedMemoryOffset); |
| 6483 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 6485 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 6484 TextureManager* manager = group().texture_manager(); | 6486 TextureManager* manager = group().texture_manager(); |
| 6485 TextureManager::TextureInfo* info = | 6487 Texture* info = |
| 6486 manager->GetTextureInfo(client_texture_id_); | 6488 manager->GetTexture(client_texture_id_); |
| 6487 EXPECT_TRUE(info->SafeToRenderFrom()); | 6489 EXPECT_TRUE(info->SafeToRenderFrom()); |
| 6488 } | 6490 } |
| 6489 | 6491 |
| 6490 TEST_F(GLES2DecoderWithShaderTest, UnClearedAttachmentsGetClearedOnClear) { | 6492 TEST_F(GLES2DecoderWithShaderTest, UnClearedAttachmentsGetClearedOnClear) { |
| 6491 const GLuint kFBOClientTextureId = 4100; | 6493 const GLuint kFBOClientTextureId = 4100; |
| 6492 const GLuint kFBOServiceTextureId = 4101; | 6494 const GLuint kFBOServiceTextureId = 4101; |
| 6493 | 6495 |
| 6494 // Register a texture id. | 6496 // Register a texture id. |
| 6495 EXPECT_CALL(*gl_, GenTextures(_, _)) | 6497 EXPECT_CALL(*gl_, GenTextures(_, _)) |
| 6496 .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId)) | 6498 .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId)) |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6852 GL_RENDERBUFFER, GL_RGBA4, GL_RGBA, 1, 1, GL_NO_ERROR); | 6854 GL_RENDERBUFFER, GL_RGBA4, GL_RGBA, 1, 1, GL_NO_ERROR); |
| 6853 DoFramebufferRenderbuffer( | 6855 DoFramebufferRenderbuffer( |
| 6854 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, | 6856 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, |
| 6855 client_renderbuffer_id_, kServiceRenderbufferId, GL_NO_ERROR); | 6857 client_renderbuffer_id_, kServiceRenderbufferId, GL_NO_ERROR); |
| 6856 | 6858 |
| 6857 | 6859 |
| 6858 if (!bound_fbo) { | 6860 if (!bound_fbo) { |
| 6859 DoBindFramebuffer(GL_FRAMEBUFFER, 0, 0); | 6861 DoBindFramebuffer(GL_FRAMEBUFFER, 0, 0); |
| 6860 } | 6862 } |
| 6861 | 6863 |
| 6862 FramebufferManager::FramebufferInfo* framebuffer = | 6864 Framebuffer* framebuffer = |
| 6863 framebuffer_manager->GetFramebufferInfo(client_framebuffer_id_); | 6865 framebuffer_manager->GetFramebuffer(client_framebuffer_id_); |
| 6864 ASSERT_TRUE(framebuffer != NULL); | 6866 ASSERT_TRUE(framebuffer != NULL); |
| 6865 framebuffer_manager->MarkAsComplete(framebuffer); | 6867 framebuffer_manager->MarkAsComplete(framebuffer); |
| 6866 EXPECT_TRUE(framebuffer_manager->IsComplete(framebuffer)); | 6868 EXPECT_TRUE(framebuffer_manager->IsComplete(framebuffer)); |
| 6867 | 6869 |
| 6868 // Test that renderbufferStorage marks fbo as not complete. | 6870 // Test that renderbufferStorage marks fbo as not complete. |
| 6869 DoRenderbufferStorage( | 6871 DoRenderbufferStorage( |
| 6870 GL_RENDERBUFFER, GL_RGBA4, GL_RGBA, 1, 1, GL_NO_ERROR); | 6872 GL_RENDERBUFFER, GL_RGBA4, GL_RGBA, 1, 1, GL_NO_ERROR); |
| 6871 EXPECT_FALSE(framebuffer_manager->IsComplete(framebuffer)); | 6873 EXPECT_FALSE(framebuffer_manager->IsComplete(framebuffer)); |
| 6872 framebuffer_manager->MarkAsComplete(framebuffer); | 6874 framebuffer_manager->MarkAsComplete(framebuffer); |
| 6873 EXPECT_TRUE(framebuffer_manager->IsComplete(framebuffer)); | 6875 EXPECT_TRUE(framebuffer_manager->IsComplete(framebuffer)); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6923 GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, | 6925 GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, |
| 6924 1, 1, GL_NO_ERROR); | 6926 1, 1, GL_NO_ERROR); |
| 6925 DoFramebufferRenderbuffer( | 6927 DoFramebufferRenderbuffer( |
| 6926 GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, | 6928 GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, |
| 6927 client_renderbuffer_id_, kServiceRenderbufferId, GL_NO_ERROR); | 6929 client_renderbuffer_id_, kServiceRenderbufferId, GL_NO_ERROR); |
| 6928 | 6930 |
| 6929 if (!bound_fbo) { | 6931 if (!bound_fbo) { |
| 6930 DoBindFramebuffer(GL_FRAMEBUFFER, 0, 0); | 6932 DoBindFramebuffer(GL_FRAMEBUFFER, 0, 0); |
| 6931 } | 6933 } |
| 6932 | 6934 |
| 6933 FramebufferManager::FramebufferInfo* framebuffer = | 6935 Framebuffer* framebuffer = |
| 6934 framebuffer_manager->GetFramebufferInfo(client_framebuffer_id_); | 6936 framebuffer_manager->GetFramebuffer(client_framebuffer_id_); |
| 6935 ASSERT_TRUE(framebuffer != NULL); | 6937 ASSERT_TRUE(framebuffer != NULL); |
| 6936 framebuffer_manager->MarkAsComplete(framebuffer); | 6938 framebuffer_manager->MarkAsComplete(framebuffer); |
| 6937 EXPECT_TRUE(framebuffer_manager->IsComplete(framebuffer)); | 6939 EXPECT_TRUE(framebuffer_manager->IsComplete(framebuffer)); |
| 6938 | 6940 |
| 6939 // Test TexImage2D marks fbo as not complete. | 6941 // Test TexImage2D marks fbo as not complete. |
| 6940 DoTexImage2D( | 6942 DoTexImage2D( |
| 6941 GL_TEXTURE_2D, 0, GL_RGB, 1, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, 0, 0); | 6943 GL_TEXTURE_2D, 0, GL_RGB, 1, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, 0, 0); |
| 6942 EXPECT_FALSE(framebuffer_manager->IsComplete(framebuffer)); | 6944 EXPECT_FALSE(framebuffer_manager->IsComplete(framebuffer)); |
| 6943 framebuffer_manager->MarkAsComplete(framebuffer); | 6945 framebuffer_manager->MarkAsComplete(framebuffer); |
| 6944 EXPECT_TRUE(framebuffer_manager->IsComplete(framebuffer)); | 6946 EXPECT_TRUE(framebuffer_manager->IsComplete(framebuffer)); |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7249 group().mailbox_manager()->GenerateMailboxName( | 7251 group().mailbox_manager()->GenerateMailboxName( |
| 7250 reinterpret_cast<MailboxName*>(mailbox)); | 7252 reinterpret_cast<MailboxName*>(mailbox)); |
| 7251 | 7253 |
| 7252 memcpy(shared_memory_address_, mailbox, sizeof(mailbox)); | 7254 memcpy(shared_memory_address_, mailbox, sizeof(mailbox)); |
| 7253 | 7255 |
| 7254 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 7256 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 7255 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 3, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, | 7257 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 3, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, |
| 7256 0, 0); | 7258 0, 0); |
| 7257 DoTexImage2D(GL_TEXTURE_2D, 1, GL_RGBA, 2, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE, | 7259 DoTexImage2D(GL_TEXTURE_2D, 1, GL_RGBA, 2, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE, |
| 7258 0, 0); | 7260 0, 0); |
| 7259 TextureManager::TextureInfo* info = | 7261 Texture* info = |
| 7260 group().texture_manager()->GetTextureInfo(client_texture_id_); | 7262 group().texture_manager()->GetTexture(client_texture_id_); |
| 7261 EXPECT_EQ(kServiceTextureId, info->service_id()); | 7263 EXPECT_EQ(kServiceTextureId, info->service_id()); |
| 7262 | 7264 |
| 7263 // Assigns and binds new service side texture ID. | 7265 // Assigns and binds new service side texture ID. |
| 7264 EXPECT_CALL(*gl_, GenTextures(1, _)) | 7266 EXPECT_CALL(*gl_, GenTextures(1, _)) |
| 7265 .WillOnce(SetArgumentPointee<1>(kNewServiceId)) | 7267 .WillOnce(SetArgumentPointee<1>(kNewServiceId)) |
| 7266 .RetiresOnSaturation(); | 7268 .RetiresOnSaturation(); |
| 7267 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, kNewServiceId)) | 7269 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, kNewServiceId)) |
| 7268 .Times(1) | 7270 .Times(1) |
| 7269 .RetiresOnSaturation(); | 7271 .RetiresOnSaturation(); |
| 7270 | 7272 |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7828 } | 7830 } |
| 7829 TEST_F(GLES2DecoderEmulatedVertexArraysOESTest, | 7831 TEST_F(GLES2DecoderEmulatedVertexArraysOESTest, |
| 7830 BindVertexArrayOESValidArgsNewId) { | 7832 BindVertexArrayOESValidArgsNewId) { |
| 7831 BindVertexArrayOESValidArgsNewId(); | 7833 BindVertexArrayOESValidArgsNewId(); |
| 7832 } | 7834 } |
| 7833 | 7835 |
| 7834 TEST_F(GLES2DecoderTest, BindTexImage2DCHROMIUM) { | 7836 TEST_F(GLES2DecoderTest, BindTexImage2DCHROMIUM) { |
| 7835 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 7837 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 7836 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 3, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, | 7838 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 3, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, |
| 7837 0, 0); | 7839 0, 0); |
| 7838 TextureManager::TextureInfo* info = | 7840 Texture* info = |
| 7839 group().texture_manager()->GetTextureInfo(client_texture_id_); | 7841 group().texture_manager()->GetTexture(client_texture_id_); |
| 7840 EXPECT_EQ(kServiceTextureId, info->service_id()); | 7842 EXPECT_EQ(kServiceTextureId, info->service_id()); |
| 7841 | 7843 |
| 7842 group().image_manager()->AddImage(gfx::GLImage::CreateGLImage(0), 1); | 7844 group().image_manager()->AddImage(gfx::GLImage::CreateGLImage(0), 1); |
| 7843 EXPECT_FALSE(group().image_manager()->LookupImage(1) == NULL); | 7845 EXPECT_FALSE(group().image_manager()->LookupImage(1) == NULL); |
| 7844 | 7846 |
| 7845 GLsizei width; | 7847 GLsizei width; |
| 7846 GLsizei height; | 7848 GLsizei height; |
| 7847 GLenum type; | 7849 GLenum type; |
| 7848 GLenum internal_format; | 7850 GLenum internal_format; |
| 7849 | 7851 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 7868 0, 0); | 7870 0, 0); |
| 7869 EXPECT_TRUE(info->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height)); | 7871 EXPECT_TRUE(info->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height)); |
| 7870 // Image should no longer be set. | 7872 // Image should no longer be set. |
| 7871 EXPECT_TRUE(info->GetLevelImage(GL_TEXTURE_2D, 0) == NULL); | 7873 EXPECT_TRUE(info->GetLevelImage(GL_TEXTURE_2D, 0) == NULL); |
| 7872 } | 7874 } |
| 7873 | 7875 |
| 7874 TEST_F(GLES2DecoderTest, ReleaseTexImage2DCHROMIUM) { | 7876 TEST_F(GLES2DecoderTest, ReleaseTexImage2DCHROMIUM) { |
| 7875 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 7877 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 7876 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 3, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, | 7878 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 3, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, |
| 7877 0, 0); | 7879 0, 0); |
| 7878 TextureManager::TextureInfo* info = | 7880 Texture* info = |
| 7879 group().texture_manager()->GetTextureInfo(client_texture_id_); | 7881 group().texture_manager()->GetTexture(client_texture_id_); |
| 7880 EXPECT_EQ(kServiceTextureId, info->service_id()); | 7882 EXPECT_EQ(kServiceTextureId, info->service_id()); |
| 7881 | 7883 |
| 7882 group().image_manager()->AddImage(gfx::GLImage::CreateGLImage(0), 1); | 7884 group().image_manager()->AddImage(gfx::GLImage::CreateGLImage(0), 1); |
| 7883 EXPECT_FALSE(group().image_manager()->LookupImage(1) == NULL); | 7885 EXPECT_FALSE(group().image_manager()->LookupImage(1) == NULL); |
| 7884 | 7886 |
| 7885 GLsizei width; | 7887 GLsizei width; |
| 7886 GLsizei height; | 7888 GLsizei height; |
| 7887 GLenum type; | 7889 GLenum type; |
| 7888 GLenum internal_format; | 7890 GLenum internal_format; |
| 7889 | 7891 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 7916 InitDecoder( | 7918 InitDecoder( |
| 7917 "GL_ARB_texture_rectangle", // extensions | 7919 "GL_ARB_texture_rectangle", // extensions |
| 7918 false, // has alpha | 7920 false, // has alpha |
| 7919 false, // has depth | 7921 false, // has depth |
| 7920 false, // has stencil | 7922 false, // has stencil |
| 7921 false, // request alpha | 7923 false, // request alpha |
| 7922 false, // request depth | 7924 false, // request depth |
| 7923 false, // request stencil | 7925 false, // request stencil |
| 7924 true); // bind generates resource | 7926 true); // bind generates resource |
| 7925 | 7927 |
| 7926 TextureManager::TextureInfo* info = GetTextureInfo(client_texture_id_); | 7928 Texture* info = GetTexture(client_texture_id_); |
| 7927 EXPECT_TRUE(info != NULL); | 7929 EXPECT_TRUE(info != NULL); |
| 7928 EXPECT_TRUE(info->pool() == GL_TEXTURE_POOL_UNMANAGED_CHROMIUM); | 7930 EXPECT_TRUE(info->pool() == GL_TEXTURE_POOL_UNMANAGED_CHROMIUM); |
| 7929 | 7931 |
| 7930 DoBindTexture( | 7932 DoBindTexture( |
| 7931 GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 7933 GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 7932 | 7934 |
| 7933 TexParameteri cmd; | 7935 TexParameteri cmd; |
| 7934 cmd.Init(GL_TEXTURE_2D, | 7936 cmd.Init(GL_TEXTURE_2D, |
| 7935 GL_TEXTURE_POOL_CHROMIUM, | 7937 GL_TEXTURE_POOL_CHROMIUM, |
| 7936 GL_TEXTURE_POOL_UNMANAGED_CHROMIUM); | 7938 GL_TEXTURE_POOL_UNMANAGED_CHROMIUM); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 7954 | 7956 |
| 7955 TEST_F(GLES2DecoderManualInitTest, AsyncPixelTransfers) { | 7957 TEST_F(GLES2DecoderManualInitTest, AsyncPixelTransfers) { |
| 7956 InitDecoder( | 7958 InitDecoder( |
| 7957 "GL_CHROMIUM_async_pixel_transfers", // extensions | 7959 "GL_CHROMIUM_async_pixel_transfers", // extensions |
| 7958 false, false, false, // has alpha/depth/stencil | 7960 false, false, false, // has alpha/depth/stencil |
| 7959 false, false, false, // request alpha/depth/stencil | 7961 false, false, false, // request alpha/depth/stencil |
| 7960 true); // bind generates resource | 7962 true); // bind generates resource |
| 7961 | 7963 |
| 7962 // Set up the texture. | 7964 // Set up the texture. |
| 7963 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 7965 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 7964 TextureManager::TextureInfo* info = GetTextureInfo(client_texture_id_); | 7966 Texture* info = GetTexture(client_texture_id_); |
| 7965 | 7967 |
| 7966 // Set a mock Async delegate | 7968 // Set a mock Async delegate |
| 7967 // Async state is returned as a scoped_ptr, but we keep a raw copy. | 7969 // Async state is returned as a scoped_ptr, but we keep a raw copy. |
| 7968 StrictMock<gfx::MockAsyncPixelTransferDelegate>* delegate = | 7970 StrictMock<gfx::MockAsyncPixelTransferDelegate>* delegate = |
| 7969 new StrictMock<gfx::MockAsyncPixelTransferDelegate>; | 7971 new StrictMock<gfx::MockAsyncPixelTransferDelegate>; |
| 7970 decoder_->SetAsyncPixelTransferDelegate(delegate); | 7972 decoder_->SetAsyncPixelTransferDelegate(delegate); |
| 7971 StrictMock<gfx::MockAsyncPixelTransferState>* state = NULL; | 7973 StrictMock<gfx::MockAsyncPixelTransferState>* state = NULL; |
| 7972 | 7974 |
| 7973 // Tex(Sub)Image2D upload commands. | 7975 // Tex(Sub)Image2D upload commands. |
| 7974 AsyncTexImage2DCHROMIUM teximage_cmd; | 7976 AsyncTexImage2DCHROMIUM teximage_cmd; |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8370 // TODO(gman): TexImage2DImmediate | 8372 // TODO(gman): TexImage2DImmediate |
| 8371 | 8373 |
| 8372 // TODO(gman): TexSubImage2DImmediate | 8374 // TODO(gman): TexSubImage2DImmediate |
| 8373 | 8375 |
| 8374 // TODO(gman): UseProgram | 8376 // TODO(gman): UseProgram |
| 8375 | 8377 |
| 8376 // TODO(gman): SwapBuffers | 8378 // TODO(gman): SwapBuffers |
| 8377 | 8379 |
| 8378 } // namespace gles2 | 8380 } // namespace gles2 |
| 8379 } // namespace gpu | 8381 } // namespace gpu |
| OLD | NEW |