Commit c7b0a365 authored by Vasiliy Telezhnikov's avatar Vasiliy Telezhnikov Committed by Commit Bot

aw: Enable SkiaRenderer with VizForWebView

There is few dependencies between features:
VizForWebView requires UseSkiaRenderer and UseSkiaForGLReadback.
UseSkiaRenderer requires EnableSharedImageForWebview.

Previously we enforced dependencies in AwMainDelegate which involves
changing of command line arguments and has two problems:
1. Finch experiments are not initialized yet at that moment, so they
   have to enable four features instead of one.
2. Command line overrides finch trials flags.

This CL changes how we check for features to enforce all dependencies.

Bug: 805739
Change-Id: I34f823640f355637ea0b27d1dec1b5afc3e9bec4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2067349Reviewed-by: default avatarBo <boliu@chromium.org>
Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745270}
parent 8a901618
...@@ -182,11 +182,7 @@ bool AwMainDelegate::BasicStartupComplete(int* exit_code) { ...@@ -182,11 +182,7 @@ bool AwMainDelegate::BasicStartupComplete(int* exit_code) {
// so we can't use FeatureList::IsEnabled. This is necessary if someone // so we can't use FeatureList::IsEnabled. This is necessary if someone
// enabled feature through command line. Finch experiments will need to set // enabled feature through command line. Finch experiments will need to set
// all flags in trial config. // all flags in trial config.
if (features.IsEnabled(::features::kVizForWebView)) { if (!features.IsEnabled(::features::kVizForWebView)) {
features.EnableIfNotSet(::features::kEnableSharedImageForWebview);
features.EnableIfNotSet(::features::kUseSkiaForGLReadback);
features.EnableIfNotSet(::features::kUseSkiaRenderer);
} else {
// Viz for WebView is required to support embedding CompositorFrameSinks // Viz for WebView is required to support embedding CompositorFrameSinks
// which is needed for UseSurfaceLayerForVideo feature. // which is needed for UseSurfaceLayerForVideo feature.
// https://crbug.com/853832 // https://crbug.com/853832
......
...@@ -72,6 +72,10 @@ bool IsVizHitTestingDebugEnabled() { ...@@ -72,6 +72,10 @@ bool IsVizHitTestingDebugEnabled() {
} }
bool IsUsingSkiaForGLReadback() { bool IsUsingSkiaForGLReadback() {
// Viz for webview requires Skia Readback.
if (IsUsingVizForWebView())
return true;
return base::FeatureList::IsEnabled(kUseSkiaForGLReadback); return base::FeatureList::IsEnabled(kUseSkiaForGLReadback);
} }
...@@ -84,6 +88,10 @@ bool IsUsingSkiaRenderer() { ...@@ -84,6 +88,10 @@ bool IsUsingSkiaRenderer() {
return false; return false;
#endif #endif
// Viz for webview requires SkiaRenderer.
if (IsUsingVizForWebView())
return true;
return base::FeatureList::IsEnabled(kUseSkiaRenderer) || return base::FeatureList::IsEnabled(kUseSkiaRenderer) ||
base::FeatureList::IsEnabled(kVulkan); base::FeatureList::IsEnabled(kVulkan);
} }
...@@ -100,6 +108,10 @@ bool IsDynamicColorGamutEnabled() { ...@@ -100,6 +108,10 @@ bool IsDynamicColorGamutEnabled() {
#endif #endif
bool IsUsingVizForWebView() { bool IsUsingVizForWebView() {
// Viz for WebView requires shared images to be enabled.
if (!base::FeatureList::IsEnabled(kEnableSharedImageForWebview))
return false;
return base::FeatureList::IsEnabled(kVizForWebView); return base::FeatureList::IsEnabled(kVizForWebView);
} }
......
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