| 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 // Tests for GLES2Implementation. | 5 // Tests for GLES2Implementation. |
| 6 | 6 |
| 7 #include "gpu/command_buffer/client/gles2_implementation.h" | 7 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 8 | 8 |
| 9 #include <GLES2/gl2ext.h> | 9 #include <GLES2/gl2ext.h> |
| 10 #include <GLES2/gl2extchromium.h> | 10 #include <GLES2/gl2extchromium.h> |
| (...skipping 2827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2838 expected.cmd.Init(GL_BLEND); // Note: BLEND defaults to disabled. | 2838 expected.cmd.Init(GL_BLEND); // Note: BLEND defaults to disabled. |
| 2839 | 2839 |
| 2840 gl_->Enable(GL_BLEND); | 2840 gl_->Enable(GL_BLEND); |
| 2841 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 2841 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 2842 // Check it's cached and not called again. | 2842 // Check it's cached and not called again. |
| 2843 ClearCommands(); | 2843 ClearCommands(); |
| 2844 gl_->Enable(GL_BLEND); | 2844 gl_->Enable(GL_BLEND); |
| 2845 EXPECT_TRUE(NoCommandsWritten()); | 2845 EXPECT_TRUE(NoCommandsWritten()); |
| 2846 } | 2846 } |
| 2847 | 2847 |
| 2848 TEST_F(GLES2ImplementationTest, ConsumeTextureCHROMIUM) { |
| 2849 struct Cmds { |
| 2850 cmds::ConsumeTextureCHROMIUMImmediate cmd; |
| 2851 GLbyte data[64]; |
| 2852 }; |
| 2853 |
| 2854 Mailbox mailbox = Mailbox::Generate(); |
| 2855 Cmds expected; |
| 2856 expected.cmd.Init(GL_TEXTURE_2D, mailbox.name); |
| 2857 gl_->ConsumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); |
| 2858 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 2859 } |
| 2860 |
| 2861 TEST_F(GLES2ImplementationTest, ProduceTextureCHROMIUM) { |
| 2862 struct Cmds { |
| 2863 cmds::ProduceTextureCHROMIUMImmediate cmd; |
| 2864 GLbyte data[64]; |
| 2865 }; |
| 2866 |
| 2867 Mailbox mailbox = Mailbox::Generate(); |
| 2868 Cmds expected; |
| 2869 expected.cmd.Init(GL_TEXTURE_2D, mailbox.name); |
| 2870 gl_->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); |
| 2871 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 2872 } |
| 2848 | 2873 |
| 2849 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" | 2874 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" |
| 2850 | 2875 |
| 2851 } // namespace gles2 | 2876 } // namespace gles2 |
| 2852 } // namespace gpu | 2877 } // namespace gpu |
| OLD | NEW |