Commit ae6f313e authored by kylechar's avatar kylechar Committed by Commit Bot

Remove VizDisplayCompositor feature checks

The feature is launched everywhere so the feature checks are no longer
necessary.

Bug: 936425
Change-Id: I7ad1800cc44dc9260ea2348825b7d11aa330e842
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1972314
Commit-Queue: kylechar <kylechar@chromium.org>
Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726023}
parent 603bcf57
......@@ -82,14 +82,8 @@ bool IsUsingSkiaRenderer() {
return false;
#endif
// We require OOP-D everywhere but WebView.
bool enabled = base::FeatureList::IsEnabled(kUseSkiaRenderer) ||
base::FeatureList::IsEnabled(kVulkan);
if (enabled && !IsVizDisplayCompositorEnabled()) {
DLOG(ERROR) << "UseSkiaRenderer requires VizDisplayCompositor.";
return false;
}
return enabled;
return base::FeatureList::IsEnabled(kUseSkiaRenderer) ||
base::FeatureList::IsEnabled(kVulkan);
}
bool IsRecordingSkPicture() {
......
......@@ -420,9 +420,7 @@ void GpuHostImpl::DidInitialize(
client_id_to_shader_cache_.clear();
if (!params_.disable_gpu_shader_disk_cache) {
bool oopd_enabled = features::IsVizDisplayCompositorEnabled();
if (oopd_enabled)
CreateChannelCache(gpu::kInProcessCommandBufferClientId);
CreateChannelCache(gpu::kInProcessCommandBufferClientId);
bool use_gr_shader_cache = base::FeatureList::IsEnabled(
features::kDefaultEnableOopRasterization) ||
......
......@@ -97,7 +97,7 @@ void SkiaOutputSurfaceImplTest::TearDown() {
void SkiaOutputSurfaceImplTest::SetUpSkiaOutputSurfaceImpl() {
// SkiaOutputSurfaceImplOnGpu requires UseSkiaRenderer.
const char enable_features[] = "VizDisplayCompositor,UseSkiaRenderer";
const char enable_features[] = "UseSkiaRenderer";
const char disable_features[] = "";
scoped_feature_list_ = std::make_unique<base::test::ScopedFeatureList>();
scoped_feature_list_->InitFromCommandLine(enable_features, disable_features);
......
......@@ -286,8 +286,6 @@ class VIZ_SERVICE_EXPORT GpuServiceImpl : public gpu::GpuChannelManagerDelegate,
DawnContextProvider* dawn_context_provider() { return nullptr; }
#endif
void set_oopd_enabled() { oopd_enabled_ = true; }
private:
void RecordLogMessage(int severity,
size_t message_start,
......@@ -399,8 +397,6 @@ class VIZ_SERVICE_EXPORT GpuServiceImpl : public gpu::GpuChannelManagerDelegate,
scoped_refptr<arc::ProtectedBufferManager> protected_buffer_manager_;
#endif // defined(OS_CHROMEOS)
bool oopd_enabled_ = false;
// Display compositor contexts that don't have a corresponding GPU channel.
base::ObserverList<gpu::DisplayContext>::Unchecked display_contexts_;
......
......@@ -75,18 +75,17 @@ VizMainImpl::VizMainImpl(Delegate* delegate,
if (!dependencies_.io_thread_task_runner)
io_thread_ = CreateAndStartIOThread();
if (dependencies_.create_display_compositor) {
if (dependencies.viz_compositor_thread_runner) {
viz_compositor_thread_runner_ = dependencies.viz_compositor_thread_runner;
} else {
viz_compositor_thread_runner_impl_ =
std::make_unique<VizCompositorThreadRunnerImpl>();
viz_compositor_thread_runner_ = viz_compositor_thread_runner_impl_.get();
}
if (delegate_) {
delegate_->PostCompositorThreadCreated(
viz_compositor_thread_runner_->task_runner());
}
if (dependencies.viz_compositor_thread_runner) {
viz_compositor_thread_runner_ = dependencies.viz_compositor_thread_runner;
} else {
viz_compositor_thread_runner_impl_ =
std::make_unique<VizCompositorThreadRunnerImpl>();
viz_compositor_thread_runner_ = viz_compositor_thread_runner_impl_.get();
}
if (delegate_) {
delegate_->PostCompositorThreadCreated(
viz_compositor_thread_runner_->task_runner());
}
if (!gpu_init_->gpu_info().in_process_gpu && dependencies.ukm_recorder) {
......@@ -103,8 +102,6 @@ VizMainImpl::VizMainImpl(Delegate* delegate,
gpu_init_->gpu_feature_info_for_hardware_gpu(),
gpu_init_->gpu_extra_info(), gpu_init_->vulkan_implementation(),
base::BindOnce(&VizMainImpl::ExitProcess, base::Unretained(this)));
if (dependencies_.create_display_compositor)
gpu_service_->set_oopd_enabled();
}
VizMainImpl::~VizMainImpl() {
......
......@@ -63,7 +63,6 @@ class VizMainImpl : public mojom::VizMain {
ExternalDependencies& operator=(ExternalDependencies&& other);
bool create_display_compositor = false;
gpu::SyncPointManager* sync_point_manager = nullptr;
gpu::SharedImageManager* shared_image_manager = nullptr;
base::WaitableEvent* shutdown_event = nullptr;
......
......@@ -415,10 +415,8 @@ void BrowserGpuChannelHostFactory::InitializeShaderDiskCacheOnIO(
int gpu_client_id,
const base::FilePath& cache_dir) {
GetShaderCacheFactorySingleton()->SetCacheInfo(gpu_client_id, cache_dir);
if (features::IsVizDisplayCompositorEnabled()) {
GetShaderCacheFactorySingleton()->SetCacheInfo(
gpu::kInProcessCommandBufferClientId, cache_dir);
}
GetShaderCacheFactorySingleton()->SetCacheInfo(
gpu::kInProcessCommandBufferClientId, cache_dir);
}
// static
......
......@@ -214,9 +214,6 @@ const GpuFeatureData GetGpuFeatureData(
DisableInfo::Problem(
"WebGL2 has been disabled via blacklist or the command line."),
false},
{"viz_display_compositor", gpu::kGpuFeatureStatusEnabled,
!features::IsVizDisplayCompositorEnabled(), DisableInfo::NotProblem(),
false},
{"skia_renderer", gpu::kGpuFeatureStatusEnabled,
!features::IsUsingSkiaRenderer(), DisableInfo::NotProblem(), false},
};
......@@ -244,8 +241,7 @@ std::unique_ptr<base::DictionaryValue> GetFeatureStatusImpl(
GetGpuFeatureData(gpu_feature_info, i, &eof);
std::string status;
// Features undergoing a finch controlled roll out.
if (gpu_feature_data.name == "viz_display_compositor" ||
gpu_feature_data.name == "skia_renderer" ||
if (gpu_feature_data.name == "skia_renderer" ||
gpu_feature_data.name == "viz_hit_test_surface_layer") {
status = (gpu_feature_data.disabled ? "disabled_off_ok" : "enabled_on");
} else if (gpu_feature_data.disabled || gpu_access_blocked ||
......
......@@ -422,19 +422,17 @@ bool GpuDataManagerImplPrivate::GpuAccessAllowed(std::string* reason) const {
}
bool GpuDataManagerImplPrivate::GpuProcessStartAllowed() const {
if (GpuAccessAllowed(nullptr))
return true;
#if defined(USE_X11) || defined(OS_MACOSX) || defined(OS_FUCHSIA)
// If GPU access is disabled with OOP-D we run the display compositor in:
// Browser process: Windows
// GPU process: Linux, Mac and Fuchsia
// N/A: Android and Chrome OS (GPU access can't be disabled)
if (features::IsVizDisplayCompositorEnabled())
return true;
#if defined(OS_WIN)
// On Windows if hardware GPU access is disabled we run the display compositor
// in the browser process and don't start a GPU process.
// TODO(kylechar/zmo): Remove special case for Windows here.
return GpuAccessAllowed(nullptr);
#else
// For all other platforms we either always run the display compositor in the
// GPU process (Linux, Mac and Fuchsia) or GPU access is never disabled
// (Android and Chrome OS).
return true;
#endif
return false;
}
void GpuDataManagerImplPrivate::RequestDxdiagDx12VulkanGpuInfoIfNeeded(
......
......@@ -262,7 +262,6 @@ cr.define('gpu', function() {
'surface_control': 'Surface Control',
'vpx_decode': 'VPx Video Decode',
'webgl2': 'WebGL2',
'viz_display_compositor': 'Viz Display Compositor',
'skia_renderer': 'Skia Renderer',
};
......
......@@ -17,7 +17,6 @@
#include "base/sequenced_task_runner.h"
#include "base/threading/thread_checker.h"
#include "build/build_config.h"
#include "components/viz/common/features.h"
#include "content/child/child_process.h"
#include "content/gpu/browser_exposed_gpu_interfaces.h"
#include "content/gpu/gpu_service_factory.h"
......@@ -71,7 +70,6 @@ ChildThreadImpl::Options GetOptions() {
viz::VizMainImpl::ExternalDependencies CreateVizMainDependencies() {
viz::VizMainImpl::ExternalDependencies deps;
deps.create_display_compositor = features::IsVizDisplayCompositorEnabled();
if (GetContentClient()->gpu()) {
deps.sync_point_manager = GetContentClient()->gpu()->GetSyncPointManager();
deps.shared_image_manager =
......
......@@ -176,17 +176,6 @@ class GpuProcessIntegrationTest(gpu_integration_test.GpuIntegrationTest):
(sys.platform.startswith('linux') and
not self._RunningOnAndroid()))
def _AlwaysRunsGpuProcess(self):
# With VizDisplayCompositor enabled we always run a GPU process for the
# display compositor, except on Windows where the display compositor will
# run in the browser process if GPU and SwiftShader are disabled.
system_info = self.browser.GetSystemInfo()
if not system_info:
self.fail("Browser doesn't support GetSystemInfo")
viz_status = system_info.gpu.feature_status.get('viz_display_compositor')
return viz_status == 'enabled_on' and sys.platform != 'win32'
@staticmethod
def _Filterer(workaround):
# Filter all entries starting with "disabled_extension_" and
......@@ -398,15 +387,20 @@ class GpuProcessIntegrationTest(gpu_integration_test.GpuIntegrationTest):
# TODO(zmo): If this test runs on ChromeOS, we also need to skip it.
return
if self._AlwaysRunsGpuProcess():
# The current configuration will always launch a GPU process, skip test.
return
self.RestartBrowserIfNecessaryWithArgs(self._AddDefaultArgs([
'--disable-gpu',
'--disable-software-rasterizer']))
self._NavigateAndWait(test_path)
if self.tab.EvaluateJavaScript('chrome.gpuBenchmarking.hasGpuProcess()'):
# Windows will run the display compositor in the browser process if
# accelerated GL and Swiftshader are both disabled.
should_have_gpu_process = sys.platform != 'win32'
has_gpu_process = self.tab.EvaluateJavaScript(
'chrome.gpuBenchmarking.hasGpuProcess()')
if should_have_gpu_process and not has_gpu_process:
self.fail('GPU process not detected')
elif not should_have_gpu_process and has_gpu_process:
self.fail('GPU process detected')
def _GpuProcess_disable_swiftshader(self, test_path):
......
......@@ -13,7 +13,6 @@
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "build/chromecast_buildflags.h"
#include "components/viz/common/features.h"
#include "gpu/command_buffer/service/gpu_switches.h"
#include "gpu/command_buffer/service/service_utils.h"
#include "gpu/config/gpu_driver_bug_list.h"
......@@ -274,7 +273,6 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
ui::OzonePlatform::InitParams params;
params.single_process = false;
params.using_mojo = features::IsOzoneDrmMojo();
params.viz_display_compositor = features::IsVizDisplayCompositorEnabled();
ui::OzonePlatform::InitializeForGPU(params);
const std::vector<gfx::BufferFormat> supported_buffer_formats_for_texturing =
ui::OzonePlatform::GetInstance()
......@@ -538,7 +536,6 @@ void GpuInit::InitializeInProcess(base::CommandLine* command_line,
ui::OzonePlatform::InitParams params;
params.single_process = true;
params.using_mojo = features::IsOzoneDrmMojo();
params.viz_display_compositor = features::IsVizDisplayCompositorEnabled();
ui::OzonePlatform::InitializeForGPU(params);
const std::vector<gfx::BufferFormat> supported_buffer_formats_for_texturing =
ui::OzonePlatform::GetInstance()
......
......@@ -8,7 +8,6 @@
#include "base/lazy_instance.h"
#include "base/memory/ptr_util.h"
#include "base/observer_list_types.h"
#include "components/viz/common/features.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/env_input_state_controller.h"
#include "ui/aura/env_observer.h"
......@@ -220,7 +219,6 @@ void Env::Init() {
params.single_process = command_line->HasSwitch("single-process") ||
command_line->HasSwitch("in-process-gpu");
params.using_mojo = features::IsOzoneDrmMojo();
params.viz_display_compositor = features::IsVizDisplayCompositorEnabled();
ui::OzonePlatform::InitializeForUI(params);
#endif
......
......@@ -77,9 +77,6 @@ class COMPONENT_EXPORT(OZONE) OzonePlatform {
// regardless of this param.
// TODO(crbug.com/806092): Remove after legacy IPC-based Ozone is removed.
bool using_mojo = false;
// TODO(crbug.com/936425): Not checked, delete when no longer set.
bool viz_display_compositor = false;
};
// Struct used to indicate platform properties.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment