Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Side by Side Diff: content/gpu/gpu_child_thread.cc

Issue 1882373004: Migrate content/common/gpu/media code to media/gpu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Squash and rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/thread_local.h" 13 #include "base/threading/thread_local.h"
14 #include "base/threading/worker_pool.h" 14 #include "base/threading/worker_pool.h"
15 #include "build/build_config.h" 15 #include "build/build_config.h"
16 #include "content/child/child_process.h" 16 #include "content/child/child_process.h"
17 #include "content/child/thread_safe_sender.h" 17 #include "content/child/thread_safe_sender.h"
18 #include "content/common/establish_channel_params.h" 18 #include "content/common/establish_channel_params.h"
19 #include "content/common/gpu/media/gpu_jpeg_decode_accelerator.h"
20 #include "content/common/gpu/media/gpu_video_decode_accelerator.h"
21 #include "content/common/gpu/media/gpu_video_encode_accelerator.h"
22 #include "content/common/gpu/media/media_service.h"
23 #include "content/common/gpu_host_messages.h" 19 #include "content/common/gpu_host_messages.h"
24 #include "content/gpu/gpu_process_control_impl.h" 20 #include "content/gpu/gpu_process_control_impl.h"
25 #include "content/gpu/gpu_watchdog_thread.h" 21 #include "content/gpu/gpu_watchdog_thread.h"
26 #include "content/public/common/content_client.h" 22 #include "content/public/common/content_client.h"
27 #include "content/public/common/content_switches.h" 23 #include "content/public/common/content_switches.h"
28 #include "content/public/gpu/content_gpu_client.h" 24 #include "content/public/gpu/content_gpu_client.h"
29 #include "gpu/command_buffer/service/gpu_switches.h" 25 #include "gpu/command_buffer/service/gpu_switches.h"
30 #include "gpu/command_buffer/service/sync_point_manager.h" 26 #include "gpu/command_buffer/service/sync_point_manager.h"
31 #include "gpu/config/gpu_info_collector.h" 27 #include "gpu/config/gpu_info_collector.h"
32 #include "gpu/config/gpu_switches.h" 28 #include "gpu/config/gpu_switches.h"
33 #include "gpu/config/gpu_util.h" 29 #include "gpu/config/gpu_util.h"
34 #include "gpu/ipc/common/memory_stats.h" 30 #include "gpu/ipc/common/memory_stats.h"
35 #include "gpu/ipc/service/gpu_memory_buffer_factory.h" 31 #include "gpu/ipc/service/gpu_memory_buffer_factory.h"
36 #include "ipc/ipc_channel_handle.h" 32 #include "ipc/ipc_channel_handle.h"
37 #include "ipc/ipc_sync_message_filter.h" 33 #include "ipc/ipc_sync_message_filter.h"
34 #include "media/gpu/ipc/service/gpu_jpeg_decode_accelerator.h"
35 #include "media/gpu/ipc/service/gpu_video_decode_accelerator.h"
36 #include "media/gpu/ipc/service/gpu_video_encode_accelerator.h"
37 #include "media/gpu/ipc/service/media_service.h"
38 #include "ui/gl/gl_implementation.h" 38 #include "ui/gl/gl_implementation.h"
39 #include "ui/gl/gl_switches.h" 39 #include "ui/gl/gl_switches.h"
40 #include "ui/gl/gpu_switching_manager.h" 40 #include "ui/gl/gpu_switching_manager.h"
41 #include "url/gurl.h" 41 #include "url/gurl.h"
42 42
43 #if defined(USE_OZONE) 43 #if defined(USE_OZONE)
44 #include "ui/ozone/public/gpu_platform_support.h" 44 #include "ui/ozone/public/gpu_platform_support.h"
45 #include "ui/ozone/public/ozone_platform.h" 45 #include "ui/ozone/public/ozone_platform.h"
46 #endif 46 #endif
47 47
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 void GpuChildThread::StoreShaderToDisk(int32_t client_id, 348 void GpuChildThread::StoreShaderToDisk(int32_t client_id,
349 const std::string& key, 349 const std::string& key,
350 const std::string& shader) { 350 const std::string& shader) {
351 Send(new GpuHostMsg_CacheShader(client_id, key, shader)); 351 Send(new GpuHostMsg_CacheShader(client_id, key, shader));
352 } 352 }
353 353
354 void GpuChildThread::OnInitialize(const gpu::GpuPreferences& gpu_preferences) { 354 void GpuChildThread::OnInitialize(const gpu::GpuPreferences& gpu_preferences) {
355 gpu_preferences_ = gpu_preferences; 355 gpu_preferences_ = gpu_preferences;
356 356
357 gpu_info_.video_decode_accelerator_capabilities = 357 gpu_info_.video_decode_accelerator_capabilities =
358 content::GpuVideoDecodeAccelerator::GetCapabilities(gpu_preferences_); 358 media::GpuVideoDecodeAccelerator::GetCapabilities(gpu_preferences_);
359 gpu_info_.video_encode_accelerator_supported_profiles = 359 gpu_info_.video_encode_accelerator_supported_profiles =
360 content::GpuVideoEncodeAccelerator::GetSupportedProfiles( 360 media::GpuVideoEncodeAccelerator::GetSupportedProfiles(
361 gpu_preferences_); 361 gpu_preferences_);
362 gpu_info_.jpeg_decode_accelerator_supported = 362 gpu_info_.jpeg_decode_accelerator_supported =
363 content::GpuJpegDecodeAccelerator::IsSupported(); 363 media::GpuJpegDecodeAccelerator::IsSupported();
364 364
365 // Record initialization only after collecting the GPU info because that can 365 // Record initialization only after collecting the GPU info because that can
366 // take a significant amount of time. 366 // take a significant amount of time.
367 gpu_info_.initialization_time = base::Time::Now() - process_start_time_; 367 gpu_info_.initialization_time = base::Time::Now() - process_start_time_;
368 Send(new GpuHostMsg_Initialized(!dead_on_arrival_, gpu_info_)); 368 Send(new GpuHostMsg_Initialized(!dead_on_arrival_, gpu_info_));
369 while (!deferred_messages_.empty()) { 369 while (!deferred_messages_.empty()) {
370 Send(deferred_messages_.front()); 370 Send(deferred_messages_.front());
371 deferred_messages_.pop(); 371 deferred_messages_.pop();
372 } 372 }
373 373
(...skipping 22 matching lines...) Expand all
396 // Defer creation of the render thread. This is to prevent it from handling 396 // Defer creation of the render thread. This is to prevent it from handling
397 // IPC messages before the sandbox has been enabled and all other necessary 397 // IPC messages before the sandbox has been enabled and all other necessary
398 // initialization has succeeded. 398 // initialization has succeeded.
399 gpu_channel_manager_.reset( 399 gpu_channel_manager_.reset(
400 new gpu::GpuChannelManager(gpu_preferences_, this, watchdog_thread_.get(), 400 new gpu::GpuChannelManager(gpu_preferences_, this, watchdog_thread_.get(),
401 base::ThreadTaskRunnerHandle::Get().get(), 401 base::ThreadTaskRunnerHandle::Get().get(),
402 ChildProcess::current()->io_task_runner(), 402 ChildProcess::current()->io_task_runner(),
403 ChildProcess::current()->GetShutDownEvent(), 403 ChildProcess::current()->GetShutDownEvent(),
404 sync_point_manager, gpu_memory_buffer_factory_)); 404 sync_point_manager, gpu_memory_buffer_factory_));
405 405
406 media_service_.reset(new MediaService(gpu_channel_manager_.get())); 406 media_service_.reset(new media::MediaService(gpu_channel_manager_.get()));
407 407
408 #if defined(USE_OZONE) 408 #if defined(USE_OZONE)
409 ui::OzonePlatform::GetInstance() 409 ui::OzonePlatform::GetInstance()
410 ->GetGpuPlatformSupport() 410 ->GetGpuPlatformSupport()
411 ->OnChannelEstablished(this); 411 ->OnChannelEstablished(this);
412 #endif 412 #endif
413 } 413 }
414 414
415 void GpuChildThread::OnFinalize() { 415 void GpuChildThread::OnFinalize() {
416 // Quit the GPU process 416 // Quit the GPU process
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 570
571 void GpuChildThread::BindProcessControlRequest( 571 void GpuChildThread::BindProcessControlRequest(
572 mojo::InterfaceRequest<mojom::ProcessControl> request) { 572 mojo::InterfaceRequest<mojom::ProcessControl> request) {
573 DVLOG(1) << "GPU: Binding ProcessControl request"; 573 DVLOG(1) << "GPU: Binding ProcessControl request";
574 DCHECK(process_control_); 574 DCHECK(process_control_);
575 process_control_bindings_.AddBinding(process_control_.get(), 575 process_control_bindings_.AddBinding(process_control_.get(),
576 std::move(request)); 576 std::move(request));
577 } 577 }
578 578
579 } // namespace content 579 } // namespace content
OLDNEW
« content/DEPS ('K') | « content/gpu/gpu_child_thread.h ('k') | content/gpu/gpu_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698