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

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

Issue 1637293002: Reuse GLFenceNV when an existing CommandsCompletedQuery is reused (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved ResetSupported check into a separate function Created 4 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/gpu_scheduler.h ('k') | ui/gl/gl_fence.h » ('j') | 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/query_manager.h" 5 #include "gpu/command_buffer/service/query_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/atomicops.h" 10 #include "base/atomicops.h"
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 497
498 void CommandsCompletedQuery::Pause() { 498 void CommandsCompletedQuery::Pause() {
499 MarkAsPaused(); 499 MarkAsPaused();
500 } 500 }
501 501
502 void CommandsCompletedQuery::Resume() { 502 void CommandsCompletedQuery::Resume() {
503 MarkAsActive(); 503 MarkAsActive();
504 } 504 }
505 505
506 bool CommandsCompletedQuery::End(base::subtle::Atomic32 submit_count) { 506 bool CommandsCompletedQuery::End(base::subtle::Atomic32 submit_count) {
507 fence_.reset(gfx::GLFence::Create()); 507 if (fence_ && fence_->ResetSupported()) {
508 fence_->ResetState();
509 }
510 else {
511 fence_.reset(gfx::GLFence::Create());
512 }
508 DCHECK(fence_); 513 DCHECK(fence_);
509 return AddToPendingQueue(submit_count); 514 return AddToPendingQueue(submit_count);
510 } 515 }
511 516
512 bool CommandsCompletedQuery::QueryCounter(base::subtle::Atomic32 submit_count) { 517 bool CommandsCompletedQuery::QueryCounter(base::subtle::Atomic32 submit_count) {
513 NOTREACHED(); 518 NOTREACHED();
514 return false; 519 return false;
515 } 520 }
516 521
517 bool CommandsCompletedQuery::Process(bool did_finish) { 522 bool CommandsCompletedQuery::Process(bool did_finish) {
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 for (std::pair<const GLenum, scoped_refptr<Query> >& it : active_queries_) { 1128 for (std::pair<const GLenum, scoped_refptr<Query> >& it : active_queries_) {
1124 if (it.second->IsPaused()) { 1129 if (it.second->IsPaused()) {
1125 it.second->Resume(); 1130 it.second->Resume();
1126 DCHECK(it.second->IsActive()); 1131 DCHECK(it.second->IsActive());
1127 } 1132 }
1128 } 1133 }
1129 } 1134 }
1130 1135
1131 } // namespace gles2 1136 } // namespace gles2
1132 } // namespace gpu 1137 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gpu_scheduler.h ('k') | ui/gl/gl_fence.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698