Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc

Issue 2543033002: Add texture swizzle back to command buffer. (Closed)
Patch Set: add swizzle value negative test Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_unittest.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest.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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 cmd.Init(cap); 83 cmd.Init(cap);
84 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 84 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
85 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 85 EXPECT_EQ(GL_NO_ERROR, GetGLError());
86 } 86 }
87 } 87 }
88 88
89 89
90 TEST_P(GLES3DecoderTest, Basic) { 90 TEST_P(GLES3DecoderTest, Basic) {
91 // Make sure the setup is correct for ES3. 91 // Make sure the setup is correct for ES3.
92 EXPECT_TRUE(feature_info()->IsWebGL2OrES3Context()); 92 EXPECT_TRUE(feature_info()->IsWebGL2OrES3Context());
93 EXPECT_FALSE(feature_info()->IsWebGLContext());
93 EXPECT_TRUE(feature_info()->validators()->texture_bind_target.IsValid( 94 EXPECT_TRUE(feature_info()->validators()->texture_bind_target.IsValid(
94 GL_TEXTURE_3D)); 95 GL_TEXTURE_3D));
95 } 96 }
97
98 TEST_P(WebGL2DecoderTest, Basic) {
99 // Make sure the setup is correct for WebGL2.
100 EXPECT_TRUE(feature_info()->IsWebGL2OrES3Context());
101 EXPECT_TRUE(feature_info()->IsWebGLContext());
102 EXPECT_TRUE(feature_info()->validators()->texture_bind_target.IsValid(
103 GL_TEXTURE_3D));
104 }
96 105
97 TEST_P(GLES2DecoderTest, InvalidCommand) { 106 TEST_P(GLES2DecoderTest, InvalidCommand) {
98 cmd::Noop cmd; 107 cmd::Noop cmd;
99 cmd.header.Init(gles2::kNumCommands, 1); 108 cmd.header.Init(gles2::kNumCommands, 1);
100 EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, 0)); 109 EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, 0));
101 } 110 }
102 111
103 TEST_P(GLES2DecoderTest, GetIntegervCached) { 112 TEST_P(GLES2DecoderTest, GetIntegervCached) {
104 struct TestInfo { 113 struct TestInfo {
105 GLenum pname; 114 GLenum pname;
(...skipping 1582 matching lines...) Expand 10 before | Expand all | Expand 10 after
1688 } 1697 }
1689 1698
1690 void GLES3DecoderTest::SetUp() { 1699 void GLES3DecoderTest::SetUp() {
1691 InitState init; 1700 InitState init;
1692 init.gl_version = "OpenGL ES 3.0"; 1701 init.gl_version = "OpenGL ES 3.0";
1693 init.bind_generates_resource = true; 1702 init.bind_generates_resource = true;
1694 init.context_type = CONTEXT_TYPE_OPENGLES3; 1703 init.context_type = CONTEXT_TYPE_OPENGLES3;
1695 InitDecoder(init); 1704 InitDecoder(init);
1696 } 1705 }
1697 1706
1707 void WebGL2DecoderTest::SetUp() {
1708 InitState init;
1709 init.gl_version = "OpenGL ES 3.0";
1710 init.bind_generates_resource = true;
1711 init.context_type = CONTEXT_TYPE_WEBGL2;
1712 InitDecoder(init);
1713 }
1714
1698 void GLES3DecoderWithShaderTest::SetUp() { 1715 void GLES3DecoderWithShaderTest::SetUp() {
1699 InitState init; 1716 InitState init;
1700 init.gl_version = "OpenGL ES 3.0"; 1717 init.gl_version = "OpenGL ES 3.0";
1701 init.bind_generates_resource = true; 1718 init.bind_generates_resource = true;
1702 init.context_type = CONTEXT_TYPE_OPENGLES3; 1719 init.context_type = CONTEXT_TYPE_OPENGLES3;
1703 InitDecoder(init); 1720 InitDecoder(init);
1704 SetupDefaultProgram(); 1721 SetupDefaultProgram();
1705 } 1722 }
1706 1723
1707 void GLES3DecoderRGBBackbufferTest::SetUp() { 1724 void GLES3DecoderRGBBackbufferTest::SetUp() {
(...skipping 30 matching lines...) Expand all
1738 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderWithShaderTest, ::testing::Bool()); 1755 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderWithShaderTest, ::testing::Bool());
1739 1756
1740 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderManualInitTest, ::testing::Bool()); 1757 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderManualInitTest, ::testing::Bool());
1741 1758
1742 INSTANTIATE_TEST_CASE_P(Service, 1759 INSTANTIATE_TEST_CASE_P(Service,
1743 GLES3DecoderRGBBackbufferTest, 1760 GLES3DecoderRGBBackbufferTest,
1744 ::testing::Bool()); 1761 ::testing::Bool());
1745 1762
1746 } // namespace gles2 1763 } // namespace gles2
1747 } // namespace gpu 1764 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698