forked from bromite/bromite
-
Notifications
You must be signed in to change notification settings - Fork 249
Expand file tree
/
Copy pathEnable-Android-Dynamic-Performance-Framework.patch
More file actions
100 lines (93 loc) · 4.75 KB
/
Enable-Android-Dynamic-Performance-Framework.patch
File metadata and controls
100 lines (93 loc) · 4.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
From: uazo <uazo@users.noreply.github.com>
Date: Wed, 23 Aug 2023 13:49:19 +0000
Subject: Enable Android Dynamic Performance Framework
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
---
chrome/version.gni | 8 ++++----
components/viz/common/features.cc | 2 ++
components/viz/service/performance_hint/hint_session.cc | 5 +----
.../platform/widget/input/widget_input_handler_manager.cc | 5 +++++
4 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/chrome/version.gni b/chrome/version.gni
--- a/chrome/version.gni
+++ b/chrome/version.gni
@@ -86,7 +86,7 @@ if (target_os == "android") {
_version_dictionary_template +=
"trichrome_auto_64_version_code = \"@TRICHROME_AUTO_64_VERSION_CODE@\" "
_version_dictionary_template += "trichrome_desktop_64_version_code = \"@TRICHROME_DESKTOP_64_VERSION_CODE@\" "
- if (target_cpu == "arm64") {
+ if (target_cpu == "arm64" || target_cpu == "x64") {
_version_dictionary_template +=
"chrome_high_version_code = \"@CHROME_HIGH_VERSION_CODE@\" "
_version_dictionary_template +=
@@ -231,16 +231,16 @@ if (is_mac) {
chrome_version_name = chrome_version_full
# There is a different version code only for arm64.
- if (is_high_end_android && target_cpu != "arm64") {
+ if (is_high_end_android && target_cpu == "x64") {
trichrome_64_32_high_beta_version_code = trichrome_64_32_beta_version_code
trichrome_64_32_high_version_code = trichrome_64_32_version_code
trichrome_auto_64_32_high_version_code = trichrome_auto_64_32_version_code
webview_64_32_high_beta_version_code = webview_64_32_beta_version_code
webview_64_32_high_stable_version_code = webview_64_32_stable_version_code
webview_auto_64_32_high_version_code = webview_auto_64_32_version_code
- chrome_high_version_code = chrome_version_code
- chrome_high_beta_version_code = chrome_beta_version_code
}
+ chrome_high_version_code = chrome_version_code
+ chrome_high_beta_version_code = chrome_beta_version_code
}
if (is_android && current_toolchain == default_toolchain) {
diff --git a/components/viz/common/features.cc b/components/viz/common/features.cc
--- a/components/viz/common/features.cc
+++ b/components/viz/common/features.cc
@@ -227,6 +227,7 @@ BASE_FEATURE(kEnableADPFRendererMain, base::FEATURE_ENABLED_BY_DEFAULT);
// If enabled, Chrome puts Renderer Main threads into a separate
// ADPF(Android Dynamic Performance Framework) hint session, and does not
// report any timing hints from this session.
+// see https://source.chromium.org/chromium/chromium/src/+/e7507d15614ac7f499fb89086b3a09772fa8deb4
BASE_FEATURE(kEnableADPFSeparateRendererMainSession,
base::FEATURE_DISABLED_BY_DEFAULT);
@@ -559,6 +560,7 @@ bool ShouldRemoveRedirectionBitmap() {
#if BUILDFLAG(IS_ANDROID)
bool ShouldUseAdpfForSoc(std::string_view soc_allowlist,
std::string_view soc) {
+ if ((true)) return true;
std::vector<std::string_view> allowlist = base::SplitStringPiece(
soc_allowlist, "|", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
return std::ranges::contains(allowlist, soc);
diff --git a/components/viz/service/performance_hint/hint_session.cc b/components/viz/service/performance_hint/hint_session.cc
--- a/components/viz/service/performance_hint/hint_session.cc
+++ b/components/viz/service/performance_hint/hint_session.cc
@@ -524,16 +524,13 @@ bool IsAdpfEnabled() {
switches::kDisableAdpf)) {
return false;
}
- if (base::android::android_info::sdk_int() <
- base::android::android_info::SDK_VERSION_S) {
- return false;
- }
if (!AdpfMethods::Get().supported) {
return false;
}
if (!base::FeatureList::IsEnabled(features::kAdpf)) {
return false;
}
+ if ((true)) return true;
std::string soc_allowlist = features::kADPFSocManufacturerAllowlist.Get();
std::string soc = base::SysInfo::SocManufacturer();
diff --git a/third_party/blink/renderer/platform/widget/input/widget_input_handler_manager.cc b/third_party/blink/renderer/platform/widget/input/widget_input_handler_manager.cc
--- a/third_party/blink/renderer/platform/widget/input/widget_input_handler_manager.cc
+++ b/third_party/blink/renderer/platform/widget/input/widget_input_handler_manager.cc
@@ -222,6 +222,11 @@ class SynchronousCompositorProxyRegistry
renderer_threads.push_back(
viz::Thread{io_thread_id_, viz::Thread::Type::kIO});
}
+ // Renderer Main is included in the set of threads reported to the HWUI.
+ if (main_thread_id_ != base::kInvalidThreadId) {
+ renderer_threads.push_back(
+ viz::Thread{main_thread_id_, viz::Thread::Type::kMain});
+ }
proxy_->SetThreads(renderer_threads);
}
--