| 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 "content/common/gpu/sync_point_manager.h" | 5 #include "content/common/gpu/sync_point_manager.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace content { |
| 10 |
| 9 SyncPointManager::SyncPointManager() | 11 SyncPointManager::SyncPointManager() |
| 10 : next_sync_point_(1) { | 12 : next_sync_point_(1) { |
| 11 } | 13 } |
| 12 | 14 |
| 13 SyncPointManager::~SyncPointManager() { | 15 SyncPointManager::~SyncPointManager() { |
| 14 } | 16 } |
| 15 | 17 |
| 16 uint32 SyncPointManager::GenerateSyncPoint() { | 18 uint32 SyncPointManager::GenerateSyncPoint() { |
| 17 base::AutoLock lock(lock_); | 19 base::AutoLock lock(lock_); |
| 18 uint32 sync_point = next_sync_point_++; | 20 uint32 sync_point = next_sync_point_++; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 47 { | 49 { |
| 48 base::AutoLock lock(lock_); | 50 base::AutoLock lock(lock_); |
| 49 SyncPointMap::iterator it = sync_point_map_.find(sync_point); | 51 SyncPointMap::iterator it = sync_point_map_.find(sync_point); |
| 50 if (it != sync_point_map_.end()) { | 52 if (it != sync_point_map_.end()) { |
| 51 it->second.push_back(callback); | 53 it->second.push_back(callback); |
| 52 return; | 54 return; |
| 53 } | 55 } |
| 54 } | 56 } |
| 55 callback.Run(); | 57 callback.Run(); |
| 56 } | 58 } |
| 59 |
| 60 } // namespace content |
| OLD | NEW |