From d3953b6e55bd5050411217ce06d65f3c576cf212 Mon Sep 17 00:00:00 2001 From: Fabrice de Gans-Riberi Date: Sat, 7 Mar 2020 00:18:58 +0000 Subject: [PATCH] Revert "[fuchsia] Enable ANGLE in web_engine" This reverts commit 4d323a02a52373cba3d7431bc56d8cdcf14928ab. Reason for revert: This caused cast_runner_integration_tests to fail. See https://ci.chromium.org/p/chromium/builders/ci/Fuchsia%20x64/50467 Original change's description: > [fuchsia] Enable ANGLE in web_engine > > This is not currently compatible with --enforce-vulkan-protected-memory. > which forces all shared images to be protected, including canvas > resources. > > Bug: 766360 > > Change-Id: I172c873d239a7e2da2012cf308d74198e615355e > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2090455 > Commit-Queue: Michael Spang > Reviewed-by: Sergey Ulanov > Cr-Commit-Position: refs/heads/master@{#747857} TBR=spang@chromium.org,sergeyu@chromium.org Change-Id: I9b5ca3ab6182b0629885d5802e2c4031603df01e No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 766360 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2092555 Reviewed-by: Fabrice de Gans-Riberi Commit-Queue: Fabrice de Gans-Riberi Cr-Commit-Position: refs/heads/master@{#747941} --- fuchsia/engine/BUILD.gn | 3 + fuchsia/engine/context_provider_impl.cc | 56 ++++++++----------- .../platform/scenic/scenic_surface_factory.cc | 2 - 3 files changed, 27 insertions(+), 34 deletions(-) diff --git a/fuchsia/engine/BUILD.gn b/fuchsia/engine/BUILD.gn index 421df7348e3624..b94224f2efc65c 100644 --- a/fuchsia/engine/BUILD.gn +++ b/fuchsia/engine/BUILD.gn @@ -209,6 +209,9 @@ cr_fuchsia_package("web_engine") { excluded_files = [ "lib/libswiftshader_libEGL.so", "lib/libswiftshader_libGLESv2.so", + "lib/libEGL.so", + "lib/libGLESv2.so", + "lib/libfuchsia_egl.so", ] } diff --git a/fuchsia/engine/context_provider_impl.cc b/fuchsia/engine/context_provider_impl.cc index beb11e13c95760..373ece5eb8fb19 100644 --- a/fuchsia/engine/context_provider_impl.cc +++ b/fuchsia/engine/context_provider_impl.cc @@ -415,26 +415,6 @@ void ContextProviderImpl::Create( return; } - bool allow_protected_graphics = - web_engine_config.FindBoolPath("allow-protected-graphics") - .value_or(false); - bool force_protected_graphics = - web_engine_config.FindBoolPath("force-protected-graphics") - .value_or(false); - bool enable_protected_graphics = - (enable_drm && allow_protected_graphics) || force_protected_graphics; - - if (enable_protected_graphics) { - launch_command.AppendSwitch(switches::kEnforceVulkanProtectedMemory); - launch_command.AppendSwitch(switches::kEnableProtectedVideoBuffers); - bool force_protected_video_buffers = - web_engine_config.FindBoolPath("force-protected-video-buffers") - .value_or(false); - if (force_protected_video_buffers) { - launch_command.AppendSwitch(switches::kForceProtectedVideoOutputBuffers); - } - } - if (enable_vulkan) { if (is_headless) { LOG(ERROR) << "VULKAN and HEADLESS features cannot be used together."; @@ -453,18 +433,10 @@ void ContextProviderImpl::Create( // SkiaRenderer requires out-of-process rasterization be enabled. launch_command.AppendSwitch(switches::kEnableOopRasterization); - if (!enable_protected_graphics) { - launch_command.AppendSwitchASCII(switches::kUseGL, - gl::kGLImplementationANGLEName); - } else { - DLOG(WARNING) << "ANGLE is not compatible with " - << switches::kEnforceVulkanProtectedMemory - << ", disabling GL"; - // TODO(crbug.com/1059010): Fix this; probably don't protect canvas - // resources. - launch_command.AppendSwitchASCII(switches::kUseGL, - gl::kGLImplementationDisabledName); - } + // TODO(https://crbug.com/766360): Provide a no-op GL implementation until + // vANGLE is available. + launch_command.AppendSwitchASCII(switches::kUseGL, + gl::kGLImplementationStubName); } else { DLOG(ERROR) << "Disabling GPU acceleration."; // Disable use of Vulkan GPU, and use of the software-GL rasterizer. The @@ -473,6 +445,26 @@ void ContextProviderImpl::Create( launch_command.AppendSwitch(switches::kDisableSoftwareRasterizer); } + bool allow_protected_graphics = + web_engine_config.FindBoolPath("allow-protected-graphics") + .value_or(false); + bool force_protected_graphics = + web_engine_config.FindBoolPath("force-protected-graphics") + .value_or(false); + bool enable_protected_graphics = + (enable_drm && allow_protected_graphics) || force_protected_graphics; + + if (enable_protected_graphics) { + launch_command.AppendSwitch(switches::kEnforceVulkanProtectedMemory); + launch_command.AppendSwitch(switches::kEnableProtectedVideoBuffers); + bool force_protected_video_buffers = + web_engine_config.FindBoolPath("force-protected-video-buffers") + .value_or(false); + if (force_protected_video_buffers) { + launch_command.AppendSwitch(switches::kForceProtectedVideoOutputBuffers); + } + } + if (enable_widevine) { launch_command.AppendSwitch(switches::kEnableWidevine); } diff --git a/ui/ozone/platform/scenic/scenic_surface_factory.cc b/ui/ozone/platform/scenic/scenic_surface_factory.cc index 9820474af76011..f00e658f3261ad 100644 --- a/ui/ozone/platform/scenic/scenic_surface_factory.cc +++ b/ui/ozone/platform/scenic/scenic_surface_factory.cc @@ -94,7 +94,6 @@ ScenicSurfaceFactory::GetAllowedGLImplementations() { return std::vector{ gl::kGLImplementationSwiftShaderGL, gl::kGLImplementationEGLGLES2, - gl::kGLImplementationEGLANGLE, gl::kGLImplementationStubGL, }; } @@ -103,7 +102,6 @@ GLOzone* ScenicSurfaceFactory::GetGLOzone(gl::GLImplementation implementation) { switch (implementation) { case gl::kGLImplementationSwiftShaderGL: case gl::kGLImplementationEGLGLES2: - case gl::kGLImplementationEGLANGLE: return egl_implementation_.get(); default: return nullptr;