| 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 : sync_point_manager_(sync_point_manager), | 382 : sync_point_manager_(sync_point_manager), |
| 383 client_state_(new SyncPointClientState(order_data)), | 383 client_state_(new SyncPointClientState(order_data)), |
| 384 namespace_id_(namespace_id), | 384 namespace_id_(namespace_id), |
| 385 client_id_(client_id) {} | 385 client_id_(client_id) {} |
| 386 | 386 |
| 387 SyncPointManager::SyncPointManager(bool allow_threaded_wait) { | 387 SyncPointManager::SyncPointManager(bool allow_threaded_wait) { |
| 388 global_order_num_.GetNext(); | 388 global_order_num_.GetNext(); |
| 389 } | 389 } |
| 390 | 390 |
| 391 SyncPointManager::~SyncPointManager() { | 391 SyncPointManager::~SyncPointManager() { |
| 392 // TODO(reveman): Figure out why this flakes on CrOS: http://crbug.com/630625 |
| 393 #if !defined(OS_CHROMEOS) |
| 392 for (const ClientMap& client_map : client_maps_) { | 394 for (const ClientMap& client_map : client_maps_) { |
| 393 DCHECK(client_map.empty()); | 395 DCHECK(client_map.empty()); |
| 394 } | 396 } |
| 397 #endif |
| 395 } | 398 } |
| 396 | 399 |
| 397 std::unique_ptr<SyncPointClient> SyncPointManager::CreateSyncPointClient( | 400 std::unique_ptr<SyncPointClient> SyncPointManager::CreateSyncPointClient( |
| 398 scoped_refptr<SyncPointOrderData> order_data, | 401 scoped_refptr<SyncPointOrderData> order_data, |
| 399 CommandBufferNamespace namespace_id, | 402 CommandBufferNamespace namespace_id, |
| 400 CommandBufferId client_id) { | 403 CommandBufferId client_id) { |
| 401 DCHECK_GE(namespace_id, 0); | 404 DCHECK_GE(namespace_id, 0); |
| 402 DCHECK_LT(static_cast<size_t>(namespace_id), arraysize(client_maps_)); | 405 DCHECK_LT(static_cast<size_t>(namespace_id), arraysize(client_maps_)); |
| 403 base::AutoLock auto_lock(client_maps_lock_); | 406 base::AutoLock auto_lock(client_maps_lock_); |
| 404 | 407 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 DCHECK_LT(static_cast<size_t>(namespace_id), arraysize(client_maps_)); | 445 DCHECK_LT(static_cast<size_t>(namespace_id), arraysize(client_maps_)); |
| 443 | 446 |
| 444 base::AutoLock auto_lock(client_maps_lock_); | 447 base::AutoLock auto_lock(client_maps_lock_); |
| 445 ClientMap& client_map = client_maps_[namespace_id]; | 448 ClientMap& client_map = client_maps_[namespace_id]; |
| 446 ClientMap::iterator it = client_map.find(client_id); | 449 ClientMap::iterator it = client_map.find(client_id); |
| 447 DCHECK(it != client_map.end()); | 450 DCHECK(it != client_map.end()); |
| 448 client_map.erase(it); | 451 client_map.erase(it); |
| 449 } | 452 } |
| 450 | 453 |
| 451 } // namespace gpu | 454 } // namespace gpu |
| OLD | NEW |