| 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/gpu/gpu_child_thread.h" | 5 #include "content/gpu/gpu_child_thread.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
| 12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
| 13 #include "base/threading/worker_pool.h" | 13 #include "base/threading/worker_pool.h" |
| 14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 15 #include "content/child/child_process.h" | 15 #include "content/child/child_process.h" |
| 16 #include "content/child/thread_safe_sender.h" | 16 #include "content/child/thread_safe_sender.h" |
| 17 #include "content/common/gpu/establish_channel_params.h" | |
| 18 #include "content/common/gpu/gpu_memory_buffer_factory.h" | 17 #include "content/common/gpu/gpu_memory_buffer_factory.h" |
| 19 #include "content/common/gpu/media/gpu_jpeg_decode_accelerator.h" | 18 #include "content/common/gpu/media/gpu_jpeg_decode_accelerator.h" |
| 20 #include "content/common/gpu/media/gpu_video_decode_accelerator.h" | 19 #include "content/common/gpu/media/gpu_video_decode_accelerator.h" |
| 21 #include "content/common/gpu/media/gpu_video_encode_accelerator.h" | 20 #include "content/common/gpu/media/gpu_video_encode_accelerator.h" |
| 22 #include "content/common/gpu/media/media_service.h" | 21 #include "content/common/gpu/media/media_service.h" |
| 22 #include "content/gpu/establish_channel_params.h" |
| 23 #include "content/gpu/gpu_host_messages.h" | 23 #include "content/gpu/gpu_host_messages.h" |
| 24 #include "content/gpu/gpu_process_control_impl.h" | 24 #include "content/gpu/gpu_process_control_impl.h" |
| 25 #include "content/gpu/gpu_watchdog_thread.h" | 25 #include "content/gpu/gpu_watchdog_thread.h" |
| 26 #include "content/public/common/content_client.h" | 26 #include "content/public/common/content_client.h" |
| 27 #include "content/public/common/content_switches.h" | 27 #include "content/public/common/content_switches.h" |
| 28 #include "content/public/gpu/content_gpu_client.h" | 28 #include "content/public/gpu/content_gpu_client.h" |
| 29 #include "gpu/command_buffer/service/gpu_switches.h" | 29 #include "gpu/command_buffer/service/gpu_switches.h" |
| 30 #include "gpu/config/gpu_info_collector.h" | 30 #include "gpu/config/gpu_info_collector.h" |
| 31 #include "gpu/config/gpu_switches.h" | 31 #include "gpu/config/gpu_switches.h" |
| 32 #include "gpu/config/gpu_util.h" | 32 #include "gpu/config/gpu_util.h" |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 void GpuChildThread::OnBufferPresented(const BufferPresentedParams& params) { | 507 void GpuChildThread::OnBufferPresented(const BufferPresentedParams& params) { |
| 508 if (gpu_channel_manager_) | 508 if (gpu_channel_manager_) |
| 509 gpu_channel_manager_->BufferPresented(params); | 509 gpu_channel_manager_->BufferPresented(params); |
| 510 } | 510 } |
| 511 #endif | 511 #endif |
| 512 | 512 |
| 513 void GpuChildThread::OnEstablishChannel(const EstablishChannelParams& params) { | 513 void GpuChildThread::OnEstablishChannel(const EstablishChannelParams& params) { |
| 514 if (!gpu_channel_manager_) | 514 if (!gpu_channel_manager_) |
| 515 return; | 515 return; |
| 516 | 516 |
| 517 IPC::ChannelHandle channel_handle = | 517 IPC::ChannelHandle channel_handle = gpu_channel_manager_->EstablishChannel( |
| 518 gpu_channel_manager_->EstablishChannel(params); | 518 params.client_id, params.client_tracing_id, params.preempts, |
| 519 params.allow_view_command_buffers, params.allow_real_time_streams); |
| 519 media_service_->AddChannel(params.client_id); | 520 media_service_->AddChannel(params.client_id); |
| 520 Send(new GpuHostMsg_ChannelEstablished(channel_handle)); | 521 Send(new GpuHostMsg_ChannelEstablished(channel_handle)); |
| 521 } | 522 } |
| 522 | 523 |
| 523 void GpuChildThread::OnCloseChannel(int32_t client_id) { | 524 void GpuChildThread::OnCloseChannel(int32_t client_id) { |
| 524 if (gpu_channel_manager_) | 525 if (gpu_channel_manager_) |
| 525 gpu_channel_manager_->RemoveChannel(client_id); | 526 gpu_channel_manager_->RemoveChannel(client_id); |
| 526 } | 527 } |
| 527 | 528 |
| 528 void GpuChildThread::OnLoadedShader(const std::string& shader) { | 529 void GpuChildThread::OnLoadedShader(const std::string& shader) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 | 562 |
| 562 void GpuChildThread::BindProcessControlRequest( | 563 void GpuChildThread::BindProcessControlRequest( |
| 563 mojo::InterfaceRequest<ProcessControl> request) { | 564 mojo::InterfaceRequest<ProcessControl> request) { |
| 564 DVLOG(1) << "GPU: Binding ProcessControl request"; | 565 DVLOG(1) << "GPU: Binding ProcessControl request"; |
| 565 DCHECK(process_control_); | 566 DCHECK(process_control_); |
| 566 process_control_bindings_.AddBinding(process_control_.get(), | 567 process_control_bindings_.AddBinding(process_control_.get(), |
| 567 std::move(request)); | 568 std::move(request)); |
| 568 } | 569 } |
| 569 | 570 |
| 570 } // namespace content | 571 } // namespace content |
| OLD | NEW |