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

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

Issue 707833003: gpu: Make sure sync queries complete on service side when calling glFinish. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update TODO and add bug number Created 6 years, 1 month 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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "gpu/command_buffer/common/gles2_cmd_format.h" 9 #include "gpu/command_buffer/common/gles2_cmd_format.h"
10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 10 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 .WillOnce(Return(GL_TRUE)) 629 .WillOnce(Return(GL_TRUE))
630 .RetiresOnSaturation(); 630 .RetiresOnSaturation();
631 #endif 631 #endif
632 EXPECT_CALL(*gl, ClientWaitSync(kGlSync, _, _)) 632 EXPECT_CALL(*gl, ClientWaitSync(kGlSync, _, _))
633 .WillOnce(Return(GL_ALREADY_SIGNALED)) 633 .WillOnce(Return(GL_ALREADY_SIGNALED))
634 .RetiresOnSaturation(); 634 .RetiresOnSaturation();
635 } 635 }
636 636
637 QueryManager* query_manager = test->GetDecoder()->GetQueryManager(); 637 QueryManager* query_manager = test->GetDecoder()->GetQueryManager();
638 ASSERT_TRUE(query_manager != NULL); 638 ASSERT_TRUE(query_manager != NULL);
639 bool process_success = query_manager->ProcessPendingQueries(); 639 bool process_success = query_manager->ProcessPendingQueries(false);
640 640
641 EXPECT_TRUE(error1 != error::kNoError || error2 != error::kNoError || 641 EXPECT_TRUE(error1 != error::kNoError || error2 != error::kNoError ||
642 !process_success); 642 !process_success);
643 643
644 if (query_type.is_gl) { 644 if (query_type.is_gl) {
645 EXPECT_CALL(*gl, DeleteQueriesARB(1, _)).Times(1).RetiresOnSaturation(); 645 EXPECT_CALL(*gl, DeleteQueriesARB(1, _)).Times(1).RetiresOnSaturation();
646 } 646 }
647 if (query_type.type == GL_COMMANDS_COMPLETED_CHROMIUM) { 647 if (query_type.type == GL_COMMANDS_COMPLETED_CHROMIUM) {
648 #if DCHECK_IS_ON 648 #if DCHECK_IS_ON
649 EXPECT_CALL(*gl, IsSync(kGlSync)) 649 EXPECT_CALL(*gl, IsSync(kGlSync))
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 EXPECT_TRUE(query->pending()); 790 EXPECT_TRUE(query->pending());
791 791
792 #if DCHECK_IS_ON 792 #if DCHECK_IS_ON
793 EXPECT_CALL(*gl_, IsSync(kGlSync)) 793 EXPECT_CALL(*gl_, IsSync(kGlSync))
794 .WillOnce(Return(GL_TRUE)) 794 .WillOnce(Return(GL_TRUE))
795 .RetiresOnSaturation(); 795 .RetiresOnSaturation();
796 #endif 796 #endif
797 EXPECT_CALL(*gl_, ClientWaitSync(kGlSync, _, _)) 797 EXPECT_CALL(*gl_, ClientWaitSync(kGlSync, _, _))
798 .WillOnce(Return(GL_TIMEOUT_EXPIRED)) 798 .WillOnce(Return(GL_TIMEOUT_EXPIRED))
799 .RetiresOnSaturation(); 799 .RetiresOnSaturation();
800 bool process_success = query_manager->ProcessPendingQueries(); 800 bool process_success = query_manager->ProcessPendingQueries(false);
801 801
802 EXPECT_TRUE(process_success); 802 EXPECT_TRUE(process_success);
803 EXPECT_TRUE(query->pending()); 803 EXPECT_TRUE(query->pending());
804 804
805 #if DCHECK_IS_ON 805 #if DCHECK_IS_ON
806 EXPECT_CALL(*gl_, IsSync(kGlSync)) 806 EXPECT_CALL(*gl_, IsSync(kGlSync))
807 .WillOnce(Return(GL_TRUE)) 807 .WillOnce(Return(GL_TRUE))
808 .RetiresOnSaturation(); 808 .RetiresOnSaturation();
809 #endif 809 #endif
810 EXPECT_CALL(*gl_, ClientWaitSync(kGlSync, _, _)) 810 EXPECT_CALL(*gl_, ClientWaitSync(kGlSync, _, _))
811 .WillOnce(Return(GL_ALREADY_SIGNALED)) 811 .WillOnce(Return(GL_ALREADY_SIGNALED))
812 .RetiresOnSaturation(); 812 .RetiresOnSaturation();
813 process_success = query_manager->ProcessPendingQueries(); 813 process_success = query_manager->ProcessPendingQueries(false);
814 814
815 EXPECT_TRUE(process_success); 815 EXPECT_TRUE(process_success);
816 EXPECT_FALSE(query->pending()); 816 EXPECT_FALSE(query->pending());
817 QuerySync* sync = static_cast<QuerySync*>(shared_memory_address_); 817 QuerySync* sync = static_cast<QuerySync*>(shared_memory_address_);
818 EXPECT_EQ(static_cast<GLenum>(0), static_cast<GLenum>(sync->result)); 818 EXPECT_EQ(static_cast<GLenum>(0), static_cast<GLenum>(sync->result));
819 819
820 #if DCHECK_IS_ON 820 #if DCHECK_IS_ON
821 EXPECT_CALL(*gl_, IsSync(kGlSync)) 821 EXPECT_CALL(*gl_, IsSync(kGlSync))
822 .WillOnce(Return(GL_TRUE)) 822 .WillOnce(Return(GL_TRUE))
823 .RetiresOnSaturation(); 823 .RetiresOnSaturation();
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
1308 INSTANTIATE_TEST_CASE_P(Service, GLES2DecoderManualInitTest, ::testing::Bool()); 1308 INSTANTIATE_TEST_CASE_P(Service, GLES2DecoderManualInitTest, ::testing::Bool());
1309 1309
1310 INSTANTIATE_TEST_CASE_P(Service, 1310 INSTANTIATE_TEST_CASE_P(Service,
1311 GLES2DecoderRGBBackbufferTest, 1311 GLES2DecoderRGBBackbufferTest,
1312 ::testing::Bool()); 1312 ::testing::Bool());
1313 1313
1314 INSTANTIATE_TEST_CASE_P(Service, GLES2DecoderDoCommandsTest, ::testing::Bool()); 1314 INSTANTIATE_TEST_CASE_P(Service, GLES2DecoderDoCommandsTest, ::testing::Bool());
1315 1315
1316 } // namespace gles2 1316 } // namespace gles2
1317 } // namespace gpu 1317 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_mock.h ('k') | gpu/command_buffer/service/gpu_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698