Commit e6aed4a9 authored by Takashi Sakamoto's avatar Takashi Sakamoto Committed by Commit Bot

Revert "[Fuchsia] Handle VULKAN feature flag in WebEngine"

This reverts commit 74c69a75.

Reason for revert: causing first build failure on Deterministic Fuchsia (dbg).

Sample build: https://ci.chromium.org/p/chromium/builders/ci/Deterministic%20Fuchsia%20%28dbg%29/561

Sample log: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8903731569632286240/+/steps/First_build/0/stdout?format=raw

[47036/47333] SOLINK ./lib/libweb_engine_core.so
...
ld.lld: error: undefined symbol: switches::kEnableFeatures
>>> referenced by context_provider_impl.cc:208 (../../fuchsia/engine/context_provider_impl.cc:208)
>>>               obj/fuchsia/engine/web_engine_core/context_provider_impl.o:(ContextProviderImpl::Create(fuchsia::web::CreateContextParams, fidl::InterfaceRequest<fuchsia::web::Context>))

ld.lld: error: undefined symbol: gl::kGLImplementationStubName
>>> referenced by context_provider_impl.cc:212 (../../fuchsia/engine/context_provider_impl.cc:212)
>>>               obj/fuchsia/engine/web_engine_core/context_provider_impl.o:(ContextProviderImpl::Create(fuchsia::web::CreateContextParams, fidl::InterfaceRequest<fuchsia::web::Context>))
clang: error: ld.lld command failed with exit code 1 (use -v to see invocation)
[47037/47333] AR obj/components/password_manager/core/browser/libbrowser.a
[47038/47333] AR obj/components/sync_sessions/libsync_sessions.a


Original change's description:
> [Fuchsia] Handle VULKAN feature flag in WebEngine
> 
> Now WebEngine will enable Vulkan only when ContextFeatureFlags::VULKAN
> is specified for web::Context. Also Context process now explicitly
> disables hardware-accelerated compositing when VULKAN is not enabled
> (otherwise it restarts the GPU process several times before it falls
> back to software compositing).
> 
> Bug: 962617, fuchsia:35009
> Change-Id: I74a463a1514df99134d929981fe44151c1d9dd17
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1774967
> Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
> Reviewed-by: Jonathan Backer <backer@chromium.org>
> Reviewed-by: Wez <wez@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#691856}

TBR=backer@chromium.org,wez@chromium.org,sergeyu@chromium.org

