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_IPC_CLIENT_GPU_CHANNEL_HOST_H_ | 5 #ifndef GPU_IPC_CLIENT_GPU_CHANNEL_HOST_H_ |
6 #define GPU_IPC_CLIENT_GPU_CHANNEL_HOST_H_ | 6 #define GPU_IPC_CLIENT_GPU_CHANNEL_HOST_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 namespace IPC { | 35 namespace IPC { |
36 class SyncMessageFilter; | 36 class SyncMessageFilter; |
37 } | 37 } |
38 | 38 |
39 namespace gpu { | 39 namespace gpu { |
40 class GpuMemoryBufferManager; | 40 class GpuMemoryBufferManager; |
41 } | 41 } |
42 | 42 |
43 namespace gpu { | 43 namespace gpu { |
44 | 44 struct SyncToken; |
45 class GpuChannelHost; | 45 class GpuChannelHost; |
46 using GpuChannelEstablishedCallback = | 46 using GpuChannelEstablishedCallback = |
47 base::Callback<void(scoped_refptr<GpuChannelHost>)>; | 47 base::Callback<void(scoped_refptr<GpuChannelHost>)>; |
48 | 48 |
49 class GPU_EXPORT GpuChannelEstablishFactory { | 49 class GPU_EXPORT GpuChannelEstablishFactory { |
50 public: | 50 public: |
51 virtual ~GpuChannelEstablishFactory() {} | 51 virtual ~GpuChannelEstablishFactory() {} |
52 | 52 |
53 virtual void EstablishGpuChannel( | 53 virtual void EstablishGpuChannel( |
54 const GpuChannelEstablishedCallback& callback) = 0; | 54 const GpuChannelEstablishedCallback& callback) = 0; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 99 |
100 // Set an ordering barrier. AsyncFlushes any pending barriers on other | 100 // Set an ordering barrier. AsyncFlushes any pending barriers on other |
101 // routes. Combines multiple OrderingBarriers into a single AsyncFlush. | 101 // routes. Combines multiple OrderingBarriers into a single AsyncFlush. |
102 // Returns the flush ID for the stream or 0 if put offset was not changed. | 102 // Returns the flush ID for the stream or 0 if put offset was not changed. |
103 // Outputs *highest_verified_flush_id. | 103 // Outputs *highest_verified_flush_id. |
104 uint32_t OrderingBarrier(int32_t route_id, | 104 uint32_t OrderingBarrier(int32_t route_id, |
105 int32_t stream_id, | 105 int32_t stream_id, |
106 int32_t put_offset, | 106 int32_t put_offset, |
107 uint32_t flush_count, | 107 uint32_t flush_count, |
108 const std::vector<ui::LatencyInfo>& latency_info, | 108 const std::vector<ui::LatencyInfo>& latency_info, |
| 109 const std::vector<SyncToken>& sync_token_fences, |
109 bool put_offset_changed, | 110 bool put_offset_changed, |
110 bool do_flush, | 111 bool do_flush, |
111 uint32_t* highest_verified_flush_id); | 112 uint32_t* highest_verified_flush_id); |
112 | 113 |
113 void FlushPendingStream(int32_t stream_id); | 114 void FlushPendingStream(int32_t stream_id); |
114 | 115 |
115 // Destroy this channel. Must be called on the main thread, before | 116 // Destroy this channel. Must be called on the main thread, before |
116 // destruction. | 117 // destruction. |
117 void DestroyChannel(); | 118 void DestroyChannel(); |
118 | 119 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 uint32_t flushed_stream_flush_id; | 226 uint32_t flushed_stream_flush_id; |
226 uint32_t verified_stream_flush_id; | 227 uint32_t verified_stream_flush_id; |
227 | 228 |
228 // These are local per context. | 229 // These are local per context. |
229 bool flush_pending; | 230 bool flush_pending; |
230 int32_t route_id; | 231 int32_t route_id; |
231 int32_t put_offset; | 232 int32_t put_offset; |
232 uint32_t flush_count; | 233 uint32_t flush_count; |
233 uint32_t flush_id; | 234 uint32_t flush_id; |
234 std::vector<ui::LatencyInfo> latency_info; | 235 std::vector<ui::LatencyInfo> latency_info; |
| 236 std::vector<SyncToken> sync_token_fences; |
235 }; | 237 }; |
236 | 238 |
237 GpuChannelHost(GpuChannelHostFactory* factory, | 239 GpuChannelHost(GpuChannelHostFactory* factory, |
238 int channel_id, | 240 int channel_id, |
239 const gpu::GPUInfo& gpu_info, | 241 const gpu::GPUInfo& gpu_info, |
240 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager); | 242 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager); |
241 ~GpuChannelHost() override; | 243 ~GpuChannelHost() override; |
242 void Connect(const IPC::ChannelHandle& channel_handle, | 244 void Connect(const IPC::ChannelHandle& channel_handle, |
243 base::WaitableEvent* shutdown_event); | 245 base::WaitableEvent* shutdown_event); |
244 bool InternalSend(IPC::Message* msg); | 246 bool InternalSend(IPC::Message* msg); |
(...skipping 30 matching lines...) Expand all Loading... |
275 mutable base::Lock context_lock_; | 277 mutable base::Lock context_lock_; |
276 std::unique_ptr<IPC::SyncChannel> channel_; | 278 std::unique_ptr<IPC::SyncChannel> channel_; |
277 base::hash_map<int32_t, StreamFlushInfo> stream_flush_info_; | 279 base::hash_map<int32_t, StreamFlushInfo> stream_flush_info_; |
278 | 280 |
279 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); | 281 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); |
280 }; | 282 }; |
281 | 283 |
282 } // namespace gpu | 284 } // namespace gpu |
283 | 285 |
284 #endif // GPU_IPC_CLIENT_GPU_CHANNEL_HOST_H_ | 286 #endif // GPU_IPC_CLIENT_GPU_CHANNEL_HOST_H_ |
OLD | NEW |