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

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

Issue 859043005: Add Sync related APIs to GPU command buffer: Part I (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make win bots happy Created 5 years, 11 months 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
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 client_sampler_id_(104), 93 client_sampler_id_(104),
94 client_shader_id_(105), 94 client_shader_id_(105),
95 client_texture_id_(106), 95 client_texture_id_(106),
96 client_element_buffer_id_(107), 96 client_element_buffer_id_(107),
97 client_vertex_shader_id_(121), 97 client_vertex_shader_id_(121),
98 client_fragment_shader_id_(122), 98 client_fragment_shader_id_(122),
99 client_query_id_(123), 99 client_query_id_(123),
100 client_vertexarray_id_(124), 100 client_vertexarray_id_(124),
101 client_valuebuffer_id_(125), 101 client_valuebuffer_id_(125),
102 client_transformfeedback_id_(126), 102 client_transformfeedback_id_(126),
103 client_sync_id_(127),
103 service_renderbuffer_id_(0), 104 service_renderbuffer_id_(0),
104 service_renderbuffer_valid_(false), 105 service_renderbuffer_valid_(false),
105 ignore_cached_state_for_test_(GetParam()), 106 ignore_cached_state_for_test_(GetParam()),
106 cached_color_mask_red_(true), 107 cached_color_mask_red_(true),
107 cached_color_mask_green_(true), 108 cached_color_mask_green_(true),
108 cached_color_mask_blue_(true), 109 cached_color_mask_blue_(true),
109 cached_color_mask_alpha_(true), 110 cached_color_mask_alpha_(true),
110 cached_depth_mask_(true), 111 cached_depth_mask_(true),
111 cached_stencil_front_mask_(static_cast<GLuint>(-1)), 112 cached_stencil_front_mask_(static_cast<GLuint>(-1)),
112 cached_stencil_back_mask_(static_cast<GLuint>(-1)) { 113 cached_stencil_back_mask_(static_cast<GLuint>(-1)) {
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 reset_unsafe_es3_apis_enabled = true; 424 reset_unsafe_es3_apis_enabled = true;
424 } 425 }
425 EXPECT_CALL(*gl_, GenSamplers(_, _)) 426 EXPECT_CALL(*gl_, GenSamplers(_, _))
426 .WillOnce(SetArgumentPointee<1>(kServiceSamplerId)) 427 .WillOnce(SetArgumentPointee<1>(kServiceSamplerId))
427 .RetiresOnSaturation(); 428 .RetiresOnSaturation();
428 GenHelper<cmds::GenSamplersImmediate>(client_sampler_id_); 429 GenHelper<cmds::GenSamplersImmediate>(client_sampler_id_);
429 EXPECT_CALL(*gl_, GenTransformFeedbacks(_, _)) 430 EXPECT_CALL(*gl_, GenTransformFeedbacks(_, _))
430 .WillOnce(SetArgumentPointee<1>(kServiceTransformFeedbackId)) 431 .WillOnce(SetArgumentPointee<1>(kServiceTransformFeedbackId))
431 .RetiresOnSaturation(); 432 .RetiresOnSaturation();
432 GenHelper<cmds::GenTransformFeedbacksImmediate>(client_transformfeedback_id_); 433 GenHelper<cmds::GenTransformFeedbacksImmediate>(client_transformfeedback_id_);
434 DoFenceSync(client_sync_id_, kServiceSyncId);
433 if (reset_unsafe_es3_apis_enabled) { 435 if (reset_unsafe_es3_apis_enabled) {
434 decoder_->set_unsafe_es3_apis_enabled(false); 436 decoder_->set_unsafe_es3_apis_enabled(false);
435 } 437 }
436 438
437 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 439 EXPECT_EQ(GL_NO_ERROR, GetGLError());
438 } 440 }
439 441
440 void GLES2DecoderTestBase::ResetDecoder() { 442 void GLES2DecoderTestBase::ResetDecoder() {
441 if (!decoder_.get()) 443 if (!decoder_.get())
442 return; 444 return;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 return IsObjectHelper<cmds::IsProgram, cmds::IsProgram::Result>(client_id); 531 return IsObjectHelper<cmds::IsProgram, cmds::IsProgram::Result>(client_id);
530 } 532 }
531 533
532 void GLES2DecoderTestBase::DoDeleteProgram( 534 void GLES2DecoderTestBase::DoDeleteProgram(
533 GLuint client_id, GLuint /* service_id */) { 535 GLuint client_id, GLuint /* service_id */) {
534 cmds::DeleteProgram cmd; 536 cmds::DeleteProgram cmd;
535 cmd.Init(client_id); 537 cmd.Init(client_id);
536 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 538 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
537 } 539 }
538 540
541 void GLES2DecoderTestBase::DoFenceSync(
542 GLuint client_id, GLuint service_id) {
543 EXPECT_CALL(*gl_, FenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0))
544 .Times(1)
545 .WillOnce(Return(reinterpret_cast<GLsync>(service_id)))
546 .RetiresOnSaturation();
547 cmds::FenceSync cmd;
548 cmd.Init(client_id);
549 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
550 }
551
539 void GLES2DecoderTestBase::SetBucketAsCString( 552 void GLES2DecoderTestBase::SetBucketAsCString(
540 uint32 bucket_id, const char* str) { 553 uint32 bucket_id, const char* str) {
541 uint32 size = str ? (strlen(str) + 1) : 0; 554 uint32 size = str ? (strlen(str) + 1) : 0;
542 cmd::SetBucketSize cmd1; 555 cmd::SetBucketSize cmd1;
543 cmd1.Init(bucket_id, size); 556 cmd1.Init(bucket_id, size);
544 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd1)); 557 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd1));
545 if (str) { 558 if (str) {
546 memcpy(shared_memory_address_, str, size); 559 memcpy(shared_memory_address_, str, size);
547 cmd::SetBucketData cmd2; 560 cmd::SetBucketData cmd2;
548 cmd2.Init(bucket_id, 0, size, kSharedMemoryId, kSharedMemoryOffset); 561 cmd2.Init(bucket_id, 0, size, kSharedMemoryId, kSharedMemoryOffset);
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
1300 const GLuint GLES2DecoderTestBase::kServiceFramebufferId; 1313 const GLuint GLES2DecoderTestBase::kServiceFramebufferId;
1301 const GLuint GLES2DecoderTestBase::kServiceRenderbufferId; 1314 const GLuint GLES2DecoderTestBase::kServiceRenderbufferId;
1302 const GLuint GLES2DecoderTestBase::kServiceSamplerId; 1315 const GLuint GLES2DecoderTestBase::kServiceSamplerId;
1303 const GLuint GLES2DecoderTestBase::kServiceTextureId; 1316 const GLuint GLES2DecoderTestBase::kServiceTextureId;
1304 const GLuint GLES2DecoderTestBase::kServiceProgramId; 1317 const GLuint GLES2DecoderTestBase::kServiceProgramId;
1305 const GLuint GLES2DecoderTestBase::kServiceShaderId; 1318 const GLuint GLES2DecoderTestBase::kServiceShaderId;
1306 const GLuint GLES2DecoderTestBase::kServiceElementBufferId; 1319 const GLuint GLES2DecoderTestBase::kServiceElementBufferId;
1307 const GLuint GLES2DecoderTestBase::kServiceQueryId; 1320 const GLuint GLES2DecoderTestBase::kServiceQueryId;
1308 const GLuint GLES2DecoderTestBase::kServiceVertexArrayId; 1321 const GLuint GLES2DecoderTestBase::kServiceVertexArrayId;
1309 const GLuint GLES2DecoderTestBase::kServiceTransformFeedbackId; 1322 const GLuint GLES2DecoderTestBase::kServiceTransformFeedbackId;
1323 const GLuint GLES2DecoderTestBase::kServiceSyncId;
1310 1324
1311 const int32 GLES2DecoderTestBase::kSharedMemoryId; 1325 const int32 GLES2DecoderTestBase::kSharedMemoryId;
1312 const size_t GLES2DecoderTestBase::kSharedBufferSize; 1326 const size_t GLES2DecoderTestBase::kSharedBufferSize;
1313 const uint32 GLES2DecoderTestBase::kSharedMemoryOffset; 1327 const uint32 GLES2DecoderTestBase::kSharedMemoryOffset;
1314 const int32 GLES2DecoderTestBase::kInvalidSharedMemoryId; 1328 const int32 GLES2DecoderTestBase::kInvalidSharedMemoryId;
1315 const uint32 GLES2DecoderTestBase::kInvalidSharedMemoryOffset; 1329 const uint32 GLES2DecoderTestBase::kInvalidSharedMemoryOffset;
1316 const uint32 GLES2DecoderTestBase::kInitialResult; 1330 const uint32 GLES2DecoderTestBase::kInitialResult;
1317 const uint8 GLES2DecoderTestBase::kInitialMemoryValue; 1331 const uint8 GLES2DecoderTestBase::kInitialMemoryValue;
1318 1332
1319 const uint32 GLES2DecoderTestBase::kNewClientId; 1333 const uint32 GLES2DecoderTestBase::kNewClientId;
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
1729 SetupDefaultProgram(); 1743 SetupDefaultProgram();
1730 } 1744 }
1731 1745
1732 // Include the auto-generated part of this file. We split this because it means 1746 // Include the auto-generated part of this file. We split this because it means
1733 // we can easily edit the non-auto generated parts right here in this file 1747 // we can easily edit the non-auto generated parts right here in this file
1734 // instead of having to edit some template or the code generator. 1748 // instead of having to edit some template or the code generator.
1735 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" 1749 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h"
1736 1750
1737 } // namespace gles2 1751 } // namespace gles2
1738 } // namespace gpu 1752 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698