| 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 CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
| 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 public: | 81 public: |
| 82 // Must be called on the main thread (as defined by the factory). | 82 // Must be called on the main thread (as defined by the factory). |
| 83 static scoped_refptr<GpuChannelHost> Create( | 83 static scoped_refptr<GpuChannelHost> Create( |
| 84 GpuChannelHostFactory* factory, | 84 GpuChannelHostFactory* factory, |
| 85 int channel_id, | 85 int channel_id, |
| 86 const gpu::GPUInfo& gpu_info, | 86 const gpu::GPUInfo& gpu_info, |
| 87 const IPC::ChannelHandle& channel_handle, | 87 const IPC::ChannelHandle& channel_handle, |
| 88 base::WaitableEvent* shutdown_event, | 88 base::WaitableEvent* shutdown_event, |
| 89 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager); | 89 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager); |
| 90 | 90 |
| 91 static const int32 kDefaultStreamId = -1; | 91 static const int32 kDefaultStreamId = 0; |
| 92 static const GpuStreamPriority kDefaultStreamPriority = | 92 static const GpuStreamPriority kDefaultStreamPriority = |
| 93 GpuStreamPriority::NORMAL; | 93 GpuStreamPriority::NORMAL; |
| 94 | 94 |
| 95 bool IsLost() const { | 95 bool IsLost() const { |
| 96 DCHECK(channel_filter_.get()); | 96 DCHECK(channel_filter_.get()); |
| 97 return channel_filter_->IsLost(); | 97 return channel_filter_->IsLost(); |
| 98 } | 98 } |
| 99 | 99 |
| 100 int channel_id() const { return channel_id_; } | 100 int channel_id() const { return channel_id_; } |
| 101 | 101 |
| 102 // The GPU stats reported by the GPU process. | 102 // The GPU stats reported by the GPU process. |
| 103 const gpu::GPUInfo& gpu_info() const { return gpu_info_; } | 103 const gpu::GPUInfo& gpu_info() const { return gpu_info_; } |
| 104 | 104 |
| 105 // IPC::Sender implementation: | 105 // IPC::Sender implementation: |
| 106 bool Send(IPC::Message* msg) override; | 106 bool Send(IPC::Message* msg) override; |
| 107 | 107 |
| 108 // Set an ordering barrier. AsyncFlushes any pending barriers on other | 108 // Set an ordering barrier. AsyncFlushes any pending barriers on other |
| 109 // routes. Combines multiple OrderingBarriers into a single AsyncFlush. | 109 // routes. Combines multiple OrderingBarriers into a single AsyncFlush. |
| 110 // Returns the flush ID for the stream or 0 if put offset was not changed. | 110 // Returns the flush ID for the stream or 0 if put offset was not changed. |
| 111 uint32_t OrderingBarrier(int32 route_id, | 111 uint32_t OrderingBarrier(int32 route_id, |
| 112 int32 stream_id, | 112 int32 stream_id, |
| 113 int32 put_offset, | 113 int32 put_offset, |
| 114 uint32 flush_count, | 114 uint32 flush_count, |
| 115 const std::vector<ui::LatencyInfo>& latency_info, | 115 const std::vector<ui::LatencyInfo>& latency_info, |
| 116 bool put_offset_changed, | 116 bool put_offset_changed, |
| 117 bool do_flush); | 117 bool do_flush); |
| 118 | 118 |
| 119 void FlushPendingStream(int32 stream_id); | |
| 120 | |
| 121 // Create and connect to a command buffer in the GPU process. | 119 // Create and connect to a command buffer in the GPU process. |
| 122 scoped_ptr<CommandBufferProxyImpl> CreateViewCommandBuffer( | 120 scoped_ptr<CommandBufferProxyImpl> CreateViewCommandBuffer( |
| 123 int32 surface_id, | 121 int32 surface_id, |
| 124 CommandBufferProxyImpl* share_group, | 122 CommandBufferProxyImpl* share_group, |
| 125 int32 stream_id, | 123 int32 stream_id, |
| 126 GpuStreamPriority stream_priority, | 124 GpuStreamPriority stream_priority, |
| 127 const std::vector<int32>& attribs, | 125 const std::vector<int32>& attribs, |
| 128 const GURL& active_url, | 126 const GURL& active_url, |
| 129 gfx::GpuPreference gpu_preference); | 127 gfx::GpuPreference gpu_preference); |
| 130 | 128 |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 mutable base::Lock context_lock_; | 303 mutable base::Lock context_lock_; |
| 306 scoped_ptr<IPC::SyncChannel> channel_; | 304 scoped_ptr<IPC::SyncChannel> channel_; |
| 307 base::hash_map<int32, StreamFlushInfo> stream_flush_info_; | 305 base::hash_map<int32, StreamFlushInfo> stream_flush_info_; |
| 308 | 306 |
| 309 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); | 307 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); |
| 310 }; | 308 }; |
| 311 | 309 |
| 312 } // namespace content | 310 } // namespace content |
| 313 | 311 |
| 314 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ | 312 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
| OLD | NEW |