Change-Id: I71d9bb87b79928bbffa9f123408b4e4bafad31bc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 962617, fuchsia:35009
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1775955Reviewed-by: default avatarTakashi Sakamoto <tasak@google.com>
Commit-Queue: Takashi Sakamoto <tasak@google.com>
Cr-Commit-Position: refs/heads/master@{#691941}
parent 735cb51e
...@@ -10,6 +10,12 @@ import("//mojo/public/tools/bindings/mojom.gni") ...@@ -10,6 +10,12 @@ import("//mojo/public/tools/bindings/mojom.gni")
import("//testing/test.gni") import("//testing/test.gni")
import("//tools/grit/repack.gni") import("//tools/grit/repack.gni")
declare_args() {
# Enables Vulkan in WebEngine (has effect only for context instances that have
# Vulkan loader service in the service directory).
web_engine_enable_vulkan = false
}
config("web_engine_implementation") { config("web_engine_implementation") {
defines = [ "WEB_ENGINE_IMPLEMENTATION" ] defines = [ "WEB_ENGINE_IMPLEMENTATION" ]
} }
...@@ -48,7 +54,6 @@ repack("web_engine_pak") { ...@@ -48,7 +54,6 @@ repack("web_engine_pak") {
"//content/app/resources", "//content/app/resources",
"//content/app/strings", "//content/app/strings",
"//content/browser/tracing:resources", "//content/browser/tracing:resources",
"//gpu/command_buffer/service",
"//mojo/public/js:resources", "//mojo/public/js:resources",
"//net:net_resources", "//net:net_resources",
"//third_party/blink/public:resources", "//third_party/blink/public:resources",
...@@ -75,7 +80,6 @@ component("web_engine_core") { ...@@ -75,7 +80,6 @@ component("web_engine_core") {
"//fuchsia/base", "//fuchsia/base",
"//fuchsia/base:message_port", "//fuchsia/base:message_port",
"//fuchsia/base:modular", "//fuchsia/base:modular",
"//gpu/command_buffer/service",
"//media/fuchsia/cdm/service", "//media/fuchsia/cdm/service",
"//media/fuchsia/mojom", "//media/fuchsia/mojom",
"//mojo/public/cpp/bindings", "//mojo/public/cpp/bindings",
...@@ -159,6 +163,9 @@ component("web_engine_core") { ...@@ -159,6 +163,9 @@ component("web_engine_core") {
":*", ":*",
"//fuchsia/runners:cast_runner_browsertests__exec", "//fuchsia/runners:cast_runner_browsertests__exec",
] ]
if (web_engine_enable_vulkan) {
defines = [ "WEB_ENGINE_ENABLE_VULKAN" ]
}
} }
executable("web_engine_exe") { executable("web_engine_exe") {
......
include_rules = [ include_rules = [
"+components/viz/common",
"+content/public/app", "+content/public/app",
"+gpu/command_buffer/service",
"+services/service_manager", "+services/service_manager",
"+ui/base", "+ui/base",
"+ui/gl/gl_switches.h",
] ]
...@@ -10,14 +10,12 @@ ...@@ -10,14 +10,12 @@
#include "base/command_line.h" #include "base/command_line.h"
#include "base/fuchsia/fuchsia_logging.h" #include "base/fuchsia/fuchsia_logging.h"
#include "base/logging.h" #include "base/logging.h"
#include "content/public/browser/gpu_data_manager.h"
#include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_frame_host.h"
#include "content/public/common/main_function_params.h" #include "content/public/common/main_function_params.h"
#include "fuchsia/engine/browser/context_impl.h" #include "fuchsia/engine/browser/context_impl.h"
#include "fuchsia/engine/browser/web_engine_browser_context.h" #include "fuchsia/engine/browser/web_engine_browser_context.h"
#include "fuchsia/engine/browser/web_engine_screen.h" #include "fuchsia/engine/browser/web_engine_screen.h"
#include "fuchsia/engine/common.h" #include "fuchsia/engine/common.h"
#include "gpu/command_buffer/service/gpu_switches.h"
#include "ui/aura/screen_ozone.h" #include "ui/aura/screen_ozone.h"
#include "ui/ozone/public/ozone_platform.h" #include "ui/ozone/public/ozone_platform.h"
...@@ -44,17 +42,6 @@ void WebEngineBrowserMainParts::PreMainMessageLoopRun() { ...@@ -44,17 +42,6 @@ void WebEngineBrowserMainParts::PreMainMessageLoopRun() {
display::Screen::SetScreenInstance(screen_.get()); display::Screen::SetScreenInstance(screen_.get());
// If Vulkan is not enabled then disable hardware acceleration. Otherwise gpu
// process will be restarted several times trying to initialize GL before
// falling back to software compositing.
if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kUseVulkan)) {
content::GpuDataManager* gpu_data_manager =
content::GpuDataManager::GetInstance();
DCHECK(gpu_data_manager);
gpu_data_manager->DisableHardwareAcceleration();
}
DCHECK(!browser_context_); DCHECK(!browser_context_);
browser_context_ = std::make_unique<WebEngineBrowserContext>( browser_context_ = std::make_unique<WebEngineBrowserContext>(
base::CommandLine::ForCurrentProcess()->HasSwitch(kIncognitoSwitch)); base::CommandLine::ForCurrentProcess()->HasSwitch(kIncognitoSwitch));
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include <vector> #include <vector>
#include "base/base_paths_fuchsia.h" #include "base/base_paths_fuchsia.h"
#include "base/base_switches.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/files/scoped_file.h" #include "base/files/scoped_file.h"
...@@ -33,13 +32,10 @@ ...@@ -33,13 +32,10 @@
#include "base/strings/strcat.h" #include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "components/viz/common/features.h"
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "fuchsia/engine/common.h" #include "fuchsia/engine/common.h"
#include "gpu/command_buffer/service/gpu_switches.h"
#include "net/http/http_util.h" #include "net/http/http_util.h"
#include "services/service_manager/sandbox/fuchsia/sandbox_policy_fuchsia.h" #include "services/service_manager/sandbox/fuchsia/sandbox_policy_fuchsia.h"
#include "ui/gl/gl_switches.h"
namespace { namespace {
...@@ -196,21 +192,14 @@ void ContextProviderImpl::Create( ...@@ -196,21 +192,14 @@ void ContextProviderImpl::Create(
base::JoinString(handles_ids, ",")); base::JoinString(handles_ids, ","));
} }
fuchsia::web::ContextFeatureFlags features = {}; #if defined(WEB_ENGINE_ENABLE_VULKAN)
if (params.has_features()) // TODO(fbx/35009): Add a flag in CreateContextParams to enable/disable Vulkan
features = params.features(); // and use it here.
launch_command.AppendSwitchASCII(
bool enable_vulkan = (features & fuchsia::web::ContextFeatureFlags::VULKAN) == "--enable-features", "DefaultEnableOopRasterization,UseSkiaRenderer");
fuchsia::web::ContextFeatureFlags::VULKAN; launch_command.AppendSwitch("--use-vulkan");
launch_command.AppendSwitchASCII("--use-gl", "stub");
if (enable_vulkan) { #endif // WEB_ENGINE_ENABLE_VULKAN
launch_command.AppendSwitch(switches::kUseVulkan);
launch_command.AppendSwitchASCII(switches::kEnableFeatures,
features::kUseSkiaRenderer.name);
launch_command.AppendSwitch(switches::kEnableOopRasterization);
launch_command.AppendSwitchASCII(switches::kUseGL,
gl::kGLImplementationStubName);
}
// Validate embedder-supplied product, and optional version, and pass it to // Validate embedder-supplied product, and optional version, and pass it to
// the Context to include in the UserAgent. // the Context to include in the UserAgent.
......
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