| 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/sync_point_manager.h" | 5 #include "gpu/command_buffer/service/sync_point_manager.h" |
| 6 | 6 |
| 7 #include <limits.h> | 7 #include <limits.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 closure.Run(); | 248 closure.Run(); |
| 249 } | 249 } |
| 250 } | 250 } |
| 251 | 251 |
| 252 void SyncPointClientState::ReleaseFenceSyncLocked( | 252 void SyncPointClientState::ReleaseFenceSyncLocked( |
| 253 uint64_t release, | 253 uint64_t release, |
| 254 std::vector<base::Closure>* callback_list) { | 254 std::vector<base::Closure>* callback_list) { |
| 255 fence_sync_lock_.AssertAcquired(); | 255 fence_sync_lock_.AssertAcquired(); |
| 256 DCHECK_GT(release, fence_sync_release_); | 256 DCHECK_GT(release, fence_sync_release_); |
| 257 | 257 |
| 258 // TODO(dyen): https://www.crbug.com/606112 - Hack in a DCHECK which should be |
| 259 // fine under normal circumstances. Under normal usage, this would only |
| 260 // trigger if flushes are arriving out of order. |
| 261 CHECK(release == fence_sync_release_ + 1 || release == UINT64_MAX); |
| 258 fence_sync_release_ = release; | 262 fence_sync_release_ = release; |
| 259 while (!release_callback_queue_.empty() && | 263 while (!release_callback_queue_.empty() && |
| 260 release_callback_queue_.top().release_count <= release) { | 264 release_callback_queue_.top().release_count <= release) { |
| 261 callback_list->push_back(release_callback_queue_.top().callback_closure); | 265 callback_list->push_back(release_callback_queue_.top().callback_closure); |
| 262 release_callback_queue_.pop(); | 266 release_callback_queue_.pop(); |
| 263 } | 267 } |
| 264 } | 268 } |
| 265 | 269 |
| 266 void SyncPointClientState::SetOnWaitCallback(const OnWaitCallback& callback) { | 270 void SyncPointClientState::SetOnWaitCallback(const OnWaitCallback& callback) { |
| 267 on_wait_callback_ = callback; | 271 on_wait_callback_ = callback; |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 DCHECK_LT(static_cast<size_t>(namespace_id), arraysize(client_maps_)); | 423 DCHECK_LT(static_cast<size_t>(namespace_id), arraysize(client_maps_)); |
| 420 | 424 |
| 421 base::AutoLock auto_lock(client_maps_lock_); | 425 base::AutoLock auto_lock(client_maps_lock_); |
| 422 ClientMap& client_map = client_maps_[namespace_id]; | 426 ClientMap& client_map = client_maps_[namespace_id]; |
| 423 ClientMap::iterator it = client_map.find(client_id); | 427 ClientMap::iterator it = client_map.find(client_id); |
| 424 DCHECK(it != client_map.end()); | 428 DCHECK(it != client_map.end()); |
| 425 client_map.erase(it); | 429 client_map.erase(it); |
| 426 } | 430 } |
| 427 | 431 |
| 428 } // namespace gpu | 432 } // namespace gpu |
| OLD | NEW |