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

Unified Diff: gpu/command_buffer/service/query_manager.cc

Issue 2447533002: ui: Add ref-counting to GLFence class.
Patch Set: rebase Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/mailbox_manager_sync.cc ('k') | gpu/command_buffer/tests/gl_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/query_manager.cc
diff --git a/gpu/command_buffer/service/query_manager.cc b/gpu/command_buffer/service/query_manager.cc
index a5071e335d7ad1cb9088f785168894d98293e995..4c10f77b0c778426c73e579d0ac4fffaa06a4f2d 100644
--- a/gpu/command_buffer/service/query_manager.cc
+++ b/gpu/command_buffer/service/query_manager.cc
@@ -479,7 +479,7 @@ class CommandsCompletedQuery : public QueryManager::Query {
~CommandsCompletedQuery() override;
private:
- std::unique_ptr<gl::GLFence> fence_;
+ scoped_refptr<gl::GLFence> fence_;
base::TimeTicks begin_time_;
};
@@ -508,7 +508,7 @@ bool CommandsCompletedQuery::End(base::subtle::Atomic32 submit_count) {
fence_->ResetState();
}
else {
- fence_.reset(gl::GLFence::Create());
+ fence_ = gl::GLFence::Create();
}
DCHECK(fence_);
return AddToPendingQueue(submit_count);
@@ -532,7 +532,7 @@ bool CommandsCompletedQuery::Process(bool did_finish) {
void CommandsCompletedQuery::Destroy(bool have_context) {
if (have_context && !IsDeleted()) {
- fence_.reset();
+ fence_ = nullptr;
MarkAsDeleted();
}
}
« no previous file with comments | « gpu/command_buffer/service/mailbox_manager_sync.cc ('k') | gpu/command_buffer/tests/gl_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698