| 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 |
| 11 // It is included by gles2_cmd_decoder_unittest_3.cc | 11 // It is included by gles2_cmd_decoder_unittest_3.cc |
| 12 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_3_AUTOGEN_H_ | 12 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_3_AUTOGEN_H_ |
| 13 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_3_AUTOGEN_H_ | 13 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_3_AUTOGEN_H_ |
| 14 | 14 |
| 15 TEST_P(GLES2DecoderTest3, UniformMatrix2x4fvImmediateValidArgs) { | 15 TEST_P(GLES2DecoderTest3, UniformMatrix2x4fvImmediateValidArgs) { |
| 16 cmds::UniformMatrix2x4fvImmediate& cmd = | 16 cmds::UniformMatrix2x4fvImmediate& cmd = |
| 17 *GetImmediateAs<cmds::UniformMatrix2x4fvImmediate>(); | 17 *GetImmediateAs<cmds::UniformMatrix2x4fvImmediate>(); |
| 18 EXPECT_CALL(*gl_, | |
| 19 UniformMatrix2x4fv(1, 2, true, reinterpret_cast<GLfloat*>( | |
| 20 ImmediateDataAddress(&cmd)))); | |
| 21 SpecializedSetup<cmds::UniformMatrix2x4fvImmediate, 0>(true); | 18 SpecializedSetup<cmds::UniformMatrix2x4fvImmediate, 0>(true); |
| 22 GLfloat temp[8 * 2] = { | 19 GLfloat temp[8 * 2] = { |
| 23 0, | 20 0, |
| 24 }; | 21 }; |
| 22 EXPECT_CALL(*gl_, UniformMatrix2x4fv(1, 2, true, PointsToArray(temp, 8))); |
| 25 cmd.Init(1, 2, true, &temp[0]); | 23 cmd.Init(1, 2, true, &temp[0]); |
| 26 decoder_->set_unsafe_es3_apis_enabled(true); | 24 decoder_->set_unsafe_es3_apis_enabled(true); |
| 27 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); | 25 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 28 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 26 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 29 decoder_->set_unsafe_es3_apis_enabled(false); | 27 decoder_->set_unsafe_es3_apis_enabled(false); |
| 30 EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp))); | 28 EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 31 } | 29 } |
| 32 | 30 |
| 33 TEST_P(GLES2DecoderTest3, UniformMatrix3x2fvImmediateValidArgs) { | 31 TEST_P(GLES2DecoderTest3, UniformMatrix3x2fvImmediateValidArgs) { |
| 34 cmds::UniformMatrix3x2fvImmediate& cmd = | 32 cmds::UniformMatrix3x2fvImmediate& cmd = |
| 35 *GetImmediateAs<cmds::UniformMatrix3x2fvImmediate>(); | 33 *GetImmediateAs<cmds::UniformMatrix3x2fvImmediate>(); |
| 36 EXPECT_CALL(*gl_, | |
| 37 UniformMatrix3x2fv(1, 2, true, reinterpret_cast<GLfloat*>( | |
| 38 ImmediateDataAddress(&cmd)))); | |
| 39 SpecializedSetup<cmds::UniformMatrix3x2fvImmediate, 0>(true); | 34 SpecializedSetup<cmds::UniformMatrix3x2fvImmediate, 0>(true); |
| 40 GLfloat temp[6 * 2] = { | 35 GLfloat temp[6 * 2] = { |
| 41 0, | 36 0, |
| 42 }; | 37 }; |
| 38 EXPECT_CALL(*gl_, UniformMatrix3x2fv(1, 2, true, PointsToArray(temp, 6))); |
| 43 cmd.Init(1, 2, true, &temp[0]); | 39 cmd.Init(1, 2, true, &temp[0]); |
| 44 decoder_->set_unsafe_es3_apis_enabled(true); | 40 decoder_->set_unsafe_es3_apis_enabled(true); |
| 45 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); | 41 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 46 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 42 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 47 decoder_->set_unsafe_es3_apis_enabled(false); | 43 decoder_->set_unsafe_es3_apis_enabled(false); |
| 48 EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp))); | 44 EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 49 } | 45 } |
| 50 | 46 |
| 51 TEST_P(GLES2DecoderTest3, UniformMatrix3x4fvImmediateValidArgs) { | 47 TEST_P(GLES2DecoderTest3, UniformMatrix3x4fvImmediateValidArgs) { |
| 52 cmds::UniformMatrix3x4fvImmediate& cmd = | 48 cmds::UniformMatrix3x4fvImmediate& cmd = |
| 53 *GetImmediateAs<cmds::UniformMatrix3x4fvImmediate>(); | 49 *GetImmediateAs<cmds::UniformMatrix3x4fvImmediate>(); |
| 54 EXPECT_CALL(*gl_, | |
| 55 UniformMatrix3x4fv(1, 2, true, reinterpret_cast<GLfloat*>( | |
| 56 ImmediateDataAddress(&cmd)))); | |
| 57 SpecializedSetup<cmds::UniformMatrix3x4fvImmediate, 0>(true); | 50 SpecializedSetup<cmds::UniformMatrix3x4fvImmediate, 0>(true); |
| 58 GLfloat temp[12 * 2] = { | 51 GLfloat temp[12 * 2] = { |
| 59 0, | 52 0, |
| 60 }; | 53 }; |
| 54 EXPECT_CALL(*gl_, UniformMatrix3x4fv(1, 2, true, PointsToArray(temp, 12))); |
| 61 cmd.Init(1, 2, true, &temp[0]); | 55 cmd.Init(1, 2, true, &temp[0]); |
| 62 decoder_->set_unsafe_es3_apis_enabled(true); | 56 decoder_->set_unsafe_es3_apis_enabled(true); |
| 63 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); | 57 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 64 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 58 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 65 decoder_->set_unsafe_es3_apis_enabled(false); | 59 decoder_->set_unsafe_es3_apis_enabled(false); |
| 66 EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp))); | 60 EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 67 } | 61 } |
| 68 | 62 |
| 69 TEST_P(GLES2DecoderTest3, UniformMatrix4x2fvImmediateValidArgs) { | 63 TEST_P(GLES2DecoderTest3, UniformMatrix4x2fvImmediateValidArgs) { |
| 70 cmds::UniformMatrix4x2fvImmediate& cmd = | 64 cmds::UniformMatrix4x2fvImmediate& cmd = |
| 71 *GetImmediateAs<cmds::UniformMatrix4x2fvImmediate>(); | 65 *GetImmediateAs<cmds::UniformMatrix4x2fvImmediate>(); |
| 72 EXPECT_CALL(*gl_, | |
| 73 UniformMatrix4x2fv(1, 2, true, reinterpret_cast<GLfloat*>( | |
| 74 ImmediateDataAddress(&cmd)))); | |
| 75 SpecializedSetup<cmds::UniformMatrix4x2fvImmediate, 0>(true); | 66 SpecializedSetup<cmds::UniformMatrix4x2fvImmediate, 0>(true); |
| 76 GLfloat temp[8 * 2] = { | 67 GLfloat temp[8 * 2] = { |
| 77 0, | 68 0, |
| 78 }; | 69 }; |
| 70 EXPECT_CALL(*gl_, UniformMatrix4x2fv(1, 2, true, PointsToArray(temp, 8))); |
| 79 cmd.Init(1, 2, true, &temp[0]); | 71 cmd.Init(1, 2, true, &temp[0]); |
| 80 decoder_->set_unsafe_es3_apis_enabled(true); | 72 decoder_->set_unsafe_es3_apis_enabled(true); |
| 81 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); | 73 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 82 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 74 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 83 decoder_->set_unsafe_es3_apis_enabled(false); | 75 decoder_->set_unsafe_es3_apis_enabled(false); |
| 84 EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp))); | 76 EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 85 } | 77 } |
| 86 | 78 |
| 87 TEST_P(GLES2DecoderTest3, UniformMatrix4x3fvImmediateValidArgs) { | 79 TEST_P(GLES2DecoderTest3, UniformMatrix4x3fvImmediateValidArgs) { |
| 88 cmds::UniformMatrix4x3fvImmediate& cmd = | 80 cmds::UniformMatrix4x3fvImmediate& cmd = |
| 89 *GetImmediateAs<cmds::UniformMatrix4x3fvImmediate>(); | 81 *GetImmediateAs<cmds::UniformMatrix4x3fvImmediate>(); |
| 90 EXPECT_CALL(*gl_, | |
| 91 UniformMatrix4x3fv(1, 2, true, reinterpret_cast<GLfloat*>( | |
| 92 ImmediateDataAddress(&cmd)))); | |
| 93 SpecializedSetup<cmds::UniformMatrix4x3fvImmediate, 0>(true); | 82 SpecializedSetup<cmds::UniformMatrix4x3fvImmediate, 0>(true); |
| 94 GLfloat temp[12 * 2] = { | 83 GLfloat temp[12 * 2] = { |
| 95 0, | 84 0, |
| 96 }; | 85 }; |
| 86 EXPECT_CALL(*gl_, UniformMatrix4x3fv(1, 2, true, PointsToArray(temp, 12))); |
| 97 cmd.Init(1, 2, true, &temp[0]); | 87 cmd.Init(1, 2, true, &temp[0]); |
| 98 decoder_->set_unsafe_es3_apis_enabled(true); | 88 decoder_->set_unsafe_es3_apis_enabled(true); |
| 99 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); | 89 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 100 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 90 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 101 decoder_->set_unsafe_es3_apis_enabled(false); | 91 decoder_->set_unsafe_es3_apis_enabled(false); |
| 102 EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp))); | 92 EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 103 } | 93 } |
| 104 | 94 |
| 105 TEST_P(GLES2DecoderTest3, UseProgramValidArgs) { | 95 TEST_P(GLES2DecoderTest3, UseProgramValidArgs) { |
| 106 EXPECT_CALL(*gl_, UseProgram(kServiceProgramId)); | 96 EXPECT_CALL(*gl_, UseProgram(kServiceProgramId)); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 } | 129 } |
| 140 | 130 |
| 141 TEST_P(GLES2DecoderTest3, VertexAttrib1fvImmediateValidArgs) { | 131 TEST_P(GLES2DecoderTest3, VertexAttrib1fvImmediateValidArgs) { |
| 142 cmds::VertexAttrib1fvImmediate& cmd = | 132 cmds::VertexAttrib1fvImmediate& cmd = |
| 143 *GetImmediateAs<cmds::VertexAttrib1fvImmediate>(); | 133 *GetImmediateAs<cmds::VertexAttrib1fvImmediate>(); |
| 144 SpecializedSetup<cmds::VertexAttrib1fvImmediate, 0>(true); | 134 SpecializedSetup<cmds::VertexAttrib1fvImmediate, 0>(true); |
| 145 GLfloat temp[1] = { | 135 GLfloat temp[1] = { |
| 146 0, | 136 0, |
| 147 }; | 137 }; |
| 148 cmd.Init(1, &temp[0]); | 138 cmd.Init(1, &temp[0]); |
| 149 EXPECT_CALL(*gl_, VertexAttrib1fv(1, reinterpret_cast<GLfloat*>( | 139 EXPECT_CALL(*gl_, VertexAttrib1fv(1, PointsToArray(temp, 1))); |
| 150 ImmediateDataAddress(&cmd)))); | |
| 151 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); | 140 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 152 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 141 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 153 } | 142 } |
| 154 | 143 |
| 155 TEST_P(GLES2DecoderTest3, VertexAttrib2fValidArgs) { | 144 TEST_P(GLES2DecoderTest3, VertexAttrib2fValidArgs) { |
| 156 EXPECT_CALL(*gl_, VertexAttrib2f(1, 2, 3)); | 145 EXPECT_CALL(*gl_, VertexAttrib2f(1, 2, 3)); |
| 157 SpecializedSetup<cmds::VertexAttrib2f, 0>(true); | 146 SpecializedSetup<cmds::VertexAttrib2f, 0>(true); |
| 158 cmds::VertexAttrib2f cmd; | 147 cmds::VertexAttrib2f cmd; |
| 159 cmd.Init(1, 2, 3); | 148 cmd.Init(1, 2, 3); |
| 160 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 149 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 161 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 150 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 162 } | 151 } |
| 163 | 152 |
| 164 TEST_P(GLES2DecoderTest3, VertexAttrib2fvImmediateValidArgs) { | 153 TEST_P(GLES2DecoderTest3, VertexAttrib2fvImmediateValidArgs) { |
| 165 cmds::VertexAttrib2fvImmediate& cmd = | 154 cmds::VertexAttrib2fvImmediate& cmd = |
| 166 *GetImmediateAs<cmds::VertexAttrib2fvImmediate>(); | 155 *GetImmediateAs<cmds::VertexAttrib2fvImmediate>(); |
| 167 SpecializedSetup<cmds::VertexAttrib2fvImmediate, 0>(true); | 156 SpecializedSetup<cmds::VertexAttrib2fvImmediate, 0>(true); |
| 168 GLfloat temp[2] = { | 157 GLfloat temp[2] = { |
| 169 0, | 158 0, |
| 170 }; | 159 }; |
| 171 cmd.Init(1, &temp[0]); | 160 cmd.Init(1, &temp[0]); |
| 172 EXPECT_CALL(*gl_, VertexAttrib2fv(1, reinterpret_cast<GLfloat*>( | 161 EXPECT_CALL(*gl_, VertexAttrib2fv(1, PointsToArray(temp, 2))); |
| 173 ImmediateDataAddress(&cmd)))); | |
| 174 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); | 162 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 175 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 163 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 176 } | 164 } |
| 177 | 165 |
| 178 TEST_P(GLES2DecoderTest3, VertexAttrib3fValidArgs) { | 166 TEST_P(GLES2DecoderTest3, VertexAttrib3fValidArgs) { |
| 179 EXPECT_CALL(*gl_, VertexAttrib3f(1, 2, 3, 4)); | 167 EXPECT_CALL(*gl_, VertexAttrib3f(1, 2, 3, 4)); |
| 180 SpecializedSetup<cmds::VertexAttrib3f, 0>(true); | 168 SpecializedSetup<cmds::VertexAttrib3f, 0>(true); |
| 181 cmds::VertexAttrib3f cmd; | 169 cmds::VertexAttrib3f cmd; |
| 182 cmd.Init(1, 2, 3, 4); | 170 cmd.Init(1, 2, 3, 4); |
| 183 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 171 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 184 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 172 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 185 } | 173 } |
| 186 | 174 |
| 187 TEST_P(GLES2DecoderTest3, VertexAttrib3fvImmediateValidArgs) { | 175 TEST_P(GLES2DecoderTest3, VertexAttrib3fvImmediateValidArgs) { |
| 188 cmds::VertexAttrib3fvImmediate& cmd = | 176 cmds::VertexAttrib3fvImmediate& cmd = |
| 189 *GetImmediateAs<cmds::VertexAttrib3fvImmediate>(); | 177 *GetImmediateAs<cmds::VertexAttrib3fvImmediate>(); |
| 190 SpecializedSetup<cmds::VertexAttrib3fvImmediate, 0>(true); | 178 SpecializedSetup<cmds::VertexAttrib3fvImmediate, 0>(true); |
| 191 GLfloat temp[3] = { | 179 GLfloat temp[3] = { |
| 192 0, | 180 0, |
| 193 }; | 181 }; |
| 194 cmd.Init(1, &temp[0]); | 182 cmd.Init(1, &temp[0]); |
| 195 EXPECT_CALL(*gl_, VertexAttrib3fv(1, reinterpret_cast<GLfloat*>( | 183 EXPECT_CALL(*gl_, VertexAttrib3fv(1, PointsToArray(temp, 3))); |
| 196 ImmediateDataAddress(&cmd)))); | |
| 197 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); | 184 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 198 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 185 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 199 } | 186 } |
| 200 | 187 |
| 201 TEST_P(GLES2DecoderTest3, VertexAttrib4fValidArgs) { | 188 TEST_P(GLES2DecoderTest3, VertexAttrib4fValidArgs) { |
| 202 EXPECT_CALL(*gl_, VertexAttrib4f(1, 2, 3, 4, 5)); | 189 EXPECT_CALL(*gl_, VertexAttrib4f(1, 2, 3, 4, 5)); |
| 203 SpecializedSetup<cmds::VertexAttrib4f, 0>(true); | 190 SpecializedSetup<cmds::VertexAttrib4f, 0>(true); |
| 204 cmds::VertexAttrib4f cmd; | 191 cmds::VertexAttrib4f cmd; |
| 205 cmd.Init(1, 2, 3, 4, 5); | 192 cmd.Init(1, 2, 3, 4, 5); |
| 206 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 193 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 207 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 194 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 208 } | 195 } |
| 209 | 196 |
| 210 TEST_P(GLES2DecoderTest3, VertexAttrib4fvImmediateValidArgs) { | 197 TEST_P(GLES2DecoderTest3, VertexAttrib4fvImmediateValidArgs) { |
| 211 cmds::VertexAttrib4fvImmediate& cmd = | 198 cmds::VertexAttrib4fvImmediate& cmd = |
| 212 *GetImmediateAs<cmds::VertexAttrib4fvImmediate>(); | 199 *GetImmediateAs<cmds::VertexAttrib4fvImmediate>(); |
| 213 SpecializedSetup<cmds::VertexAttrib4fvImmediate, 0>(true); | 200 SpecializedSetup<cmds::VertexAttrib4fvImmediate, 0>(true); |
| 214 GLfloat temp[4] = { | 201 GLfloat temp[4] = { |
| 215 0, | 202 0, |
| 216 }; | 203 }; |
| 217 cmd.Init(1, &temp[0]); | 204 cmd.Init(1, &temp[0]); |
| 218 EXPECT_CALL(*gl_, VertexAttrib4fv(1, reinterpret_cast<GLfloat*>( | 205 EXPECT_CALL(*gl_, VertexAttrib4fv(1, PointsToArray(temp, 4))); |
| 219 ImmediateDataAddress(&cmd)))); | |
| 220 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); | 206 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 221 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 207 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 222 } | 208 } |
| 223 | 209 |
| 224 TEST_P(GLES2DecoderTest3, VertexAttribI4iValidArgs) { | 210 TEST_P(GLES2DecoderTest3, VertexAttribI4iValidArgs) { |
| 225 EXPECT_CALL(*gl_, VertexAttribI4i(1, 2, 3, 4, 5)); | 211 EXPECT_CALL(*gl_, VertexAttribI4i(1, 2, 3, 4, 5)); |
| 226 SpecializedSetup<cmds::VertexAttribI4i, 0>(true); | 212 SpecializedSetup<cmds::VertexAttribI4i, 0>(true); |
| 227 cmds::VertexAttribI4i cmd; | 213 cmds::VertexAttribI4i cmd; |
| 228 cmd.Init(1, 2, 3, 4, 5); | 214 cmd.Init(1, 2, 3, 4, 5); |
| 229 decoder_->set_unsafe_es3_apis_enabled(true); | 215 decoder_->set_unsafe_es3_apis_enabled(true); |
| 230 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 216 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 231 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 217 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 232 decoder_->set_unsafe_es3_apis_enabled(false); | 218 decoder_->set_unsafe_es3_apis_enabled(false); |
| 233 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd)); | 219 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd)); |
| 234 } | 220 } |
| 235 | 221 |
| 236 TEST_P(GLES2DecoderTest3, VertexAttribI4ivImmediateValidArgs) { | 222 TEST_P(GLES2DecoderTest3, VertexAttribI4ivImmediateValidArgs) { |
| 237 cmds::VertexAttribI4ivImmediate& cmd = | 223 cmds::VertexAttribI4ivImmediate& cmd = |
| 238 *GetImmediateAs<cmds::VertexAttribI4ivImmediate>(); | 224 *GetImmediateAs<cmds::VertexAttribI4ivImmediate>(); |
| 239 SpecializedSetup<cmds::VertexAttribI4ivImmediate, 0>(true); | 225 SpecializedSetup<cmds::VertexAttribI4ivImmediate, 0>(true); |
| 240 GLint temp[4] = { | 226 GLint temp[4] = { |
| 241 0, | 227 0, |
| 242 }; | 228 }; |
| 243 cmd.Init(1, &temp[0]); | 229 cmd.Init(1, &temp[0]); |
| 244 EXPECT_CALL(*gl_, VertexAttribI4iv(1, reinterpret_cast<GLint*>( | 230 EXPECT_CALL(*gl_, VertexAttribI4iv(1, PointsToArray(temp, 4))); |
| 245 ImmediateDataAddress(&cmd)))); | |
| 246 decoder_->set_unsafe_es3_apis_enabled(true); | 231 decoder_->set_unsafe_es3_apis_enabled(true); |
| 247 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); | 232 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 248 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 233 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 249 decoder_->set_unsafe_es3_apis_enabled(false); | 234 decoder_->set_unsafe_es3_apis_enabled(false); |
| 250 EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp))); | 235 EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 251 } | 236 } |
| 252 | 237 |
| 253 TEST_P(GLES2DecoderTest3, VertexAttribI4uiValidArgs) { | 238 TEST_P(GLES2DecoderTest3, VertexAttribI4uiValidArgs) { |
| 254 EXPECT_CALL(*gl_, VertexAttribI4ui(1, 2, 3, 4, 5)); | 239 EXPECT_CALL(*gl_, VertexAttribI4ui(1, 2, 3, 4, 5)); |
| 255 SpecializedSetup<cmds::VertexAttribI4ui, 0>(true); | 240 SpecializedSetup<cmds::VertexAttribI4ui, 0>(true); |
| 256 cmds::VertexAttribI4ui cmd; | 241 cmds::VertexAttribI4ui cmd; |
| 257 cmd.Init(1, 2, 3, 4, 5); | 242 cmd.Init(1, 2, 3, 4, 5); |
| 258 decoder_->set_unsafe_es3_apis_enabled(true); | 243 decoder_->set_unsafe_es3_apis_enabled(true); |
| 259 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 244 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 260 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 245 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 261 decoder_->set_unsafe_es3_apis_enabled(false); | 246 decoder_->set_unsafe_es3_apis_enabled(false); |
| 262 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd)); | 247 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd)); |
| 263 } | 248 } |
| 264 | 249 |
| 265 TEST_P(GLES2DecoderTest3, VertexAttribI4uivImmediateValidArgs) { | 250 TEST_P(GLES2DecoderTest3, VertexAttribI4uivImmediateValidArgs) { |
| 266 cmds::VertexAttribI4uivImmediate& cmd = | 251 cmds::VertexAttribI4uivImmediate& cmd = |
| 267 *GetImmediateAs<cmds::VertexAttribI4uivImmediate>(); | 252 *GetImmediateAs<cmds::VertexAttribI4uivImmediate>(); |
| 268 SpecializedSetup<cmds::VertexAttribI4uivImmediate, 0>(true); | 253 SpecializedSetup<cmds::VertexAttribI4uivImmediate, 0>(true); |
| 269 GLuint temp[4] = { | 254 GLuint temp[4] = { |
| 270 0, | 255 0, |
| 271 }; | 256 }; |
| 272 cmd.Init(1, &temp[0]); | 257 cmd.Init(1, &temp[0]); |
| 273 EXPECT_CALL(*gl_, VertexAttribI4uiv(1, reinterpret_cast<GLuint*>( | 258 EXPECT_CALL(*gl_, VertexAttribI4uiv(1, PointsToArray(temp, 4))); |
| 274 ImmediateDataAddress(&cmd)))); | |
| 275 decoder_->set_unsafe_es3_apis_enabled(true); | 259 decoder_->set_unsafe_es3_apis_enabled(true); |
| 276 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); | 260 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 277 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 261 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 278 decoder_->set_unsafe_es3_apis_enabled(false); | 262 decoder_->set_unsafe_es3_apis_enabled(false); |
| 279 EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp))); | 263 EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 280 } | 264 } |
| 281 | 265 |
| 282 TEST_P(GLES2DecoderTest3, ViewportValidArgs) { | 266 TEST_P(GLES2DecoderTest3, ViewportValidArgs) { |
| 283 EXPECT_CALL(*gl_, Viewport(1, 2, 3, 4)); | 267 EXPECT_CALL(*gl_, Viewport(1, 2, 3, 4)); |
| 284 SpecializedSetup<cmds::Viewport, 0>(true); | 268 SpecializedSetup<cmds::Viewport, 0>(true); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 } | 307 } |
| 324 | 308 |
| 325 TEST_P(GLES2DecoderTest3, SwapIntervalValidArgs) { | 309 TEST_P(GLES2DecoderTest3, SwapIntervalValidArgs) { |
| 326 SpecializedSetup<cmds::SwapInterval, 0>(true); | 310 SpecializedSetup<cmds::SwapInterval, 0>(true); |
| 327 cmds::SwapInterval cmd; | 311 cmds::SwapInterval cmd; |
| 328 cmd.Init(1); | 312 cmd.Init(1); |
| 329 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 313 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 330 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 314 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 331 } | 315 } |
| 332 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_3_AUTOGEN_H_ | 316 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_3_AUTOGEN_H_ |
| OLD | NEW |