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

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

Issue 1331843005: Implemented new fence syncs which replaces the old sync points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Some fixes Created 5 years, 3 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "gpu/command_buffer/service/fence_sync_manager.h"
6
7 #include <stdint.h>
8
9 #include "base/logging.h"
10
11 namespace gpu {
12
13 FenceSyncManager::FenceSyncManager() : fence_sync_release_(0) {}
14
15 FenceSyncManager::~FenceSyncManager() {
16 // Release all fences on destruction.
17 ReleaseFenceSync(UINT32_MAX);
18 }
19
20 void FenceSyncManager::AddFenceSyncCallback(uint32_t max_order_number,
21 uint32_t release,
22 const base::Closure& callback) {
23 fence_callback_queue_.push(FenceSyncCallback(release, callback));
24 }
25
26 void FenceSyncManager::ReleaseFenceSync(uint32_t release) {
27 DCHECK(release > fence_sync_release_);
28 fence_sync_release_ = release;
29
30 while (!fence_callback_queue_.empty() &&
31 fence_callback_queue_.top().release_count <= release) {
32 fence_callback_queue_.top().callback_closure.Run();
33 fence_callback_queue_.pop();
34 }
35 }
36
37 FenceSyncManager::FenceSyncCallback::FenceSyncCallback(
38 uint32_t release,
39 const base::Closure& callback)
40 : release_count(release), callback_closure(callback) {}
41
42 FenceSyncManager::FenceSyncCallback::~FenceSyncCallback() {}
43
44 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698