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/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 Loading... |
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 Loading... |
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 |
OLD | NEW |