0

Add about:flags to enable/disable SurfaceControl.

Add a gpu finch feature flag and about:flags to enable/disable Android
SurfaceControl.
This gives us ability to enable/disable SurfaceControl via about:flags
on production chrome builds.

Bug: 1114874
Change-Id: Id63a3e770253659b015585fa6a34094164a2ebd7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2355556
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Khushal <khushalsagar@chromium.org>
Commit-Queue: vikas soni <vikassoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#798427}
This commit is contained in:
Vikas Soni
2020-08-15 06:17:22 +00:00
committed by Commit Bot
parent 8067bb7dae
commit f14e32c331
7 changed files with 28 additions and 11 deletions

@@ -220,7 +220,8 @@ bool AwMainDelegate::BasicStartupComplete(int* exit_code) {
features.DisableIfNotSet(::features::kBackgroundFetch);
features.EnableIfNotSet(::features::kDisableSurfaceControlForWebview);
// SurfaceControl is not supported on webview.
features.DisableIfNotSet(::features::kAndroidSurfaceControl);
// TODO(https://crbug.com/963653): SmsReceiver is not yet supported on
// WebView.

@@ -6298,6 +6298,10 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kCpuAffinityRestrictToLittleCoresDescription,
kOsAndroid,
FEATURE_VALUE_TYPE(features::kCpuAffinityRestrictToLittleCores)},
{"enable-surface-control", flag_descriptions::kAndroidSurfaceControlName,
flag_descriptions::kAndroidSurfaceControlDescription, kOsAndroid,
FEATURE_VALUE_TYPE(features::kAndroidSurfaceControl)},
#endif // OS_ANDROID
#if defined(OS_ANDROID)

@@ -2093,6 +2093,11 @@
"owners": [ "fhorschig" ],
"expiry_milestone": 87
},
{
"name": "enable-surface-control",
"owners": [ "vikassoni", "khushalsagar" ],
"expiry_milestone": 90
},
{
"name": "enable-sxg-prefetch-cache-for-navigations",
"owners": [ "horo", "//content/browser/web_package/OWNERS" ],

@@ -2566,6 +2566,11 @@ const char kAndroidMultipleDisplayName[] = "Multiple Display";
const char kAndroidMultipleDisplayDescription[] =
"When enabled, tabs can be moved to the secondary display.";
const char kAndroidSurfaceControlName[] = "Android SurfaceControl";
const char kAndroidSurfaceControlDescription[] =
" Enables SurfaceControl to "
" manage the buffer queue for the DisplayCompositor on Android.";
const char kAppNotificationStatusMessagingName[] =
"App notification status messaging";
const char kAppNotificationStatusMessagingDescription[] =

@@ -1486,6 +1486,9 @@ extern const char kAndroidMultipleDisplayDescription[];
extern const char kAndroidPartnerCustomizationPhenotypeName[];
extern const char kAndroidPartnerCustomizationPhenotypeDescription[];
extern const char kAndroidSurfaceControlName[];
extern const char kAndroidSurfaceControlDescription[];
extern const char kAppNotificationStatusMessagingName[];
extern const char kAppNotificationStatusMessagingDescription[];

@@ -13,13 +13,15 @@
namespace features {
#if defined(OS_ANDROID)
// Used only by webview to disable SurfaceControl.
const base::Feature kDisableSurfaceControlForWebview{
"DisableSurfaceControlForWebview", base::FEATURE_DISABLED_BY_DEFAULT};
// Used to limit GL version to 2.0 for skia raster on Android.
const base::Feature kUseGles2ForOopR{"UseGles2ForOopR",
base::FEATURE_ENABLED_BY_DEFAULT};
// Use android SurfaceControl API for managing display compositor's buffer queue
// and using overlays on Android. Also used by webview to disable surface
// SurfaceControl.
const base::Feature kAndroidSurfaceControl{"AndroidSurfaceControl",
base::FEATURE_ENABLED_BY_DEFAULT};
#endif
// Enable GPU Rasterization by default. This can still be overridden by
@@ -118,10 +120,8 @@ const base::Feature kEnableSharedImageForWebview{
#if defined(OS_ANDROID)
bool IsAndroidSurfaceControlEnabled() {
if (base::FeatureList::IsEnabled(kDisableSurfaceControlForWebview))
return false;
return gl::SurfaceControl::IsSupported();
return base::FeatureList::IsEnabled(kAndroidSurfaceControl) &&
gl::SurfaceControl::IsSupported();
}
#endif

@@ -17,9 +17,8 @@ namespace features {
// All features in alphabetical order. The features should be documented
// alongside the definition of their values in the .cc file.
#if defined(OS_ANDROID)
GPU_EXPORT extern const base::Feature kDisableSurfaceControlForWebview;
GPU_EXPORT extern const base::Feature kUseGles2ForOopR;
GPU_EXPORT extern const base::Feature kAndroidSurfaceControl;
#endif // defined(OS_ANDROID)
GPU_EXPORT extern const base::Feature kDefaultEnableGpuRasterization;