| 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 "content/common/gpu/client/gpu_channel_host.h" | 5 #include "content/common/gpu/client/gpu_channel_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/atomic_sequence_num.h" | 10 #include "base/atomic_sequence_num.h" |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/location.h" | 12 #include "base/location.h" |
| 13 #include "base/posix/eintr_wrapper.h" | 13 #include "base/posix/eintr_wrapper.h" |
| 14 #include "base/profiler/scoped_tracker.h" | 14 #include "base/profiler/scoped_tracker.h" |
| 15 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
| 16 #include "base/thread_task_runner_handle.h" | 16 #include "base/thread_task_runner_handle.h" |
| 17 #include "base/threading/thread_restrictions.h" | 17 #include "base/threading/thread_restrictions.h" |
| 18 #include "base/trace_event/trace_event.h" | 18 #include "base/trace_event/trace_event.h" |
| 19 #include "build/build_config.h" | 19 #include "build/build_config.h" |
| 20 #include "content/common/gpu/client/command_buffer_proxy_impl.h" | 20 #include "content/common/gpu/client/command_buffer_proxy_impl.h" |
| 21 #include "content/common/gpu/client/gpu_jpeg_decode_accelerator_host.h" | 21 #include "content/common/gpu/client/gpu_jpeg_decode_accelerator_host.h" |
| 22 #include "content/common/gpu/gpu_messages.h" | 22 #include "content/common/gpu/gpu_messages.h" |
| 23 #include "ipc/ipc_sync_message_filter.h" | 23 #include "ipc/ipc_sync_message_filter.h" |
| 24 #include "url/gurl.h" | |
| 25 | 24 |
| 26 #if defined(OS_WIN) || defined(OS_MACOSX) | 25 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 27 #include "content/public/common/sandbox_init.h" | 26 #include "content/public/common/sandbox_init.h" |
| 28 #endif | 27 #endif |
| 29 | 28 |
| 30 using base::AutoLock; | 29 using base::AutoLock; |
| 31 | 30 |
| 32 namespace content { | 31 namespace content { |
| 33 namespace { | 32 namespace { |
| 34 | 33 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 188 |
| 190 flush_info->flushed_stream_flush_id = flush_info->flush_id; | 189 flush_info->flushed_stream_flush_id = flush_info->flush_id; |
| 191 } | 190 } |
| 192 | 191 |
| 193 scoped_ptr<CommandBufferProxyImpl> GpuChannelHost::CreateViewCommandBuffer( | 192 scoped_ptr<CommandBufferProxyImpl> GpuChannelHost::CreateViewCommandBuffer( |
| 194 int32_t surface_id, | 193 int32_t surface_id, |
| 195 CommandBufferProxyImpl* share_group, | 194 CommandBufferProxyImpl* share_group, |
| 196 int32_t stream_id, | 195 int32_t stream_id, |
| 197 GpuStreamPriority stream_priority, | 196 GpuStreamPriority stream_priority, |
| 198 const std::vector<int32_t>& attribs, | 197 const std::vector<int32_t>& attribs, |
| 199 const GURL& active_url, | 198 const std::string& active_url, |
| 200 gfx::GpuPreference gpu_preference) { | 199 gfx::GpuPreference gpu_preference) { |
| 201 DCHECK(!share_group || (stream_id == share_group->stream_id())); | 200 DCHECK(!share_group || (stream_id == share_group->stream_id())); |
| 202 TRACE_EVENT1("gpu", "GpuChannelHost::CreateViewCommandBuffer", "surface_id", | 201 TRACE_EVENT1("gpu", "GpuChannelHost::CreateViewCommandBuffer", "surface_id", |
| 203 surface_id); | 202 surface_id); |
| 204 | 203 |
| 205 GPUCreateCommandBufferConfig init_params; | 204 GPUCreateCommandBufferConfig init_params; |
| 206 init_params.share_group_id = | 205 init_params.share_group_id = |
| 207 share_group ? share_group->route_id() : MSG_ROUTING_NONE; | 206 share_group ? share_group->route_id() : MSG_ROUTING_NONE; |
| 208 init_params.stream_id = stream_id; | 207 init_params.stream_id = stream_id; |
| 209 init_params.stream_priority = stream_priority; | 208 init_params.stream_priority = stream_priority; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 | 244 |
| 246 return command_buffer; | 245 return command_buffer; |
| 247 } | 246 } |
| 248 | 247 |
| 249 scoped_ptr<CommandBufferProxyImpl> GpuChannelHost::CreateOffscreenCommandBuffer( | 248 scoped_ptr<CommandBufferProxyImpl> GpuChannelHost::CreateOffscreenCommandBuffer( |
| 250 const gfx::Size& size, | 249 const gfx::Size& size, |
| 251 CommandBufferProxyImpl* share_group, | 250 CommandBufferProxyImpl* share_group, |
| 252 int32_t stream_id, | 251 int32_t stream_id, |
| 253 GpuStreamPriority stream_priority, | 252 GpuStreamPriority stream_priority, |
| 254 const std::vector<int32_t>& attribs, | 253 const std::vector<int32_t>& attribs, |
| 255 const GURL& active_url, | 254 const std::string& active_url, |
| 256 gfx::GpuPreference gpu_preference) { | 255 gfx::GpuPreference gpu_preference) { |
| 257 DCHECK(!share_group || (stream_id == share_group->stream_id())); | 256 DCHECK(!share_group || (stream_id == share_group->stream_id())); |
| 258 TRACE_EVENT0("gpu", "GpuChannelHost::CreateOffscreenCommandBuffer"); | 257 TRACE_EVENT0("gpu", "GpuChannelHost::CreateOffscreenCommandBuffer"); |
| 259 | 258 |
| 260 GPUCreateCommandBufferConfig init_params; | 259 GPUCreateCommandBufferConfig init_params; |
| 261 init_params.share_group_id = | 260 init_params.share_group_id = |
| 262 share_group ? share_group->route_id() : MSG_ROUTING_NONE; | 261 share_group ? share_group->route_id() : MSG_ROUTING_NONE; |
| 263 init_params.stream_id = stream_id; | 262 init_params.stream_id = stream_id; |
| 264 init_params.stream_priority = stream_priority; | 263 init_params.stream_priority = stream_priority; |
| 265 init_params.attribs = attribs; | 264 init_params.attribs = attribs; |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 | 547 |
| 549 listeners_.clear(); | 548 listeners_.clear(); |
| 550 } | 549 } |
| 551 | 550 |
| 552 bool GpuChannelHost::MessageFilter::IsLost() const { | 551 bool GpuChannelHost::MessageFilter::IsLost() const { |
| 553 AutoLock lock(lock_); | 552 AutoLock lock(lock_); |
| 554 return lost_; | 553 return lost_; |
| 555 } | 554 } |
| 556 | 555 |
| 557 } // namespace content | 556 } // namespace content |
| OLD | NEW |