| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 // The GPU stats reported by the GPU process. | 94 // The GPU stats reported by the GPU process. |
| 95 const gpu::GPUInfo& gpu_info() const { return gpu_info_; } | 95 const gpu::GPUInfo& gpu_info() const { return gpu_info_; } |
| 96 | 96 |
| 97 // IPC::Sender implementation: | 97 // IPC::Sender implementation: |
| 98 bool Send(IPC::Message* msg) override; | 98 bool Send(IPC::Message* msg) override; |
| 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( |
| 105 int32_t stream_id, | 105 int32_t route_id, |
| 106 int32_t put_offset, | 106 int32_t stream_id, |
| 107 uint32_t flush_count, | 107 int32_t put_offset, |
| 108 const std::vector<ui::LatencyInfo>& latency_info, | 108 uint32_t flush_count, |
| 109 bool put_offset_changed, | 109 const std::vector<ui::LatencyInfo>& latency_info, |
| 110 bool do_flush, | 110 const std::vector<SyncToken>& sync_token_dependencies, |
| 111 uint32_t* highest_verified_flush_id); | 111 bool put_offset_changed, |
| 112 bool do_flush, |
| 113 uint32_t* highest_verified_flush_id); |
| 112 | 114 |
| 113 void FlushPendingStream(int32_t stream_id); | 115 void FlushPendingStream(int32_t stream_id); |
| 114 | 116 |
| 115 // Destroy this channel. Must be called on the main thread, before | 117 // Destroy this channel. Must be called on the main thread, before |
| 116 // destruction. | 118 // destruction. |
| 117 void DestroyChannel(); | 119 void DestroyChannel(); |
| 118 | 120 |
| 119 // Add a message route for the current message loop. | 121 // Add a message route for the current message loop. |
| 120 void AddRoute(int route_id, base::WeakPtr<IPC::Listener> listener); | 122 void AddRoute(int route_id, base::WeakPtr<IPC::Listener> listener); |
| 121 | 123 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 uint32_t flushed_stream_flush_id; | 227 uint32_t flushed_stream_flush_id; |
| 226 uint32_t verified_stream_flush_id; | 228 uint32_t verified_stream_flush_id; |
| 227 | 229 |
| 228 // These are local per context. | 230 // These are local per context. |
| 229 bool flush_pending; | 231 bool flush_pending; |
| 230 int32_t route_id; | 232 int32_t route_id; |
| 231 int32_t put_offset; | 233 int32_t put_offset; |
| 232 uint32_t flush_count; | 234 uint32_t flush_count; |
| 233 uint32_t flush_id; | 235 uint32_t flush_id; |
| 234 std::vector<ui::LatencyInfo> latency_info; | 236 std::vector<ui::LatencyInfo> latency_info; |
| 237 std::vector<SyncToken> sync_token_dependencies; |
| 235 }; | 238 }; |
| 236 | 239 |
| 237 GpuChannelHost(GpuChannelHostFactory* factory, | 240 GpuChannelHost(GpuChannelHostFactory* factory, |
| 238 int channel_id, | 241 int channel_id, |
| 239 const gpu::GPUInfo& gpu_info, | 242 const gpu::GPUInfo& gpu_info, |
| 240 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager); | 243 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager); |
| 241 ~GpuChannelHost() override; | 244 ~GpuChannelHost() override; |
| 242 void Connect(const IPC::ChannelHandle& channel_handle, | 245 void Connect(const IPC::ChannelHandle& channel_handle, |
| 243 base::WaitableEvent* shutdown_event); | 246 base::WaitableEvent* shutdown_event); |
| 244 bool InternalSend(IPC::Message* msg); | 247 bool InternalSend(IPC::Message* msg); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 275 mutable base::Lock context_lock_; | 278 mutable base::Lock context_lock_; |
| 276 std::unique_ptr<IPC::SyncChannel> channel_; | 279 std::unique_ptr<IPC::SyncChannel> channel_; |
| 277 base::hash_map<int32_t, StreamFlushInfo> stream_flush_info_; | 280 base::hash_map<int32_t, StreamFlushInfo> stream_flush_info_; |
| 278 | 281 |
| 279 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); | 282 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); |
| 280 }; | 283 }; |
| 281 | 284 |
| 282 } // namespace gpu | 285 } // namespace gpu |
| 283 | 286 |
| 284 #endif // GPU_IPC_CLIENT_GPU_CHANNEL_HOST_H_ | 287 #endif // GPU_IPC_CLIENT_GPU_CHANNEL_HOST_H_ |
| OLD | NEW |