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

Unified Diff: gpu/command_buffer/service/mailbox_manager_sync.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/gles2_cmd_decoder.cc ('k') | gpu/command_buffer/service/query_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/mailbox_manager_sync.cc
diff --git a/gpu/command_buffer/service/mailbox_manager_sync.cc b/gpu/command_buffer/service/mailbox_manager_sync.cc
index 979700a19e38a321f608787bd54735a72b621501..6e860d4eff2cf4da30968f6484e79d5b24b2ad84 100644
--- a/gpu/command_buffer/service/mailbox_manager_sync.cc
+++ b/gpu/command_buffer/service/mailbox_manager_sync.cc
@@ -28,7 +28,7 @@ namespace {
base::LazyInstance<base::Lock> g_lock = LAZY_INSTANCE_INITIALIZER;
#if !defined(OS_MACOSX)
-typedef std::map<SyncToken, std::unique_ptr<gl::GLFence>> SyncTokenToFenceMap;
+typedef std::map<SyncToken, scoped_refptr<gl::GLFence>> SyncTokenToFenceMap;
base::LazyInstance<SyncTokenToFenceMap> g_sync_point_to_fence =
LAZY_INSTANCE_INITIALIZER;
base::LazyInstance<std::queue<SyncTokenToFenceMap::iterator>> g_sync_points =
@@ -50,10 +50,9 @@ void CreateFenceLocked(const SyncToken& sync_token) {
sync_points.pop();
}
// Need to use EGL fences since we are likely not in a single share group.
- auto fence = base::MakeUnique<gl::GLFenceEGL>();
+ auto fence = make_scoped_refptr(new gl::GLFenceEGL);
std::pair<SyncTokenToFenceMap::iterator, bool> result =
- sync_point_to_fence.insert(
- std::make_pair(sync_token, std::move(fence)));
+ sync_point_to_fence.insert(std::make_pair(sync_token, fence.get()));
DCHECK(result.second);
sync_points.push(result.first);
DCHECK(sync_points.size() == sync_point_to_fence.size());
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | gpu/command_buffer/service/query_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698