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_unittest_base.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 72 matching lines...) Loading... |
83 namespace gles2 { | 83 namespace gles2 { |
84 | 84 |
85 GLES2DecoderTestBase::GLES2DecoderTestBase() | 85 GLES2DecoderTestBase::GLES2DecoderTestBase() |
86 : surface_(NULL), | 86 : surface_(NULL), |
87 context_(NULL), | 87 context_(NULL), |
88 memory_tracker_(NULL), | 88 memory_tracker_(NULL), |
89 client_buffer_id_(100), | 89 client_buffer_id_(100), |
90 client_framebuffer_id_(101), | 90 client_framebuffer_id_(101), |
91 client_program_id_(102), | 91 client_program_id_(102), |
92 client_renderbuffer_id_(103), | 92 client_renderbuffer_id_(103), |
93 client_shader_id_(104), | 93 client_sampler_id_(104), |
| 94 client_shader_id_(105), |
94 client_texture_id_(106), | 95 client_texture_id_(106), |
95 client_element_buffer_id_(107), | 96 client_element_buffer_id_(107), |
96 client_vertex_shader_id_(121), | 97 client_vertex_shader_id_(121), |
97 client_fragment_shader_id_(122), | 98 client_fragment_shader_id_(122), |
98 client_query_id_(123), | 99 client_query_id_(123), |
99 client_vertexarray_id_(124), | 100 client_vertexarray_id_(124), |
100 client_valuebuffer_id_(125), | 101 client_valuebuffer_id_(125), |
| 102 client_transformfeedback_id_(126), |
101 service_renderbuffer_id_(0), | 103 service_renderbuffer_id_(0), |
102 service_renderbuffer_valid_(false), | 104 service_renderbuffer_valid_(false), |
103 ignore_cached_state_for_test_(GetParam()), | 105 ignore_cached_state_for_test_(GetParam()), |
104 cached_color_mask_red_(true), | 106 cached_color_mask_red_(true), |
105 cached_color_mask_green_(true), | 107 cached_color_mask_green_(true), |
106 cached_color_mask_blue_(true), | 108 cached_color_mask_blue_(true), |
107 cached_color_mask_alpha_(true), | 109 cached_color_mask_alpha_(true), |
108 cached_depth_mask_(true), | 110 cached_depth_mask_(true), |
109 cached_stencil_front_mask_(static_cast<GLuint>(-1)), | 111 cached_stencil_front_mask_(static_cast<GLuint>(-1)), |
110 cached_stencil_back_mask_(static_cast<GLuint>(-1)) { | 112 cached_stencil_back_mask_(static_cast<GLuint>(-1)) { |
(...skipping 295 matching lines...) Loading... |
406 .RetiresOnSaturation(); | 408 .RetiresOnSaturation(); |
407 GenHelper<cmds::GenTexturesImmediate>(client_texture_id_); | 409 GenHelper<cmds::GenTexturesImmediate>(client_texture_id_); |
408 EXPECT_CALL(*gl_, GenBuffersARB(_, _)) | 410 EXPECT_CALL(*gl_, GenBuffersARB(_, _)) |
409 .WillOnce(SetArgumentPointee<1>(kServiceElementBufferId)) | 411 .WillOnce(SetArgumentPointee<1>(kServiceElementBufferId)) |
410 .RetiresOnSaturation(); | 412 .RetiresOnSaturation(); |
411 GenHelper<cmds::GenBuffersImmediate>(client_element_buffer_id_); | 413 GenHelper<cmds::GenBuffersImmediate>(client_element_buffer_id_); |
412 | 414 |
413 DoCreateProgram(client_program_id_, kServiceProgramId); | 415 DoCreateProgram(client_program_id_, kServiceProgramId); |
414 DoCreateShader(GL_VERTEX_SHADER, client_shader_id_, kServiceShaderId); | 416 DoCreateShader(GL_VERTEX_SHADER, client_shader_id_, kServiceShaderId); |
415 | 417 |
| 418 // Unsafe commands. |
| 419 bool reset_unsafe_es3_apis_enabled = false; |
| 420 if (!decoder_->unsafe_es3_apis_enabled()) { |
| 421 decoder_->set_unsafe_es3_apis_enabled(true); |
| 422 reset_unsafe_es3_apis_enabled = true; |
| 423 } |
| 424 EXPECT_CALL(*gl_, GenSamplers(_, _)) |
| 425 .WillOnce(SetArgumentPointee<1>(kServiceSamplerId)) |
| 426 .RetiresOnSaturation(); |
| 427 GenHelper<cmds::GenSamplersImmediate>(client_sampler_id_); |
| 428 EXPECT_CALL(*gl_, GenTransformFeedbacks(_, _)) |
| 429 .WillOnce(SetArgumentPointee<1>(kServiceTransformFeedbackId)) |
| 430 .RetiresOnSaturation(); |
| 431 GenHelper<cmds::GenTransformFeedbacksImmediate>(client_transformfeedback_id_); |
| 432 if (reset_unsafe_es3_apis_enabled) { |
| 433 decoder_->set_unsafe_es3_apis_enabled(false); |
| 434 } |
| 435 |
416 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 436 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
417 } | 437 } |
418 | 438 |
419 void GLES2DecoderTestBase::ResetDecoder() { | 439 void GLES2DecoderTestBase::ResetDecoder() { |
420 if (!decoder_.get()) | 440 if (!decoder_.get()) |
421 return; | 441 return; |
422 // All Tests should have read all their GLErrors before getting here. | 442 // All Tests should have read all their GLErrors before getting here. |
423 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 443 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
424 | 444 |
425 EXPECT_CALL(*gl_, DeleteBuffersARB(1, _)) | 445 EXPECT_CALL(*gl_, DeleteBuffersARB(1, _)) |
(...skipping 812 matching lines...) Loading... |
1238 const GLint GLES2DecoderTestBase::kViewportY; | 1258 const GLint GLES2DecoderTestBase::kViewportY; |
1239 const GLint GLES2DecoderTestBase::kViewportWidth; | 1259 const GLint GLES2DecoderTestBase::kViewportWidth; |
1240 const GLint GLES2DecoderTestBase::kViewportHeight; | 1260 const GLint GLES2DecoderTestBase::kViewportHeight; |
1241 | 1261 |
1242 const GLuint GLES2DecoderTestBase::kServiceAttrib0BufferId; | 1262 const GLuint GLES2DecoderTestBase::kServiceAttrib0BufferId; |
1243 const GLuint GLES2DecoderTestBase::kServiceFixedAttribBufferId; | 1263 const GLuint GLES2DecoderTestBase::kServiceFixedAttribBufferId; |
1244 | 1264 |
1245 const GLuint GLES2DecoderTestBase::kServiceBufferId; | 1265 const GLuint GLES2DecoderTestBase::kServiceBufferId; |
1246 const GLuint GLES2DecoderTestBase::kServiceFramebufferId; | 1266 const GLuint GLES2DecoderTestBase::kServiceFramebufferId; |
1247 const GLuint GLES2DecoderTestBase::kServiceRenderbufferId; | 1267 const GLuint GLES2DecoderTestBase::kServiceRenderbufferId; |
| 1268 const GLuint GLES2DecoderTestBase::kServiceSamplerId; |
1248 const GLuint GLES2DecoderTestBase::kServiceTextureId; | 1269 const GLuint GLES2DecoderTestBase::kServiceTextureId; |
1249 const GLuint GLES2DecoderTestBase::kServiceProgramId; | 1270 const GLuint GLES2DecoderTestBase::kServiceProgramId; |
1250 const GLuint GLES2DecoderTestBase::kServiceShaderId; | 1271 const GLuint GLES2DecoderTestBase::kServiceShaderId; |
1251 const GLuint GLES2DecoderTestBase::kServiceElementBufferId; | 1272 const GLuint GLES2DecoderTestBase::kServiceElementBufferId; |
1252 const GLuint GLES2DecoderTestBase::kServiceQueryId; | 1273 const GLuint GLES2DecoderTestBase::kServiceQueryId; |
1253 const GLuint GLES2DecoderTestBase::kServiceVertexArrayId; | 1274 const GLuint GLES2DecoderTestBase::kServiceVertexArrayId; |
| 1275 const GLuint GLES2DecoderTestBase::kServiceTransformFeedbackId; |
1254 | 1276 |
1255 const int32 GLES2DecoderTestBase::kSharedMemoryId; | 1277 const int32 GLES2DecoderTestBase::kSharedMemoryId; |
1256 const size_t GLES2DecoderTestBase::kSharedBufferSize; | 1278 const size_t GLES2DecoderTestBase::kSharedBufferSize; |
1257 const uint32 GLES2DecoderTestBase::kSharedMemoryOffset; | 1279 const uint32 GLES2DecoderTestBase::kSharedMemoryOffset; |
1258 const int32 GLES2DecoderTestBase::kInvalidSharedMemoryId; | 1280 const int32 GLES2DecoderTestBase::kInvalidSharedMemoryId; |
1259 const uint32 GLES2DecoderTestBase::kInvalidSharedMemoryOffset; | 1281 const uint32 GLES2DecoderTestBase::kInvalidSharedMemoryOffset; |
1260 const uint32 GLES2DecoderTestBase::kInitialResult; | 1282 const uint32 GLES2DecoderTestBase::kInitialResult; |
1261 const uint8 GLES2DecoderTestBase::kInitialMemoryValue; | 1283 const uint8 GLES2DecoderTestBase::kInitialMemoryValue; |
1262 | 1284 |
1263 const uint32 GLES2DecoderTestBase::kNewClientId; | 1285 const uint32 GLES2DecoderTestBase::kNewClientId; |
(...skipping 408 matching lines...) Loading... |
1672 SetupDefaultProgram(); | 1694 SetupDefaultProgram(); |
1673 } | 1695 } |
1674 | 1696 |
1675 // Include the auto-generated part of this file. We split this because it means | 1697 // Include the auto-generated part of this file. We split this because it means |
1676 // we can easily edit the non-auto generated parts right here in this file | 1698 // we can easily edit the non-auto generated parts right here in this file |
1677 // instead of having to edit some template or the code generator. | 1699 // instead of having to edit some template or the code generator. |
1678 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" | 1700 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" |
1679 | 1701 |
1680 } // namespace gles2 | 1702 } // namespace gles2 |
1681 } // namespace gpu | 1703 } // namespace gpu |
OLD | NEW |