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 #ifndef GPU_COMMAND_BUFFER_SERVICE_SYNC_POINT_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_SYNC_POINT_MANAGER_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_SYNC_POINT_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_SYNC_POINT_MANAGER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <functional> | 10 #include <functional> |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 friend class SyncPointClientState; | 71 friend class SyncPointClientState; |
72 | 72 |
73 struct OrderFence { | 73 struct OrderFence { |
74 uint32_t order_num; | 74 uint32_t order_num; |
75 uint64_t fence_release; | 75 uint64_t fence_release; |
76 scoped_refptr<SyncPointClientState> client_state; | 76 scoped_refptr<SyncPointClientState> client_state; |
77 | 77 |
78 OrderFence(uint32_t order, | 78 OrderFence(uint32_t order, |
79 uint64_t release, | 79 uint64_t release, |
80 scoped_refptr<SyncPointClientState> state); | 80 scoped_refptr<SyncPointClientState> state); |
| 81 OrderFence(const OrderFence& other); |
81 ~OrderFence(); | 82 ~OrderFence(); |
82 | 83 |
83 bool operator>(const OrderFence& rhs) const { | 84 bool operator>(const OrderFence& rhs) const { |
84 return (order_num > rhs.order_num) || | 85 return (order_num > rhs.order_num) || |
85 ((order_num == rhs.order_num) && | 86 ((order_num == rhs.order_num) && |
86 (fence_release > rhs.fence_release)); | 87 (fence_release > rhs.fence_release)); |
87 } | 88 } |
88 }; | 89 }; |
89 typedef std::priority_queue<OrderFence, | 90 typedef std::priority_queue<OrderFence, |
90 std::vector<OrderFence>, | 91 std::vector<OrderFence>, |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 private: | 151 private: |
151 friend class base::RefCountedThreadSafe<SyncPointClientState>; | 152 friend class base::RefCountedThreadSafe<SyncPointClientState>; |
152 friend class SyncPointClient; | 153 friend class SyncPointClient; |
153 friend class SyncPointOrderData; | 154 friend class SyncPointOrderData; |
154 | 155 |
155 struct ReleaseCallback { | 156 struct ReleaseCallback { |
156 uint64_t release_count; | 157 uint64_t release_count; |
157 base::Closure callback_closure; | 158 base::Closure callback_closure; |
158 | 159 |
159 ReleaseCallback(uint64_t release, const base::Closure& callback); | 160 ReleaseCallback(uint64_t release, const base::Closure& callback); |
| 161 ReleaseCallback(const ReleaseCallback& other); |
160 ~ReleaseCallback(); | 162 ~ReleaseCallback(); |
161 | 163 |
162 bool operator>(const ReleaseCallback& rhs) const { | 164 bool operator>(const ReleaseCallback& rhs) const { |
163 return release_count > rhs.release_count; | 165 return release_count > rhs.release_count; |
164 } | 166 } |
165 }; | 167 }; |
166 typedef std::priority_queue<ReleaseCallback, | 168 typedef std::priority_queue<ReleaseCallback, |
167 std::vector<ReleaseCallback>, | 169 std::vector<ReleaseCallback>, |
168 std::greater<ReleaseCallback>> | 170 std::greater<ReleaseCallback>> |
169 ReleaseCallbackQueue; | 171 ReleaseCallbackQueue; |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 // Client map holds a map of clients id to client for each namespace. | 306 // Client map holds a map of clients id to client for each namespace. |
305 base::Lock client_maps_lock_; | 307 base::Lock client_maps_lock_; |
306 ClientMap client_maps_[NUM_COMMAND_BUFFER_NAMESPACES]; | 308 ClientMap client_maps_[NUM_COMMAND_BUFFER_NAMESPACES]; |
307 | 309 |
308 DISALLOW_COPY_AND_ASSIGN(SyncPointManager); | 310 DISALLOW_COPY_AND_ASSIGN(SyncPointManager); |
309 }; | 311 }; |
310 | 312 |
311 } // namespace gpu | 313 } // namespace gpu |
312 | 314 |
313 #endif // GPU_COMMAND_BUFFER_SERVICE_SYNC_POINT_MANAGER_H_ | 315 #endif // GPU_COMMAND_BUFFER_SERVICE_SYNC_POINT_MANAGER_H_ |
OLD | NEW |