Skip to content

Commit

Permalink
Revert "[fuchsia] Enable ANGLE in web_engine"
Browse files Browse the repository at this point in the history
This reverts commit 4d323a0.

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 <spang@chromium.org>
> Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
> 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 <fdegans@chromium.org>
Commit-Queue: Fabrice de Gans-Riberi <fdegans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747941}
  • Loading branch information
Steelskin authored and Commit Bot committed Mar 7, 2020
1 parent 15b64d6 commit d3953b6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 34 deletions.
3 changes: 3 additions & 0 deletions fuchsia/engine/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
}

Expand Down
56 changes: 24 additions & 32 deletions fuchsia/engine/context_provider_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
Expand All @@ -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
Expand All @@ -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);
}
Expand Down
2 changes: 0 additions & 2 deletions ui/ozone/platform/scenic/scenic_surface_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ ScenicSurfaceFactory::GetAllowedGLImplementations() {
return std::vector<gl::GLImplementation>{
gl::kGLImplementationSwiftShaderGL,
gl::kGLImplementationEGLGLES2,
gl::kGLImplementationEGLANGLE,
gl::kGLImplementationStubGL,
};
}
Expand All @@ -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;
Expand Down

0 comments on commit d3953b6

Please sign in to comment.