diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/components/viz/host | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/viz/host')
7 files changed, 60 insertions, 22 deletions
diff --git a/chromium/components/viz/host/BUILD.gn b/chromium/components/viz/host/BUILD.gn index 8bf87caba72..09fff133014 100644 --- a/chromium/components/viz/host/BUILD.gn +++ b/chromium/components/viz/host/BUILD.gn @@ -95,6 +95,10 @@ viz_source_set("unit_tests") { if (use_ozone) { deps += [ "//ui/ozone" ] } + + if (use_x11 || use_ozone) { + deps += [ "//ui/base:features" ] + } } fuzzer_test("hit_test_query_fuzzer") { diff --git a/chromium/components/viz/host/gpu_host_impl.cc b/chromium/components/viz/host/gpu_host_impl.cc index 414ba48b659..c3d6c9a3fd0 100644 --- a/chromium/components/viz/host/gpu_host_impl.cc +++ b/chromium/components/viz/host/gpu_host_impl.cc @@ -36,6 +36,10 @@ #include "ui/gfx/win/rendering_window_manager.h" #endif +#if defined(USE_OZONE) +#include "ui/base/ui_base_features.h" +#endif + namespace viz { namespace { @@ -125,7 +129,8 @@ GpuHostImpl::GpuHostImpl(Delegate* delegate, GetFontRenderParams().Get()->subpixel_rendering); #if defined(USE_OZONE) - InitOzone(); + if (features::IsUsingOzonePlatform()) + InitOzone(); #endif // defined(USE_OZONE) } @@ -294,6 +299,7 @@ mojom::InfoCollectionGpuService* GpuHostImpl::info_collection_gpu_service() { #if defined(USE_OZONE) void GpuHostImpl::InitOzone() { + DCHECK(features::IsUsingOzonePlatform()); // Ozone needs to send the primary DRM device to GPU service as early as // possible to ensure the latter always has a valid device. // https://crbug.com/608839 @@ -512,6 +518,10 @@ void GpuHostImpl::DidUpdateOverlayInfo(const gpu::OverlayInfo& overlay_info) { delegate_->DidUpdateOverlayInfo(overlay_info); } +void GpuHostImpl::DidUpdateHDRStatus(bool hdr_enabled) { + delegate_->DidUpdateHDRStatus(hdr_enabled); +} + void GpuHostImpl::SetChildSurface(gpu::SurfaceHandle parent, gpu::SurfaceHandle child) { if (pid_ != base::kNullProcessId) { diff --git a/chromium/components/viz/host/gpu_host_impl.h b/chromium/components/viz/host/gpu_host_impl.h index 6481e8f0ed5..640814e68d0 100644 --- a/chromium/components/viz/host/gpu_host_impl.h +++ b/chromium/components/viz/host/gpu_host_impl.h @@ -73,6 +73,7 @@ class VIZ_HOST_EXPORT GpuHostImpl : public mojom::GpuHost { virtual void MaybeShutdownGpuProcess() = 0; #if defined(OS_WIN) virtual void DidUpdateOverlayInfo(const gpu::OverlayInfo& overlay_info) = 0; + virtual void DidUpdateHDRStatus(bool hdr_enabled) = 0; #endif virtual void BlockDomainFrom3DAPIs(const GURL& url, gpu::DomainGuilt guilt) = 0; @@ -231,6 +232,7 @@ class VIZ_HOST_EXPORT GpuHostImpl : public mojom::GpuHost { void DisableGpuCompositing() override; #if defined(OS_WIN) void DidUpdateOverlayInfo(const gpu::OverlayInfo& overlay_info) override; + void DidUpdateHDRStatus(bool hdr_enabled) override; void SetChildSurface(gpu::SurfaceHandle parent, gpu::SurfaceHandle child) override; #endif diff --git a/chromium/components/viz/host/hit_test/hit_test_query.cc b/chromium/components/viz/host/hit_test/hit_test_query.cc index 54cd565e50a..9ca5eba8860 100644 --- a/chromium/components/viz/host/hit_test/hit_test_query.cc +++ b/chromium/components/viz/host/hit_test/hit_test_query.cc @@ -4,6 +4,8 @@ #include "components/viz/host/hit_test/hit_test_query.h" +#include <sstream> + #include "base/containers/stack.h" #include "base/metrics/histogram_macros.h" #include "base/strings/string_util.h" @@ -224,8 +226,8 @@ bool HitTestQuery::FindTargetInRegionForLocation( // hit test data, e.g. overlapped by ShelfApp on ChromeOS. // The kHitTestAsk flag should be ignored in such a case because there is no // need to do async hit testing on the root merely because it was overlapped. - // TODO(yigu): Do not set the kHitTestAsk and kOverlappedRegion flags for - // root when building hit test data. + // TODO(crbug.com/1001238): Do not set the kHitTestAsk and kOverlappedRegion + // flags for root when building hit test data. bool root_view_overlapped = hit_test_data_[region_index].frame_sink_id == root_view_frame_sink_id && hit_test_data_[region_index].async_hit_test_reasons == diff --git a/chromium/components/viz/host/host_gpu_memory_buffer_manager.cc b/chromium/components/viz/host/host_gpu_memory_buffer_manager.cc index 913efda7a10..34af06414c2 100644 --- a/chromium/components/viz/host/host_gpu_memory_buffer_manager.cc +++ b/chromium/components/viz/host/host_gpu_memory_buffer_manager.cc @@ -15,6 +15,7 @@ #include "gpu/ipc/common/gpu_memory_buffer_impl_shared_memory.h" #include "gpu/ipc/common/gpu_memory_buffer_support.h" #include "services/viz/privileged/mojom/gl/gpu_service.mojom.h" +#include "ui/base/ui_base_features.h" #include "ui/gfx/buffer_format_util.h" #include "ui/gfx/buffer_usage_util.h" @@ -46,11 +47,15 @@ HostGpuMemoryBufferManager::HostGpuMemoryBufferManager( client_id_(client_id), gpu_memory_buffer_support_(std::move(gpu_memory_buffer_support)), task_runner_(std::move(task_runner)) { -#if !defined(USE_X11) - native_configurations_ = gpu::GetNativeGpuMemoryBufferConfigurations( - gpu_memory_buffer_support_.get()); - native_configurations_initialized_.Signal(); + bool should_get_native_configs = true; +#if defined(USE_X11) + should_get_native_configs = features::IsUsingOzonePlatform(); #endif + if (should_get_native_configs) { + native_configurations_ = gpu::GetNativeGpuMemoryBufferConfigurations( + gpu_memory_buffer_support_.get()); + native_configurations_initialized_.Signal(); + } base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( this, "HostGpuMemoryBufferManager", task_runner_); } @@ -283,7 +288,12 @@ void HostGpuMemoryBufferManager::OnConnectionError() { << ", size = " << buffer.size.ToString() << ", format = " << gfx::BufferFormatToString(buffer.format) << ", usage = " << gfx::BufferUsageToString(buffer.usage) - << ", surface_handle = " << buffer.surface_handle + << ", surface_handle = " +#if defined(USE_X11) + << static_cast<uint32_t>(buffer.surface_handle) +#else + << buffer.surface_handle +#endif << " due to connection error"; AllocateGpuMemoryBuffer( buffer_pair.first, client_pair.first, buffer.size, buffer.format, diff --git a/chromium/components/viz/host/host_gpu_memory_buffer_manager_unittest.cc b/chromium/components/viz/host/host_gpu_memory_buffer_manager_unittest.cc index 6620f76f584..6a62df062f5 100644 --- a/chromium/components/viz/host/host_gpu_memory_buffer_manager_unittest.cc +++ b/chromium/components/viz/host/host_gpu_memory_buffer_manager_unittest.cc @@ -19,6 +19,10 @@ #include "testing/gtest/include/gtest/gtest.h" #include "ui/gfx/client_native_pixmap_factory.h" +#if defined(USE_OZONE) || defined(USE_X11) +#include "ui/base/ui_base_features.h" // nogncheck +#endif + #if defined(USE_OZONE) #include "ui/ozone/public/ozone_platform.h" #endif @@ -229,7 +233,8 @@ class HostGpuMemoryBufferManagerTest : public ::testing::Test { base::ThreadTaskRunnerHandle::Get()); #if defined(USE_X11) // X11 requires GPU process initialization to determine GMB support. - gpu_memory_buffer_manager_->native_configurations_initialized_.Signal(); + if (!features::IsUsingOzonePlatform()) + gpu_memory_buffer_manager_->native_configurations_initialized_.Signal(); #endif } @@ -238,9 +243,11 @@ class HostGpuMemoryBufferManagerTest : public ::testing::Test { bool IsNativePixmapConfigSupported() { bool native_pixmap_supported = false; #if defined(USE_OZONE) - native_pixmap_supported = - ui::OzonePlatform::GetInstance()->IsNativePixmapConfigSupported( - gfx::BufferFormat::RGBA_8888, gfx::BufferUsage::GPU_READ); + if (features::IsUsingOzonePlatform()) { + native_pixmap_supported = + ui::OzonePlatform::GetInstance()->IsNativePixmapConfigSupported( + gfx::BufferFormat::RGBA_8888, gfx::BufferUsage::GPU_READ); + } #elif defined(OS_ANDROID) native_pixmap_supported = base::AndroidHardwareBufferCompat::IsSupportAvailable(); diff --git a/chromium/components/viz/host/renderer_settings_creation.cc b/chromium/components/viz/host/renderer_settings_creation.cc index 0fc4813b2f7..f28c3218baa 100644 --- a/chromium/components/viz/host/renderer_settings_creation.cc +++ b/chromium/components/viz/host/renderer_settings_creation.cc @@ -20,6 +20,7 @@ #endif #if defined(USE_OZONE) +#include "ui/base/ui_base_features.h" #include "ui/ozone/public/ozone_platform.h" #endif @@ -86,16 +87,18 @@ RendererSettings CreateRendererSettings() { } #if defined(USE_OZONE) - if (command_line->HasSwitch(switches::kEnableHardwareOverlays)) { - renderer_settings.overlay_strategies = ParseOverlayStrategies( - command_line->GetSwitchValueASCII(switches::kEnableHardwareOverlays)); - } else { - auto& host_properties = - ui::OzonePlatform::GetInstance()->GetInitializedHostProperties(); - if (host_properties.supports_overlays) { - renderer_settings.overlay_strategies = {OverlayStrategy::kFullscreen, - OverlayStrategy::kSingleOnTop, - OverlayStrategy::kUnderlay}; + if (features::IsUsingOzonePlatform()) { + if (command_line->HasSwitch(switches::kEnableHardwareOverlays)) { + renderer_settings.overlay_strategies = ParseOverlayStrategies( + command_line->GetSwitchValueASCII(switches::kEnableHardwareOverlays)); + } else { + auto& host_properties = + ui::OzonePlatform::GetInstance()->GetInitializedHostProperties(); + if (host_properties.supports_overlays) { + renderer_settings.overlay_strategies = {OverlayStrategy::kFullscreen, + OverlayStrategy::kSingleOnTop, + OverlayStrategy::kUnderlay}; + } } } #endif |