| 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...) Expand 10 before | Expand all | Expand 10 after 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), |
| 101 service_renderbuffer_id_(0), | 102 service_renderbuffer_id_(0), |
| 102 service_renderbuffer_valid_(false), | 103 service_renderbuffer_valid_(false), |
| 103 ignore_cached_state_for_test_(GetParam()), | 104 ignore_cached_state_for_test_(GetParam()), |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 .RetiresOnSaturation(); | 407 .RetiresOnSaturation(); |
| 407 GenHelper<cmds::GenTexturesImmediate>(client_texture_id_); | 408 GenHelper<cmds::GenTexturesImmediate>(client_texture_id_); |
| 408 EXPECT_CALL(*gl_, GenBuffersARB(_, _)) | 409 EXPECT_CALL(*gl_, GenBuffersARB(_, _)) |
| 409 .WillOnce(SetArgumentPointee<1>(kServiceElementBufferId)) | 410 .WillOnce(SetArgumentPointee<1>(kServiceElementBufferId)) |
| 410 .RetiresOnSaturation(); | 411 .RetiresOnSaturation(); |
| 411 GenHelper<cmds::GenBuffersImmediate>(client_element_buffer_id_); | 412 GenHelper<cmds::GenBuffersImmediate>(client_element_buffer_id_); |
| 412 | 413 |
| 413 DoCreateProgram(client_program_id_, kServiceProgramId); | 414 DoCreateProgram(client_program_id_, kServiceProgramId); |
| 414 DoCreateShader(GL_VERTEX_SHADER, client_shader_id_, kServiceShaderId); | 415 DoCreateShader(GL_VERTEX_SHADER, client_shader_id_, kServiceShaderId); |
| 415 | 416 |
| 417 // Unsafe commands. |
| 418 bool reset_unsafe_es3_apis_enabled = false; |
| 419 if (!decoder_->unsafe_es3_apis_enabled()) { |
| 420 decoder_->set_unsafe_es3_apis_enabled(true); |
| 421 reset_unsafe_es3_apis_enabled = true; |
| 422 } |
| 423 EXPECT_CALL(*gl_, GenSamplers(_, _)) |
| 424 .WillOnce(SetArgumentPointee<1>(kServiceSamplerId)) |
| 425 .RetiresOnSaturation(); |
| 426 GenHelper<cmds::GenSamplersImmediate>(client_sampler_id_); |
| 427 if (reset_unsafe_es3_apis_enabled) { |
| 428 decoder_->set_unsafe_es3_apis_enabled(false); |
| 429 } |
| 430 |
| 416 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 431 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 417 } | 432 } |
| 418 | 433 |
| 419 void GLES2DecoderTestBase::ResetDecoder() { | 434 void GLES2DecoderTestBase::ResetDecoder() { |
| 420 if (!decoder_.get()) | 435 if (!decoder_.get()) |
| 421 return; | 436 return; |
| 422 // All Tests should have read all their GLErrors before getting here. | 437 // All Tests should have read all their GLErrors before getting here. |
| 423 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 438 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 424 | 439 |
| 425 EXPECT_CALL(*gl_, DeleteBuffersARB(1, _)) | 440 EXPECT_CALL(*gl_, DeleteBuffersARB(1, _)) |
| (...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1238 const GLint GLES2DecoderTestBase::kViewportY; | 1253 const GLint GLES2DecoderTestBase::kViewportY; |
| 1239 const GLint GLES2DecoderTestBase::kViewportWidth; | 1254 const GLint GLES2DecoderTestBase::kViewportWidth; |
| 1240 const GLint GLES2DecoderTestBase::kViewportHeight; | 1255 const GLint GLES2DecoderTestBase::kViewportHeight; |
| 1241 | 1256 |
| 1242 const GLuint GLES2DecoderTestBase::kServiceAttrib0BufferId; | 1257 const GLuint GLES2DecoderTestBase::kServiceAttrib0BufferId; |
| 1243 const GLuint GLES2DecoderTestBase::kServiceFixedAttribBufferId; | 1258 const GLuint GLES2DecoderTestBase::kServiceFixedAttribBufferId; |
| 1244 | 1259 |
| 1245 const GLuint GLES2DecoderTestBase::kServiceBufferId; | 1260 const GLuint GLES2DecoderTestBase::kServiceBufferId; |
| 1246 const GLuint GLES2DecoderTestBase::kServiceFramebufferId; | 1261 const GLuint GLES2DecoderTestBase::kServiceFramebufferId; |
| 1247 const GLuint GLES2DecoderTestBase::kServiceRenderbufferId; | 1262 const GLuint GLES2DecoderTestBase::kServiceRenderbufferId; |
| 1263 const GLuint GLES2DecoderTestBase::kServiceSamplerId; |
| 1248 const GLuint GLES2DecoderTestBase::kServiceTextureId; | 1264 const GLuint GLES2DecoderTestBase::kServiceTextureId; |
| 1249 const GLuint GLES2DecoderTestBase::kServiceProgramId; | 1265 const GLuint GLES2DecoderTestBase::kServiceProgramId; |
| 1250 const GLuint GLES2DecoderTestBase::kServiceShaderId; | 1266 const GLuint GLES2DecoderTestBase::kServiceShaderId; |
| 1251 const GLuint GLES2DecoderTestBase::kServiceElementBufferId; | 1267 const GLuint GLES2DecoderTestBase::kServiceElementBufferId; |
| 1252 const GLuint GLES2DecoderTestBase::kServiceQueryId; | 1268 const GLuint GLES2DecoderTestBase::kServiceQueryId; |
| 1253 const GLuint GLES2DecoderTestBase::kServiceVertexArrayId; | 1269 const GLuint GLES2DecoderTestBase::kServiceVertexArrayId; |
| 1254 | 1270 |
| 1255 const int32 GLES2DecoderTestBase::kSharedMemoryId; | 1271 const int32 GLES2DecoderTestBase::kSharedMemoryId; |
| 1256 const size_t GLES2DecoderTestBase::kSharedBufferSize; | 1272 const size_t GLES2DecoderTestBase::kSharedBufferSize; |
| 1257 const uint32 GLES2DecoderTestBase::kSharedMemoryOffset; | 1273 const uint32 GLES2DecoderTestBase::kSharedMemoryOffset; |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1672 SetupDefaultProgram(); | 1688 SetupDefaultProgram(); |
| 1673 } | 1689 } |
| 1674 | 1690 |
| 1675 // Include the auto-generated part of this file. We split this because it means | 1691 // 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 | 1692 // 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. | 1693 // instead of having to edit some template or the code generator. |
| 1678 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" | 1694 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" |
| 1679 | 1695 |
| 1680 } // namespace gles2 | 1696 } // namespace gles2 |
| 1681 } // namespace gpu | 1697 } // namespace gpu |
| OLD | NEW |