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;
import org.chromium.base.BaseSwitches;
import org.chromium.cc.base.CcSwitches;
import org.chromium.components.metrics.MetricsSwitches;
import org.chromium.gpu.config.GpuFeatures;
import org.chromium.gpu.config.GpuSwitches;
/**
......@@ -64,7 +65,8 @@ public final class ProductionSupportedFlagList {
Flag.commandLine(GpuSwitches.IGNORE_GPU_BLOCKLIST,
"Overrides the built-in software rendering list and enables "
+ "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(AwFeatures.WEBVIEW_CONNECTIONLESS_SAFE_BROWSING,
"Uses GooglePlayService's 'connectionless' APIs for Safe Browsing "
......
......@@ -245,9 +245,19 @@ if (is_android) {
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") {
# Right now, this only includes the Java switches. But if we need more Java
# files, they should be added here as necessary.
srcjar_deps = [ ":java_switches_srcjar" ]
# Right now, this only includes the Java switches/features. But if we need
# more Java files, they should be added here as necessary.
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",
// Enable GPU Rasterization by default. This can still be overridden by
// --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
// Android.
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
const base::Feature kDefaultEnableGpuRasterization{
"DefaultEnableGpuRasterization", base::FEATURE_DISABLED_BY_DEFAULT};
base::FEATURE_DISABLED_BY_DEFAULT
#endif
};
// Enable out of process rasterization by default. This can still be overridden
// by --disable-oop-rasterization.
......@@ -54,13 +55,14 @@ const base::Feature kGpuProcessHighPriorityWin{
#endif
// 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{
"GpuUseDisplayThreadPriority", base::FEATURE_ENABLED_BY_DEFAULT};
"GpuUseDisplayThreadPriority",
#if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(OS_WIN)
base::FEATURE_ENABLED_BY_DEFAULT
#else
const base::Feature kGpuUseDisplayThreadPriority{
"GpuUseDisplayThreadPriority", base::FEATURE_DISABLED_BY_DEFAULT};
base::FEATURE_DISABLED_BY_DEFAULT
#endif
};
// Gpu watchdog V2 to simplify the logic and reduce GPU hangs
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