diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-12-10 16:19:40 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-12-10 16:01:50 +0000 |
commit | 51f6c2793adab2d864b3d2b360000ef8db1d3e92 (patch) | |
tree | 835b3b4446b012c75e80177cef9fbe6972cc7dbe /chromium/gpu/ipc/service/gpu_init.cc | |
parent | 6036726eb981b6c4b42047513b9d3f4ac865daac (diff) | |
download | qtwebengine-chromium-51f6c2793adab2d864b3d2b360000ef8db1d3e92.tar.gz |
BASELINE: Update Chromium to 71.0.3578.93
Change-Id: I6a32086c33670e1b033f8b10e6bf1fd4da1d105d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/gpu/ipc/service/gpu_init.cc')
-rw-r--r-- | chromium/gpu/ipc/service/gpu_init.cc | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/chromium/gpu/ipc/service/gpu_init.cc b/chromium/gpu/ipc/service/gpu_init.cc index 80a29ba76a4..bee52c67f1a 100644 --- a/chromium/gpu/ipc/service/gpu_init.cc +++ b/chromium/gpu/ipc/service/gpu_init.cc @@ -9,7 +9,7 @@ #include "base/command_line.h" #include "base/metrics/histogram_macros.h" #include "base/strings/string_number_conversions.h" -#include "base/threading/thread_restrictions.h" +#include "base/threading/scoped_blocking_call.h" #include "base/trace_event/trace_event.h" #include "build/build_config.h" #include "gpu/command_buffer/service/gpu_switches.h" @@ -82,7 +82,7 @@ bool CollectGraphicsInfo(GPUInfo* gpu_info, #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(IS_CHROMECAST) bool CanAccessNvidiaDeviceFile() { bool res = true; - base::AssertBlockingAllowed(); + base::ScopedBlockingCall scoped_blocking_call(base::BlockingType::WILL_BLOCK); if (access("/dev/nvidiactl", R_OK) != 0) { DVLOG(1) << "NVIDIA device file /dev/nvidiactl access denied"; res = false; @@ -183,20 +183,6 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line, #endif // OS_WIN } -#if BUILDFLAG(ENABLE_VULKAN) - if (gpu_preferences_.enable_vulkan) { - vulkan_implementation_ = gpu::CreateVulkanImplementation(); - if (!vulkan_implementation_ || - !vulkan_implementation_->InitializeVulkanInstance()) { - DLOG(WARNING) << "Failed to create and initialize Vulkan implementation."; - vulkan_implementation_ = nullptr; - } - gpu_preferences_.enable_vulkan = !!vulkan_implementation_; - } -#else - gpu_preferences_.enable_vulkan = false; -#endif - sandbox_helper_->PreSandboxStartup(); bool attempted_startsandbox = false; @@ -218,10 +204,27 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line, // may also have started at this point. ui::OzonePlatform::InitParams params; params.single_process = false; - params.using_mojo = features::IsOzoneDrmMojo(); + params.using_mojo = + features::IsOzoneDrmMojo() || ui::OzonePlatform::EnsureInstance() + ->GetPlatformProperties() + .requires_mojo; ui::OzonePlatform::InitializeForGPU(params); #endif +#if BUILDFLAG(ENABLE_VULKAN) + if (gpu_preferences_.enable_vulkan) { + vulkan_implementation_ = gpu::CreateVulkanImplementation(); + if (!vulkan_implementation_ || + !vulkan_implementation_->InitializeVulkanInstance()) { + DLOG(WARNING) << "Failed to create and initialize Vulkan implementation."; + vulkan_implementation_ = nullptr; + } + gpu_preferences_.enable_vulkan = !!vulkan_implementation_; + } +#else + gpu_preferences_.enable_vulkan = false; +#endif + if (!use_swiftshader) { use_swiftshader = EnableSwiftShaderIfNeeded( command_line, gpu_feature_info_, @@ -365,12 +368,10 @@ void GpuInit::InitializeInProcess(base::CommandLine* command_line, #if defined(USE_OZONE) ui::OzonePlatform::InitParams params; params.single_process = true; -#if defined(OS_CHROMEOS) params.using_mojo = - features::IsMultiProcessMash() || features::IsOzoneDrmMojo(); -#else - params.using_mojo = features::IsOzoneDrmMojo(); -#endif + features::IsOzoneDrmMojo() || ui::OzonePlatform::EnsureInstance() + ->GetPlatformProperties() + .requires_mojo; ui::OzonePlatform::InitializeForGPU(params); ui::OzonePlatform::GetInstance()->AfterSandboxEntry(); #endif |