Commit af620374 authored by Nate Fischer's avatar Nate Fischer Committed by Commit Bot

Android: autogenerate Java GpuFeatures

No change to logic. This autogenerates GpuFeatures.java from the c++
feature definitions using java_cpp_features. This updates
ProductionSupportedFlagList to depend on the new constant.

This rewrites some feature definitions to conform to java_cpp_features's
supported syntaxes.

Fixed: 1132502
Test: autoninja -C out/Default system_webview_apk
Change-Id: I9a5b562e7b034d5ed8606bff8dd218ca2d5e0790
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2432195
Commit-Queue: Nate Fischer <ntfschr@chromium.org>
Auto-Submit: Nate Fischer <ntfschr@chromium.org>
Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813049}
parent 69808eef
...@@ -7,6 +7,7 @@ package org.chromium.android_webview.common; ...@@ -7,6 +7,7 @@ package org.chromium.android_webview.common;
import org.chromium.base.BaseSwitches; import org.chromium.base.BaseSwitches;
import org.chromium.cc.base.CcSwitches; import org.chromium.cc.base.CcSwitches;
import org.chromium.components.metrics.MetricsSwitches; import org.chromium.components.metrics.MetricsSwitches;
import org.chromium.gpu.config.GpuFeatures;
import org.chromium.gpu.config.GpuSwitches; import org.chromium.gpu.config.GpuSwitches;
/** /**
...@@ -64,7 +65,8 @@ public final class ProductionSupportedFlagList { ...@@ -64,7 +65,8 @@ public final class ProductionSupportedFlagList {
Flag.commandLine(GpuSwitches.IGNORE_GPU_BLOCKLIST, Flag.commandLine(GpuSwitches.IGNORE_GPU_BLOCKLIST,
"Overrides the built-in software rendering list and enables " "Overrides the built-in software rendering list and enables "
+ "GPU acceleration on unsupported device configurations."), + "GPU acceleration on unsupported device configurations."),
Flag.baseFeature("EnableSharedImageForWebview", "Enables shared images for WebView."), Flag.baseFeature(GpuFeatures.ENABLE_SHARED_IMAGE_FOR_WEBVIEW,
"Enables shared images for WebView."),
Flag.baseFeature("VizForWebView", "Enables Viz for WebView."), Flag.baseFeature("VizForWebView", "Enables Viz for WebView."),
Flag.baseFeature(AwFeatures.WEBVIEW_CONNECTIONLESS_SAFE_BROWSING, Flag.baseFeature(AwFeatures.WEBVIEW_CONNECTIONLESS_SAFE_BROWSING,
"Uses GooglePlayService's 'connectionless' APIs for Safe Browsing " "Uses GooglePlayService's 'connectionless' APIs for Safe Browsing "
......
...@@ -245,9 +245,19 @@ if (is_android) { ...@@ -245,9 +245,19 @@ if (is_android) {
template = "android/java/src/org/chromium/gpu/config/GpuSwitches.java.tmpl" template = "android/java/src/org/chromium/gpu/config/GpuSwitches.java.tmpl"
} }
java_cpp_features("java_features_srcjar") {
# External code should depend on ":config_java" instead.
visibility = [ ":*" ]
sources = [ "gpu_finch_features.cc" ]
template = "android/java/src/org/chromium/gpu/config/GpuFeatures.java.tmpl"
}
android_library("config_java") { android_library("config_java") {
# Right now, this only includes the Java switches. But if we need more Java # Right now, this only includes the Java switches/features. But if we need
# files, they should be added here as necessary. # more Java files, they should be added here as necessary.
srcjar_deps = [ ":java_switches_srcjar" ] srcjar_deps = [
":java_features_srcjar",
":java_switches_srcjar",
]
} }
} }
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.gpu.config;
/**
* Constants for the names of GPU Features.
*/
public final class GpuFeatures {{
{NATIVE_FEATURES}
// Prevent instantiation.
private GpuFeatures() {{}}
}}
...@@ -31,16 +31,17 @@ const base::Feature kAImageReader{"AImageReader", ...@@ -31,16 +31,17 @@ const base::Feature kAImageReader{"AImageReader",
// Enable GPU Rasterization by default. This can still be overridden by // Enable GPU Rasterization by default. This can still be overridden by
// --force-gpu-rasterization or --disable-gpu-rasterization. // --force-gpu-rasterization or --disable-gpu-rasterization.
#if defined(OS_MAC) || defined(OS_WIN) || defined(OS_CHROMEOS) || \
defined(OS_ANDROID) || defined(OS_FUCHSIA)
// DefaultEnableGpuRasterization has launched on Mac, Windows, ChromeOS, and // DefaultEnableGpuRasterization has launched on Mac, Windows, ChromeOS, and
// Android. // Android.
const base::Feature kDefaultEnableGpuRasterization{ const base::Feature kDefaultEnableGpuRasterization{
"DefaultEnableGpuRasterization", base::FEATURE_ENABLED_BY_DEFAULT}; "DefaultEnableGpuRasterization",
#if defined(OS_MAC) || defined(OS_WIN) || defined(OS_CHROMEOS) || \
defined(OS_ANDROID) || defined(OS_FUCHSIA)
base::FEATURE_ENABLED_BY_DEFAULT
#else #else
const base::Feature kDefaultEnableGpuRasterization{ base::FEATURE_DISABLED_BY_DEFAULT
"DefaultEnableGpuRasterization", base::FEATURE_DISABLED_BY_DEFAULT};
#endif #endif
};
// Enable out of process rasterization by default. This can still be overridden // Enable out of process rasterization by default. This can still be overridden
// by --disable-oop-rasterization. // by --disable-oop-rasterization.
...@@ -54,13 +55,14 @@ const base::Feature kGpuProcessHighPriorityWin{ ...@@ -54,13 +55,14 @@ const base::Feature kGpuProcessHighPriorityWin{
#endif #endif
// Use ThreadPriority::DISPLAY for GPU main, viz compositor and IO threads. // Use ThreadPriority::DISPLAY for GPU main, viz compositor and IO threads.
#if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(OS_WIN)
const base::Feature kGpuUseDisplayThreadPriority{ const base::Feature kGpuUseDisplayThreadPriority{
"GpuUseDisplayThreadPriority", base::FEATURE_ENABLED_BY_DEFAULT}; "GpuUseDisplayThreadPriority",
#if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(OS_WIN)
base::FEATURE_ENABLED_BY_DEFAULT
#else #else
const base::Feature kGpuUseDisplayThreadPriority{ base::FEATURE_DISABLED_BY_DEFAULT
"GpuUseDisplayThreadPriority", base::FEATURE_DISABLED_BY_DEFAULT};
#endif #endif
};
// Gpu watchdog V2 to simplify the logic and reduce GPU hangs // Gpu watchdog V2 to simplify the logic and reduce GPU hangs
const base::Feature kGpuWatchdogV2{"GpuWatchdogV2", const base::Feature kGpuWatchdogV2{"GpuWatchdogV2",
......
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