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

Unified Diff: content/gpu/gpu_child_thread.cc

Issue 1784193003: content gpu refactor: get rid of gpu related content switches. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: content/gpu/gpu_child_thread.cc
diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc
index 2452579e0a911404e22e98368b246de4513f409d..85ba324da8b714f8a403af9e1094b24ac7902f5e 100644
--- a/content/gpu/gpu_child_thread.cc
+++ b/content/gpu/gpu_child_thread.cc
@@ -17,7 +17,9 @@
#include "content/common/gpu/establish_channel_params.h"
#include "content/common/gpu/gpu_host_messages.h"
#include "content/common/gpu/gpu_memory_buffer_factory.h"
+#include "content/common/gpu/media/gpu_jpeg_decode_accelerator.h"
#include "content/common/gpu/media/gpu_video_decode_accelerator.h"
+#include "content/common/gpu/media/gpu_video_encode_accelerator.h"
#include "content/common/gpu/media/media_service.h"
#include "content/gpu/gpu_process_control_impl.h"
#include "content/gpu/gpu_watchdog_thread.h"
@@ -189,10 +191,11 @@ GpuChildThread::GpuChildThread(
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kInProcessGPU));
- // Populate accelerator capabilities (normally done during GpuMain, which is
- // not called for single process or in process gpu).
+ // Populate accelerator capabilities (normally done during
+ // GpuChildThread::OnInitialize, which is not called for single process or in
+ // process gpu).
piman 2016/03/11 20:43:56 Actually, GpuChildThread::OnInitialize is called,
Peng 2016/03/11 22:43:16 Done.
gpu_info_.video_decode_accelerator_capabilities =
- content::GpuVideoDecodeAccelerator::GetCapabilities();
+ content::GpuVideoDecodeAccelerator::GetCapabilities(gpu_preferences_);
#if defined(ENABLE_VULKAN)
// Temporary Vulkan initialization injection.
@@ -349,6 +352,15 @@ void GpuChildThread::StoreShaderToDisk(int32_t client_id,
void GpuChildThread::OnInitialize(const gpu::GpuPreferences& gpu_preferences) {
gpu_preferences_ = gpu_preferences;
+
+ gpu_info_.video_decode_accelerator_capabilities =
+ content::GpuVideoDecodeAccelerator::GetCapabilities(gpu_preferences_);
+ gpu_info_.video_encode_accelerator_supported_profiles =
+ content::GpuVideoEncodeAccelerator::GetSupportedProfiles(
+ gpu_preferences_);
+ gpu_info_.jpeg_decode_accelerator_supported =
+ content::GpuJpegDecodeAccelerator::IsSupported();
+
// Record initialization only after collecting the GPU info because that can
// take a significant amount of time.
gpu_info_.initialization_time = base::Time::Now() - process_start_time_;

Powered by Google App Engine
This is Rietveld 408576698