| 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/gpu_messages.h" | 21 #include "gpu/ipc/common/gpu_messages.h" |
| 22 #include "content/common/gpu/gpu_param_traits_macros.h" | 22 #include "gpu/ipc/common/gpu_param_traits_macros.h" |
| 23 #include "ipc/ipc_sync_message_filter.h" | 23 #include "ipc/ipc_sync_message_filter.h" |
| 24 #include "url/gurl.h" | 24 #include "url/gurl.h" |
| 25 | 25 |
| 26 using base::AutoLock; | 26 using base::AutoLock; |
| 27 | 27 |
| 28 namespace content { | 28 namespace content { |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| 31 // Global atomic to generate unique transfer buffer IDs. | 31 // Global atomic to generate unique transfer buffer IDs. |
| 32 base::StaticAtomicSequenceNumber g_next_transfer_buffer_id; | 32 base::StaticAtomicSequenceNumber g_next_transfer_buffer_id; |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 flush_info->flush_pending = false; | 187 flush_info->flush_pending = false; |
| 188 | 188 |
| 189 flush_info->flushed_stream_flush_id = flush_info->flush_id; | 189 flush_info->flushed_stream_flush_id = flush_info->flush_id; |
| 190 } | 190 } |
| 191 | 191 |
| 192 scoped_ptr<CommandBufferProxyImpl> GpuChannelHost::CreateCommandBuffer( | 192 scoped_ptr<CommandBufferProxyImpl> GpuChannelHost::CreateCommandBuffer( |
| 193 gpu::SurfaceHandle surface_handle, | 193 gpu::SurfaceHandle surface_handle, |
| 194 const gfx::Size& size, | 194 const gfx::Size& size, |
| 195 CommandBufferProxyImpl* share_group, | 195 CommandBufferProxyImpl* share_group, |
| 196 int32_t stream_id, | 196 int32_t stream_id, |
| 197 GpuStreamPriority stream_priority, | 197 gpu::GpuStreamPriority stream_priority, |
| 198 const std::vector<int32_t>& attribs, | 198 const std::vector<int32_t>& attribs, |
| 199 const GURL& active_url, | 199 const GURL& active_url, |
| 200 gfx::GpuPreference gpu_preference) { | 200 gfx::GpuPreference gpu_preference) { |
| 201 DCHECK(!share_group || (stream_id == share_group->stream_id())); | 201 DCHECK(!share_group || (stream_id == share_group->stream_id())); |
| 202 TRACE_EVENT1("gpu", "GpuChannelHost::CreateViewCommandBuffer", | 202 TRACE_EVENT1("gpu", "GpuChannelHost::CreateViewCommandBuffer", |
| 203 "surface_handle", surface_handle); | 203 "surface_handle", surface_handle); |
| 204 | 204 |
| 205 GPUCreateCommandBufferConfig init_params; | 205 GPUCreateCommandBufferConfig init_params; |
| 206 init_params.share_group_id = | 206 init_params.share_group_id = |
| 207 share_group ? share_group->route_id() : MSG_ROUTING_NONE; | 207 share_group ? share_group->route_id() : MSG_ROUTING_NONE; |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 | 472 |
| 473 listeners_.clear(); | 473 listeners_.clear(); |
| 474 } | 474 } |
| 475 | 475 |
| 476 bool GpuChannelHost::MessageFilter::IsLost() const { | 476 bool GpuChannelHost::MessageFilter::IsLost() const { |
| 477 AutoLock lock(lock_); | 477 AutoLock lock(lock_); |
| 478 return lost_; | 478 return lost_; |
| 479 } | 479 } |
| 480 | 480 |
| 481 } // namespace content | 481 } // namespace content |
| OLD | NEW |