| 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 // This file is auto-generated from | 5 // This file is auto-generated from |
| 6 // gpu/command_buffer/build_gles2_cmd_buffer.py | 6 // gpu/command_buffer/build_gles2_cmd_buffer.py |
| 7 // It's formatted by clang-format using chromium coding style: | 7 // It's formatted by clang-format using chromium coding style: |
| 8 // clang-format -i -style=chromium filename | 8 // clang-format -i -style=chromium filename |
| 9 // DO NOT EDIT! | 9 // DO NOT EDIT! |
| 10 | 10 |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 414 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 415 } | 415 } |
| 416 | 416 |
| 417 TEST_F(GLES2ImplementationTest, FramebufferRenderbuffer) { | 417 TEST_F(GLES2ImplementationTest, FramebufferRenderbuffer) { |
| 418 struct Cmds { | 418 struct Cmds { |
| 419 cmds::FramebufferRenderbuffer cmd; | 419 cmds::FramebufferRenderbuffer cmd; |
| 420 }; | 420 }; |
| 421 Cmds expected; | 421 Cmds expected; |
| 422 expected.cmd.Init(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, 4); | 422 expected.cmd.Init(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, 4); |
| 423 | 423 |
| 424 gl_->FramebufferRenderbuffer( | 424 gl_->FramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, |
| 425 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, 4); | 425 GL_RENDERBUFFER, 4); |
| 426 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 426 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 427 } | 427 } |
| 428 | 428 |
| 429 TEST_F(GLES2ImplementationTest, FramebufferTexture2D) { | 429 TEST_F(GLES2ImplementationTest, FramebufferTexture2D) { |
| 430 struct Cmds { | 430 struct Cmds { |
| 431 cmds::FramebufferTexture2D cmd; | 431 cmds::FramebufferTexture2D cmd; |
| 432 }; | 432 }; |
| 433 Cmds expected; | 433 Cmds expected; |
| 434 expected.cmd.Init(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 4); | 434 expected.cmd.Init(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 4); |
| 435 | 435 |
| 436 gl_->FramebufferTexture2D( | 436 gl_->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, |
| 437 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 4, 0); | 437 4, 0); |
| 438 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 438 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 439 } | 439 } |
| 440 | 440 |
| 441 TEST_F(GLES2ImplementationTest, FramebufferTexture2DInvalidConstantArg4) { | 441 TEST_F(GLES2ImplementationTest, FramebufferTexture2DInvalidConstantArg4) { |
| 442 gl_->FramebufferTexture2D( | 442 gl_->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, |
| 443 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 4, 1); | 443 4, 1); |
| 444 EXPECT_TRUE(NoCommandsWritten()); | 444 EXPECT_TRUE(NoCommandsWritten()); |
| 445 EXPECT_EQ(GL_INVALID_VALUE, CheckError()); | 445 EXPECT_EQ(GL_INVALID_VALUE, CheckError()); |
| 446 } | 446 } |
| 447 | 447 |
| 448 TEST_F(GLES2ImplementationTest, FrontFace) { | 448 TEST_F(GLES2ImplementationTest, FrontFace) { |
| 449 struct Cmds { | 449 struct Cmds { |
| 450 cmds::FrontFace cmd; | 450 cmds::FrontFace cmd; |
| 451 }; | 451 }; |
| 452 Cmds expected; | 452 Cmds expected; |
| 453 expected.cmd.Init(GL_CW); | 453 expected.cmd.Init(GL_CW); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 } | 595 } |
| 596 | 596 |
| 597 TEST_F(GLES2ImplementationTest, GetFramebufferAttachmentParameteriv) { | 597 TEST_F(GLES2ImplementationTest, GetFramebufferAttachmentParameteriv) { |
| 598 struct Cmds { | 598 struct Cmds { |
| 599 cmds::GetFramebufferAttachmentParameteriv cmd; | 599 cmds::GetFramebufferAttachmentParameteriv cmd; |
| 600 }; | 600 }; |
| 601 typedef cmds::GetFramebufferAttachmentParameteriv::Result Result; | 601 typedef cmds::GetFramebufferAttachmentParameteriv::Result Result; |
| 602 Result::Type result = 0; | 602 Result::Type result = 0; |
| 603 Cmds expected; | 603 Cmds expected; |
| 604 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4); | 604 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4); |
| 605 expected.cmd.Init(123, | 605 expected.cmd.Init(123, GL_COLOR_ATTACHMENT0, |
| 606 GL_COLOR_ATTACHMENT0, | 606 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, result1.id, |
| 607 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, | |
| 608 result1.id, | |
| 609 result1.offset); | 607 result1.offset); |
| 610 EXPECT_CALL(*command_buffer(), OnFlush()) | 608 EXPECT_CALL(*command_buffer(), OnFlush()) |
| 611 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1))) | 609 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1))) |
| 612 .RetiresOnSaturation(); | 610 .RetiresOnSaturation(); |
| 613 gl_->GetFramebufferAttachmentParameteriv( | 611 gl_->GetFramebufferAttachmentParameteriv( |
| 614 123, | 612 123, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, |
| 615 GL_COLOR_ATTACHMENT0, | |
| 616 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, | |
| 617 &result); | 613 &result); |
| 618 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 614 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 619 EXPECT_EQ(static_cast<Result::Type>(1), result); | 615 EXPECT_EQ(static_cast<Result::Type>(1), result); |
| 620 } | 616 } |
| 621 | 617 |
| 622 TEST_F(GLES2ImplementationTest, GetIntegerv) { | 618 TEST_F(GLES2ImplementationTest, GetIntegerv) { |
| 623 struct Cmds { | 619 struct Cmds { |
| 624 cmds::GetIntegerv cmd; | 620 cmds::GetIntegerv cmd; |
| 625 }; | 621 }; |
| 626 typedef cmds::GetIntegerv::Result Result; | 622 typedef cmds::GetIntegerv::Result Result; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 // TODO: Implement unit test for GetUniformLocation | 724 // TODO: Implement unit test for GetUniformLocation |
| 729 | 725 |
| 730 TEST_F(GLES2ImplementationTest, GetVertexAttribfv) { | 726 TEST_F(GLES2ImplementationTest, GetVertexAttribfv) { |
| 731 struct Cmds { | 727 struct Cmds { |
| 732 cmds::GetVertexAttribfv cmd; | 728 cmds::GetVertexAttribfv cmd; |
| 733 }; | 729 }; |
| 734 typedef cmds::GetVertexAttribfv::Result Result; | 730 typedef cmds::GetVertexAttribfv::Result Result; |
| 735 Result::Type result = 0; | 731 Result::Type result = 0; |
| 736 Cmds expected; | 732 Cmds expected; |
| 737 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4); | 733 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4); |
| 738 expected.cmd.Init( | 734 expected.cmd.Init(123, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, result1.id, |
| 739 123, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, result1.id, result1.offset); | 735 result1.offset); |
| 740 EXPECT_CALL(*command_buffer(), OnFlush()) | 736 EXPECT_CALL(*command_buffer(), OnFlush()) |
| 741 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1))) | 737 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1))) |
| 742 .RetiresOnSaturation(); | 738 .RetiresOnSaturation(); |
| 743 gl_->GetVertexAttribfv(123, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, &result); | 739 gl_->GetVertexAttribfv(123, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, &result); |
| 744 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 740 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 745 EXPECT_EQ(static_cast<Result::Type>(1), result); | 741 EXPECT_EQ(static_cast<Result::Type>(1), result); |
| 746 } | 742 } |
| 747 | 743 |
| 748 TEST_F(GLES2ImplementationTest, GetVertexAttribiv) { | 744 TEST_F(GLES2ImplementationTest, GetVertexAttribiv) { |
| 749 struct Cmds { | 745 struct Cmds { |
| 750 cmds::GetVertexAttribiv cmd; | 746 cmds::GetVertexAttribiv cmd; |
| 751 }; | 747 }; |
| 752 typedef cmds::GetVertexAttribiv::Result Result; | 748 typedef cmds::GetVertexAttribiv::Result Result; |
| 753 Result::Type result = 0; | 749 Result::Type result = 0; |
| 754 Cmds expected; | 750 Cmds expected; |
| 755 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4); | 751 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4); |
| 756 expected.cmd.Init( | 752 expected.cmd.Init(123, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, result1.id, |
| 757 123, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, result1.id, result1.offset); | 753 result1.offset); |
| 758 EXPECT_CALL(*command_buffer(), OnFlush()) | 754 EXPECT_CALL(*command_buffer(), OnFlush()) |
| 759 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1))) | 755 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1))) |
| 760 .RetiresOnSaturation(); | 756 .RetiresOnSaturation(); |
| 761 gl_->GetVertexAttribiv(123, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, &result); | 757 gl_->GetVertexAttribiv(123, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, &result); |
| 762 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 758 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 763 EXPECT_EQ(static_cast<Result::Type>(1), result); | 759 EXPECT_EQ(static_cast<Result::Type>(1), result); |
| 764 } | 760 } |
| 765 | 761 |
| 766 TEST_F(GLES2ImplementationTest, Hint) { | 762 TEST_F(GLES2ImplementationTest, Hint) { |
| 767 struct Cmds { | 763 struct Cmds { |
| (...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1592 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1588 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1593 } | 1589 } |
| 1594 | 1590 |
| 1595 TEST_F(GLES2ImplementationTest, RenderbufferStorageMultisampleCHROMIUM) { | 1591 TEST_F(GLES2ImplementationTest, RenderbufferStorageMultisampleCHROMIUM) { |
| 1596 struct Cmds { | 1592 struct Cmds { |
| 1597 cmds::RenderbufferStorageMultisampleCHROMIUM cmd; | 1593 cmds::RenderbufferStorageMultisampleCHROMIUM cmd; |
| 1598 }; | 1594 }; |
| 1599 Cmds expected; | 1595 Cmds expected; |
| 1600 expected.cmd.Init(GL_RENDERBUFFER, 2, GL_RGBA4, 4, 5); | 1596 expected.cmd.Init(GL_RENDERBUFFER, 2, GL_RGBA4, 4, 5); |
| 1601 | 1597 |
| 1602 gl_->RenderbufferStorageMultisampleCHROMIUM( | 1598 gl_->RenderbufferStorageMultisampleCHROMIUM(GL_RENDERBUFFER, 2, GL_RGBA4, 4, |
| 1603 GL_RENDERBUFFER, 2, GL_RGBA4, 4, 5); | 1599 5); |
| 1604 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1600 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1605 } | 1601 } |
| 1606 | 1602 |
| 1607 TEST_F(GLES2ImplementationTest, RenderbufferStorageMultisampleEXT) { | 1603 TEST_F(GLES2ImplementationTest, RenderbufferStorageMultisampleEXT) { |
| 1608 struct Cmds { | 1604 struct Cmds { |
| 1609 cmds::RenderbufferStorageMultisampleEXT cmd; | 1605 cmds::RenderbufferStorageMultisampleEXT cmd; |
| 1610 }; | 1606 }; |
| 1611 Cmds expected; | 1607 Cmds expected; |
| 1612 expected.cmd.Init(GL_RENDERBUFFER, 2, GL_RGBA4, 4, 5); | 1608 expected.cmd.Init(GL_RENDERBUFFER, 2, GL_RGBA4, 4, 5); |
| 1613 | 1609 |
| 1614 gl_->RenderbufferStorageMultisampleEXT(GL_RENDERBUFFER, 2, GL_RGBA4, 4, 5); | 1610 gl_->RenderbufferStorageMultisampleEXT(GL_RENDERBUFFER, 2, GL_RGBA4, 4, 5); |
| 1615 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1611 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1616 } | 1612 } |
| 1617 | 1613 |
| 1618 TEST_F(GLES2ImplementationTest, FramebufferTexture2DMultisampleEXT) { | 1614 TEST_F(GLES2ImplementationTest, FramebufferTexture2DMultisampleEXT) { |
| 1619 struct Cmds { | 1615 struct Cmds { |
| 1620 cmds::FramebufferTexture2DMultisampleEXT cmd; | 1616 cmds::FramebufferTexture2DMultisampleEXT cmd; |
| 1621 }; | 1617 }; |
| 1622 Cmds expected; | 1618 Cmds expected; |
| 1623 expected.cmd.Init(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 4, 6); | 1619 expected.cmd.Init(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 4, 6); |
| 1624 | 1620 |
| 1625 gl_->FramebufferTexture2DMultisampleEXT( | 1621 gl_->FramebufferTexture2DMultisampleEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, |
| 1626 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 4, 0, 6); | 1622 GL_TEXTURE_2D, 4, 0, 6); |
| 1627 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1623 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1628 } | 1624 } |
| 1629 | 1625 |
| 1630 TEST_F(GLES2ImplementationTest, | 1626 TEST_F(GLES2ImplementationTest, |
| 1631 FramebufferTexture2DMultisampleEXTInvalidConstantArg4) { | 1627 FramebufferTexture2DMultisampleEXTInvalidConstantArg4) { |
| 1632 gl_->FramebufferTexture2DMultisampleEXT( | 1628 gl_->FramebufferTexture2DMultisampleEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, |
| 1633 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 4, 1, 6); | 1629 GL_TEXTURE_2D, 4, 1, 6); |
| 1634 EXPECT_TRUE(NoCommandsWritten()); | 1630 EXPECT_TRUE(NoCommandsWritten()); |
| 1635 EXPECT_EQ(GL_INVALID_VALUE, CheckError()); | 1631 EXPECT_EQ(GL_INVALID_VALUE, CheckError()); |
| 1636 } | 1632 } |
| 1637 | 1633 |
| 1638 TEST_F(GLES2ImplementationTest, TexStorage2DEXT) { | 1634 TEST_F(GLES2ImplementationTest, TexStorage2DEXT) { |
| 1639 struct Cmds { | 1635 struct Cmds { |
| 1640 cmds::TexStorage2DEXT cmd; | 1636 cmds::TexStorage2DEXT cmd; |
| 1641 }; | 1637 }; |
| 1642 Cmds expected; | 1638 Cmds expected; |
| 1643 expected.cmd.Init(GL_TEXTURE_2D, 2, GL_RGB565, 4, 5); | 1639 expected.cmd.Init(GL_TEXTURE_2D, 2, GL_RGB565, 4, 5); |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1917 struct Cmds { | 1913 struct Cmds { |
| 1918 cmds::MatrixLoadIdentityCHROMIUM cmd; | 1914 cmds::MatrixLoadIdentityCHROMIUM cmd; |
| 1919 }; | 1915 }; |
| 1920 Cmds expected; | 1916 Cmds expected; |
| 1921 expected.cmd.Init(GL_PATH_PROJECTION_CHROMIUM); | 1917 expected.cmd.Init(GL_PATH_PROJECTION_CHROMIUM); |
| 1922 | 1918 |
| 1923 gl_->MatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM); | 1919 gl_->MatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM); |
| 1924 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1920 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1925 } | 1921 } |
| 1926 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_ | 1922 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_ |
| OLD | NEW |