summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeppia <seppia@seppio.fish>2020-05-12 12:28:49 +0200
committerSeppia <seppia@seppio.fish>2020-05-12 12:28:49 +0200
commit8c1ab2c72db9321a65bd7eee6989c5beeddf317b (patch)
treebc200432091958baa5399575e34effca587a7f41
parentb1a0c496ab10e13faaff3b6ff653e3364cf93613 (diff)
downloadungoogled-chromium-8c1ab2c72db9321a65bd7eee6989c5beeddf317b.tar.gz
ungoogled-chromium-8c1ab2c72db9321a65bd7eee6989c5beeddf317b.tar.bz2
ungoogled-chromium-8c1ab2c72db9321a65bd7eee6989c5beeddf317b.zip
Updated PKGBUILD to reflect upstream changes
-rw-r--r--.SRCINFO24
-rw-r--r--PKGBUILD104
-rw-r--r--chromium-drirc-disable-10bpc-color-configs.conf15
-rw-r--r--chromium-skia-harmony.patch14
-rw-r--r--chromium-widevine.patch13
-rw-r--r--clean-up-a-call-to-set_utf8.patch34
-rw-r--r--eglGetMscRateCHROMIUM.patch604
-rw-r--r--flags.archlinux.gn32
-rw-r--r--icu67.patch169
-rw-r--r--rebuild-Linux-frame-button-cache-when-activation.patch62
-rw-r--r--rename-Relayout-in-DesktopWindowTreeHostPlatform.patch64
-rw-r--r--vaapi-build-fix.patch51
-rw-r--r--vdpau-support.patch74
13 files changed, 1234 insertions, 26 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 9d3a1bb..54d70bb 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -64,11 +64,31 @@ pkgbase = ungoogled-chromium
source = https://commondatastorage.googleapis.com/chromium-browser-official/chromium-81.0.4044.138.tar.xz
source = chromium-launcher-6.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v6.tar.gz
source = https://github.com/Eloston/ungoogled-chromium/archive/81.0.4044.138-1.tar.gz
- source = https://github.com/ungoogled-software/ungoogled-chromium-archlinux/archive/7356fdd4d45890afa748888fd3533c3f5e49b08e.tar.gz
+ source = rename-Relayout-in-DesktopWindowTreeHostPlatform.patch
+ source = rebuild-Linux-frame-button-cache-when-activation.patch
+ source = clean-up-a-call-to-set_utf8.patch
+ source = icu67.patch
+ source = chromium-widevine.patch
+ source = chromium-skia-harmony.patch
+ source = flags.archlinux.gn
+ source = chromium-drirc-disable-10bpc-color-configs.conf
+ source = vdpau-support.patch
+ source = vaapi-build-fix.patch
+ source = eglGetMscRateCHROMIUM.patch
sha256sums = f478f28b8111cb70231df4c36e754d812ad7a94b7c844e9d0515345a71fd77a6
sha256sums = 04917e3cd4307d8e31bfb0027a5dce6d086edb10ff8a716024fbb8bb0c7dccf1
sha256sums = a01a35454dcd3c789e4e536751ecd655959b544b56ffd241a7942d9912749da1
- sha256sums = b8d6a63fc93e010276ca039c4141b1a05029841b3e218afaf9462645470e407e
+ sha256sums = ae3bf107834bd8eda9a3ec7899fe35fde62e6111062e5def7d24bf49b53db3db
+ sha256sums = 46f7fc9768730c460b27681ccf3dc2685c7e1fd22d70d3a82d9e57e3389bb014
+ sha256sums = 58c41713eb6fb33b6eef120f4324fa1fb8123b1fbc4ecbe5662f1f9779b9b6af
+ sha256sums = 5315977307e69d20b3e856d3f8724835b08e02085a4444a5c5cefea83fd7d006
+ sha256sums = 709e2fddba3c1f2ed4deb3a239fc0479bfa50c46e054e7f32db4fb1365fed070
+ sha256sums = 771292942c0901092a402cc60ee883877a99fb804cb54d568c8c6c94565a48e1
+ sha256sums = 24ada570fdac8156ce91ee790a860b2cac7689da8b4fb5cfadc59f1f8df7e658
+ sha256sums = babda4f5c1179825797496898d77334ac067149cac03d797ab27ac69671a7feb
+ sha256sums = 0ec6ee49113cc8cc5036fa008519b94137df6987bf1f9fbffb2d42d298af868a
+ sha256sums = fad5e678d62de0e45db1c2aa871628fdc981f78c26392c1dccc457082906a350
+ sha256sums = 1dd330409094dc4bf393f00a51961a983360ccf99affd4f97a61d885129d326e
pkgname = ungoogled-chromium
diff --git a/PKGBUILD b/PKGBUILD
index 7f7431c..33f4a8d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,10 +3,12 @@
# Derived from official Chromium and Inox PKGBUILDS and ungoogled-chromium buildkit
pkgname=ungoogled-chromium
-pkgver=81.0.4044.138
-_rev=1
-_archver=7356fdd4d45890afa748888fd3533c3f5e49b08e
-pkgrel=${_rev}
+# Commit or tag for the upstream ungoogled-chromium repo
+_ungoogled_version='81.0.4044.138-1'
+_chromium_version=${_ungoogled_version%-*}
+_ungoogled_revision=${_ungoogled_version#*-}
+pkgver=${_chromium_version}
+pkgrel=$_ungoogled_revision
_launcher_ver=6
pkgdesc="A lightweight approach to removing Google web service dependency"
arch=('x86_64')
@@ -24,16 +26,36 @@ optdepends=('pepper-flash: support for Flash content'
'libva-intel-driver: for hardware video acceleration with Intel GPUs'
'libva-mesa-driver: for hardware video acceleration with AMD/ATI GPUs'
'libva-vdpau-driver: for hardware video acceleration with NVIDIA GPUs')
-provides=('chromium')
-conflicts=('chromium')
-source=(https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$pkgver.tar.xz
+source=(https://commondatastorage.googleapis.com/chromium-browser-official/chromium-${_chromium_version}.tar.xz
chromium-launcher-$_launcher_ver.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v$_launcher_ver.tar.gz
- https://github.com/Eloston/ungoogled-chromium/archive/$pkgver-$pkgrel.tar.gz
- https://github.com/ungoogled-software/ungoogled-chromium-archlinux/archive/${_archver}.tar.gz)
+ https://github.com/Eloston/ungoogled-chromium/archive/$_ungoogled_version.tar.gz
+ rename-Relayout-in-DesktopWindowTreeHostPlatform.patch
+ rebuild-Linux-frame-button-cache-when-activation.patch
+ clean-up-a-call-to-set_utf8.patch
+ icu67.patch
+ chromium-widevine.patch
+ chromium-skia-harmony.patch
+ flags.archlinux.gn
+ chromium-drirc-disable-10bpc-color-configs.conf
+ vdpau-support.patch
+ vaapi-build-fix.patch
+ eglGetMscRateCHROMIUM.patch)
sha256sums=('f478f28b8111cb70231df4c36e754d812ad7a94b7c844e9d0515345a71fd77a6'
'04917e3cd4307d8e31bfb0027a5dce6d086edb10ff8a716024fbb8bb0c7dccf1'
'a01a35454dcd3c789e4e536751ecd655959b544b56ffd241a7942d9912749da1'
- 'b8d6a63fc93e010276ca039c4141b1a05029841b3e218afaf9462645470e407e')
+ 'ae3bf107834bd8eda9a3ec7899fe35fde62e6111062e5def7d24bf49b53db3db'
+ '46f7fc9768730c460b27681ccf3dc2685c7e1fd22d70d3a82d9e57e3389bb014'
+ '58c41713eb6fb33b6eef120f4324fa1fb8123b1fbc4ecbe5662f1f9779b9b6af'
+ '5315977307e69d20b3e856d3f8724835b08e02085a4444a5c5cefea83fd7d006'
+ '709e2fddba3c1f2ed4deb3a239fc0479bfa50c46e054e7f32db4fb1365fed070'
+ '771292942c0901092a402cc60ee883877a99fb804cb54d568c8c6c94565a48e1'
+ '24ada570fdac8156ce91ee790a860b2cac7689da8b4fb5cfadc59f1f8df7e658'
+ 'babda4f5c1179825797496898d77334ac067149cac03d797ab27ac69671a7feb'
+ '0ec6ee49113cc8cc5036fa008519b94137df6987bf1f9fbffb2d42d298af868a'
+ 'fad5e678d62de0e45db1c2aa871628fdc981f78c26392c1dccc457082906a350'
+ '1dd330409094dc4bf393f00a51961a983360ccf99affd4f97a61d885129d326e')
+provides=('chromium')
+conflicts=('chromium')
# Possible replacements are listed in build/linux/unbundle/replace_gn_files.py
# Keys are the names in the above script; values are the dependencies in Arch
@@ -47,7 +69,7 @@ declare -gA _system_libs=(
[libdrm]=
[libevent]=libevent
[libjpeg]=libjpeg
- #[libpng]=libpng # https://crbug.com/752403#c10
+ #[libpng]=libpng # https://crbug.com/752403#c10
[libvpx]=libvpx
[libwebp]=libwebp
[libxml]=libxml2
@@ -65,16 +87,50 @@ _unwanted_bundled_libs=(
depends+=(${_system_libs[@]})
prepare() {
- _ungoogled_archlinux_repo="$srcdir/$pkgname-archlinux-${_archver}"
- _ungoogled_repo="$srcdir/$pkgname-$pkgver-$pkgrel"
- _utils="${_ungoogled_repo}/utils"
+ cd "$srcdir/chromium-${_chromium_version}"
+
+ # Allow building against system libraries in official builds
+ sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
+ tools/generate_shim_headers/generate_shim_headers.py
+
+ # https://crbug.com/893950
+ sed -i -e 's/\<xmlMalloc\>/malloc/' -e 's/\<xmlFree\>/free/' \
+ third_party/blink/renderer/core/xml/*.cc \
+ third_party/blink/renderer/core/xml/parser/xml_document_parser.cc \
+ third_party/libxml/chromium/*.cc
+
+ # https://crbug.com/1049258
+ patch -Np1 -i ../rename-Relayout-in-DesktopWindowTreeHostPlatform.patch
+ patch -Np1 -i ../rebuild-Linux-frame-button-cache-when-activation.patch
+
+ # https://chromium-review.googlesource.com/c/chromium/src/+/2145261
+ patch -Np1 -i ../clean-up-a-call-to-set_utf8.patch
- cd "$srcdir/chromium-$pkgver"
+ # https://crbug.com/v8/10393
+ patch -Np3 -d v8 <../icu67.patch
+
+ # Load bundled Widevine CDM if available (see chromium-widevine in the AUR)
+ # M79 is supposed to download it as a component but it doesn't seem to work
+ patch -Np1 -i ../chromium-widevine.patch
+
+ # https://crbug.com/skia/6663#c10
+ patch -Np0 -i ../chromium-skia-harmony.patch
+
+ # Fix VA-API on Nvidia
+ patch -Np1 -i ../vdpau-support.patch
+
+ # Fix VAAPI build on chromium 81+
+ patch -Np1 -i ../vaapi-build-fix.patch
+
+ # https://bugs.chromium.org/p/chromium/issues/detail?id=1064078
+ patch -Np1 -i ../eglGetMscRateCHROMIUM.patch
msg2 'Pruning binaries'
+ _ungoogled_repo="$srcdir/$pkgname-${_ungoogled_version}"
+ _utils="${_ungoogled_repo}/utils"
python "$_utils/prune_binaries.py" ./ "$_ungoogled_repo/pruning.list"
msg2 'Applying patches'
- python "$_utils/patches.py" apply ./ "$_ungoogled_repo/patches" "$_ungoogled_archlinux_repo/patches"
+ python "$_utils/patches.py" apply ./ "$_ungoogled_repo/patches"
msg2 'Applying domain substitution'
python "$_utils/domain_substitution.py" apply -r "$_ungoogled_repo/domain_regex.list" -f "$_ungoogled_repo/domain_substitution.list" -c domainsubcache.tar.gz ./
@@ -105,12 +161,9 @@ prepare() {
}
build() {
- _ungoogled_archlinux_repo="$srcdir/$pkgname-archlinux-${_archver}"
- _ungoogled_repo="$srcdir/$pkgname-$pkgver-$pkgrel"
-
make -C chromium-launcher-$_launcher_ver
- cd "$srcdir/chromium-$pkgver"
+ cd "$srcdir/chromium-${_chromium_version}"
if check_buildoption ccache y; then
# Avoid falling back to preprocessor mode when sources contain time macros
@@ -122,12 +175,12 @@ build() {
export AR=llvm-ar
export NM=llvm-nm
+ _ungoogled_repo="$srcdir/$pkgname-${_ungoogled_version}"
mkdir -p out/Default
-
# Assemble GN flags
cp "$_ungoogled_repo/flags.gn" "out/Default/args.gn"
printf '\n' >> "out/Default/args.gn"
- cat "$_ungoogled_archlinux_repo/flags.archlinux.gn" >> "out/Default/args.gn"
+ cat "$srcdir/flags.archlinux.gn" >> "out/Default/args.gn"
# Facilitate deterministic builds (taken from build/config/compiler/BUILD.gn)
CFLAGS+=' -Wno-builtin-macro-redefined'
@@ -150,7 +203,10 @@ package() {
install -Dm644 LICENSE \
"$pkgdir/usr/share/licenses/chromium/LICENSE.launcher"
- cd "$srcdir/chromium-$pkgver"
+ cd "$srcdir/chromium-${_chromium_version}"
+
+ install -Dm644 ../chromium-drirc-disable-10bpc-color-configs.conf \
+ "$pkgdir/usr/share/drirc.d/10-$pkgname.conf"
install -D out/Default/chrome "$pkgdir/usr/lib/chromium/chromium"
install -Dm4755 out/Default/chrome_sandbox "$pkgdir/usr/lib/chromium/chrome-sandbox"
@@ -190,4 +246,4 @@ package() {
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/chromium/LICENSE"
}
-# vim:set ts=2 sw=2 et:
+# vim:set ts=2 sw=2 et ft=sh:
diff --git a/chromium-drirc-disable-10bpc-color-configs.conf b/chromium-drirc-disable-10bpc-color-configs.conf
new file mode 100644
index 0000000..ef836b3
--- /dev/null
+++ b/chromium-drirc-disable-10bpc-color-configs.conf
@@ -0,0 +1,15 @@
+<!--
+
+Disable 10 bpc color configs; fixes VAAPI playback.
+
+https://bugs.freedesktop.org/show_bug.cgi?id=106490
+
+-->
+
+<driconf>
+ <device>
+ <application name="Chromium" executable="chromium">
+ <option name="allow_rgb10_configs" value="false" />
+ </application>
+ </device>
+</driconf>
diff --git a/chromium-skia-harmony.patch b/chromium-skia-harmony.patch
new file mode 100644
index 0000000..c96d07e
--- /dev/null
+++ b/chromium-skia-harmony.patch
@@ -0,0 +1,14 @@
+--- third_party/skia/src/ports/SkFontHost_FreeType.cpp.orig 2019-07-19 11:08:34.770972665 +0000
++++ third_party/skia/src/ports/SkFontHost_FreeType.cpp 2019-07-19 11:08:44.274442065 +0000
+@@ -128,9 +128,9 @@ public:
+ : fGetVarDesignCoordinates(nullptr)
+ , fGetVarAxisFlags(nullptr)
+ , fLibrary(nullptr)
+- , fIsLCDSupported(false)
++ , fIsLCDSupported(true)
+ , fLightHintingIsYOnly(false)
+- , fLCDExtra(0)
++ , fLCDExtra(2)
+ {
+ if (FT_New_Library(&gFTMemory, &fLibrary)) {
+ return;
diff --git a/chromium-widevine.patch b/chromium-widevine.patch
new file mode 100644
index 0000000..32f0ae2
--- /dev/null
+++ b/chromium-widevine.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/widevine/cdm/BUILD.gn b/third_party/widevine/cdm/BUILD.gn
+index ed0e2f5208b..5b431a030d5 100644
+--- a/third_party/widevine/cdm/BUILD.gn
++++ b/third_party/widevine/cdm/BUILD.gn
+@@ -14,7 +14,7 @@ buildflag_header("buildflags") {
+
+ flags = [
+ "ENABLE_WIDEVINE=$enable_widevine",
+- "BUNDLE_WIDEVINE_CDM=$bundle_widevine_cdm",
++ "BUNDLE_WIDEVINE_CDM=true",
+ "ENABLE_WIDEVINE_CDM_COMPONENT=$enable_widevine_cdm_component",
+ ]
+ }
diff --git a/clean-up-a-call-to-set_utf8.patch b/clean-up-a-call-to-set_utf8.patch
new file mode 100644
index 0000000..01384c0
--- /dev/null
+++ b/clean-up-a-call-to-set_utf8.patch
@@ -0,0 +1,34 @@
+From ede390a0b18e4565abf8ac1e1ff717e1d43fc320 Mon Sep 17 00:00:00 2001
+From: Paul Wankadia <junyer@chromium.org>
+Date: Tue, 14 Apr 2020 16:54:51 +0000
+Subject: [PATCH] Clean up a call to set_utf8().
+
+This is part of an effort to rewrite calls to utf8() and set_utf8()
+(in RE2::Options) as calls to encoding() and set_encoding(),
+respectively. utf8() and set_utf8() have been marked as the "legacy"
+interface since 2008, so it is long past time that we get rid of them.
+
+R=parastoog@google.com
+
+Change-Id: I62c48cd575a55b519d5264ed857f927c163068b2
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2145261
+Reviewed-by: Parastoo Geranmayeh <parastoog@google.com>
+Commit-Queue: Paul Wankadia <junyer@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#758886}
+---
+ components/autofill/core/browser/address_rewriter.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/components/autofill/core/browser/address_rewriter.cc b/components/autofill/core/browser/address_rewriter.cc
+index 1b85a50974c..030a5aba146 100644
+--- a/components/autofill/core/browser/address_rewriter.cc
++++ b/components/autofill/core/browser/address_rewriter.cc
+@@ -57,7 +57,7 @@ void CompileRulesFromData(const std::string& data_string,
+ CompiledRuleVector* compiled_rules) {
+ base::StringPiece data = data_string;
+ re2::RE2::Options options;
+- options.set_utf8(true);
++ options.set_encoding(RE2::Options::EncodingUTF8);
+ options.set_word_boundary(true);
+
+ size_t token_end = 0;
diff --git a/eglGetMscRateCHROMIUM.patch b/eglGetMscRateCHROMIUM.patch
new file mode 100644
index 0000000..0755763
--- /dev/null
+++ b/eglGetMscRateCHROMIUM.patch
@@ -0,0 +1,604 @@
+From 5cddfb828ddd82fc741549d5ee44cd9b94bd97f5 Mon Sep 17 00:00:00 2001
+From: Jonah Ryan-Davis <jonahr@google.com>
+Date: Mon, 30 Mar 2020 17:13:54 +0000
+Subject: [PATCH] Use EGL_ANGLE_sync_control_rate for eglGetMscRate call
+
+eglGetMscRateCHROMIUM is not universally supported, so we will
+switch to using the ANGLE version of the extension instead.
+
+Bug: chromium:1064078
+Change-Id: Ic57e2e55230df1d1c2c584e1cbf54331330a0b87
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2120453
+Reviewed-by: Zhenyao Mo <zmo@chromium.org>
+Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
+Cr-Commit-Position: refs/heads/master@{#754518}
+---
+
+diff --git a/gpu/GLES2/extensions/ANGLE/EGL_ANGLE_sync_control_rate.txt b/gpu/GLES2/extensions/ANGLE/EGL_ANGLE_sync_control_rate.txt
+new file mode 100644
+index 0000000..2056ae8
+--- /dev/null
++++ b/gpu/GLES2/extensions/ANGLE/EGL_ANGLE_sync_control_rate.txt
+@@ -0,0 +1,110 @@
++Name
++
++ ANGLE_sync_control_rate
++
++Name Strings
++
++ EGL_ANGLE_sync_control_rate
++
++Contact
++
++ Jonah Ryan-Davis, Google (jonahr 'at' google.com)
++
++Status
++
++ Draft.
++
++Version
++
++ Version 1, 2020-03-24
++
++ Based on GLX_OML_sync_control Revision 6.0
++
++Number
++
++ ???
++
++Dependencies
++
++ The extension is written against the EGL 1.2 Specification, although it
++ should work on other versions of these specifications. This extension
++ also requires an operating system which supports CLOCK_MONOTONIC.
++
++Overview
++
++ This extension provides counters which let applications know about the
++ timing of the last vertical retrace. By looking at the system clock, as
++ well as the refresh rate of the monitor, this should enable applications
++ to predict the position of future retraces so as to schedule an optimal
++ workload.
++
++ This extension incorporates the use of three counters that provide
++ the necessary synchronization. The Unadjusted System Time (or UST)
++ is the 64-bit CLOCK_MONOTONIC clock; in particular this lets the
++ application schedule future vertical retraces by querying this clock.
++ The graphics Media Stream Counter (or graphics MSC) is a counter
++ that is unique to the graphics subsystem and increments for each
++ vertical retrace that occurs. The Swap Buffer Counter (SBC) is an
++ attribute of an EGLSurface and is incremented each time a swap
++ buffer action is performed on the associated surface.
++
++ The use of these three counters allows the application to
++ synchronize graphics rendering to vertical retraces and/or swap
++ buffer actions. For example, by querying the synchronization values for
++ a given surface, the application can accurately predict the timing for
++ the next vertical retraces and schedule rendering accordingly.
++
++Issues
++
++ None.
++
++IP Status
++
++ No known issues.
++
++New Procedures and Functions
++
++ Bool eglGetMscRateANGLE(EGLDisplay* dpy,
++ EGLSurface surface,
++ int32_t* numerator,
++ int32_t* denominator)
++
++New Tokens
++
++ None
++
++Additions to the EGL 1.3 Specification
++
++ The graphics MSC value is incremented once for each screen refresh.
++ For a non-interlaced display, this means that the graphics MSC value
++ is incremented for each frame. For an interlaced display, it means
++ that it will be incremented for each field. For a multi-monitor
++ system, the monitor used to determine MSC is the one where the surface
++ is located. If the surface spans multiple monitors, the monitor used
++ to determine MSC is the one with the biggest coverage in pixels.
++
++ eglGetMscRateANGLE returns the rate at which the MSC will be incremented
++ for the display associated with <hdc>. The rate is expressed in Hertz
++ as <numerator> / <denominator>. If the MSC rate in Hertz is an
++ integer, then <denominator> will be 1 and <numerator> will be
++ the MSC rate.
++
++ The function eglGetMscRateANGLE will return TRUE if the function
++ completed successfully, FALSE otherwise.
++
++ Each time eglSwapBuffer succeeds, the SBC will be increased within a
++ finite time period.
++
++Errors
++
++ The function eglGetMscRateANGLE will return FALSE if there is no
++ current EGLContext.
++
++New Implementation Dependent State
++
++ None
++
++Revision History
++
++ Version 1, 2020-03-24 (Jonah Ryan-Davis)
++ - Initial draft, based on GLX_OML_sync_control revision 6.0.
+diff --git a/gpu/GLES2/extensions/CHROMIUM/EGL_CHROMIUM_sync_control.txt b/gpu/GLES2/extensions/CHROMIUM/EGL_CHROMIUM_sync_control.txt
+index 14f4e56..f699f61 100644
+--- a/gpu/GLES2/extensions/CHROMIUM/EGL_CHROMIUM_sync_control.txt
++++ b/gpu/GLES2/extensions/CHROMIUM/EGL_CHROMIUM_sync_control.txt
+@@ -16,7 +16,7 @@
+
+ Version
+
+- Version 3, 2020-01-23
++ Version 2, 2015-05-05
+
+ Based on GLX_OML_sync_control Revision 6.0
+
+@@ -70,12 +70,6 @@
+ int64_t* msc,
+ int64_t* sbc)
+
+- Bool eglGetMscRateCHROMIUM(EGLDisplay* dpy,
+- EGLSurface surface,
+- int32_t* numerator,
+- int32_t* denominator)
+-
+-
+ New Tokens
+
+ None
+@@ -112,22 +106,16 @@
+ is located. If the surface spans multiple monitors, the monitor used
+ to determine MSC is the one with the biggest coverage in pixels.
+
+- eglGetMscRateCHROMIUM returns the rate at which the MSC will be incremented
+- for the display associated with <hdc>. The rate is expressed in Hertz
+- as <numerator> / <denominator>. If the MSC rate in Hertz is an
+- integer, then <denominator> will be 1 and <numerator> will be
+- the MSC rate.
+-
+- The functions eglGetSyncValuesCHROMIUM, and eglGetMscRateCHROMIUM will
+- return TRUE if the function completed successfully, FALSE otherwise.
++ The function eglGetSyncValuesCHROMIUM will return TRUE if the function
++ completed successfully, FALSE otherwise.
+
+ Each time eglSwapBuffer succeeds, the SBC will be increased within a
+ finite time period.
+
+ Errors
+
+- The functions eglGetSyncValuesCHROMIUM, and eglGetMscRateCHROMIUM will
+- return FALSE if there is no current EGLContext.
++ The function eglGetSyncValuesCHROMIUM will return FALSE if there is no
++ current EGLContext.
+
+
+ New State
+@@ -144,10 +132,6 @@
+
+ Revision History
+
+- Version 3, 2020-01-23 (Jonah Ryan-Davis)
+- - Add the function eglGetMscRateCHROMIUM based on glXGetMscRateOML from
+- GLX_OML_sync_control revision 6.0.
+-
+ Version 2, 2015-05-05 (Chad Versace)
+ - Rename to EGL_CHROMIUM_sync_control from EGL_CHROMIUM_get_sync_values.
+ EGL_CHROMIUM_sync_control is the de facto extension name because all
+diff --git a/ui/gl/EGL/eglextchromium.h b/ui/gl/EGL/eglextchromium.h
+index e66d34a..22e3cf0 100644
+--- a/ui/gl/EGL/eglextchromium.h
++++ b/ui/gl/EGL/eglextchromium.h
+@@ -22,21 +22,26 @@
+ EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncValuesCHROMIUM(
+ EGLDisplay dpy, EGLSurface surface, EGLuint64CHROMIUM *ust,
+ EGLuint64CHROMIUM *msc, EGLuint64CHROMIUM *sbc);
+-EGLAPI EGLBoolean EGLAPIENTRY eglGetMscRateCHROMIUM(EGLDisplay dpy,
+- EGLSurface surface,
+- EGLint* numerator,
+- EGLint* denominator);
+ #endif /* EGL_EGLEXT_PROTOTYPES */
+ typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCVALUESCHROMIUMPROC)
+ (EGLDisplay dpy, EGLSurface surface, EGLuint64CHROMIUM *ust,
+ EGLuint64CHROMIUM *msc, EGLuint64CHROMIUM *sbc);
+-typedef EGLBoolean(EGLAPIENTRYP PFNEGLGETMSCRATECHROMIUMPROC)(
+- EGLDisplay dpy,
+- EGLSurface surface,
+- EGLint* numerator,
+- EGLint* denominator);
+-#endif
+-#endif
++#endif /* EGL_CHROMIUM_sync_control */
++
++#ifndef EGL_ANGLE_sync_control_rate
++#define EGL_ANGLE_sync_control_rate 1
++#ifdef EGL_EGLEXT_PROTOTYPES
++EGLAPI EGLBoolean EGLAPIENTRY eglGetMscRateANGLE(EGLDisplay dpy,
++ EGLSurface surface,
++ EGLint* numerator,
++ EGLint* denominator);
++#endif /* EGL_EGLEXT_PROTOTYPES */
++typedef EGLBoolean(EGLAPIENTRYP PFNEGLGETMSCRATEANGLEPROC)(EGLDisplay dpy,
++ EGLSurface surface,
++ EGLint* numerator,
++ EGLint* denominator);
++#endif /* EGL_ANGLE_sync_control_rate */
++#endif /* KHRONOS_SUPPORT_INT64 */
+
+ #ifdef __cplusplus
+ }
+diff --git a/ui/gl/egl_bindings_autogen_mock.cc b/ui/gl/egl_bindings_autogen_mock.cc
+index f6562ad..d4d3a04 100644
+--- a/ui/gl/egl_bindings_autogen_mock.cc
++++ b/ui/gl/egl_bindings_autogen_mock.cc
+@@ -299,12 +299,12 @@
+ }
+
+ EGLBoolean GL_BINDING_CALL
+-MockEGLInterface::Mock_eglGetMscRateCHROMIUM(EGLDisplay dpy,
+- EGLSurface surface,
+- EGLint* numerator,
+- EGLint* denominator) {
+- MakeEglMockFunctionUnique("eglGetMscRateCHROMIUM");
+- return interface_->GetMscRateCHROMIUM(dpy, surface, numerator, denominator);
++MockEGLInterface::Mock_eglGetMscRateANGLE(EGLDisplay dpy,
++ EGLSurface surface,
++ EGLint* numerator,
++ EGLint* denominator) {
++ MakeEglMockFunctionUnique("eglGetMscRateANGLE");
++ return interface_->GetMscRateANGLE(dpy, surface, numerator, denominator);
+ }
+
+ EGLClientBuffer GL_BINDING_CALL
+@@ -706,8 +706,8 @@
+ if (strcmp(name, "eglGetFrameTimestampsANDROID") == 0)
+ return reinterpret_cast<GLFunctionPointerType>(
+ Mock_eglGetFrameTimestampsANDROID);
+- if (strcmp(name, "eglGetMscRateCHROMIUM") == 0)
+- return reinterpret_cast<GLFunctionPointerType>(Mock_eglGetMscRateCHROMIUM);
++ if (strcmp(name, "eglGetMscRateANGLE") == 0)
++ return reinterpret_cast<GLFunctionPointerType>(Mock_eglGetMscRateANGLE);
+ if (strcmp(name, "eglGetNativeClientBufferANDROID") == 0)
+ return reinterpret_cast<GLFunctionPointerType>(
+ Mock_eglGetNativeClientBufferANDROID);
+diff --git a/ui/gl/egl_bindings_autogen_mock.h b/ui/gl/egl_bindings_autogen_mock.h
+index 06f1117..4b7eb01 100644
+--- a/ui/gl/egl_bindings_autogen_mock.h
++++ b/ui/gl/egl_bindings_autogen_mock.h
+@@ -131,11 +131,10 @@
+ EGLint numTimestamps,
+ EGLint* timestamps,
+ EGLnsecsANDROID* values);
+-static EGLBoolean GL_BINDING_CALL
+-Mock_eglGetMscRateCHROMIUM(EGLDisplay dpy,
+- EGLSurface surface,
+- EGLint* numerator,
+- EGLint* denominator);
++static EGLBoolean GL_BINDING_CALL Mock_eglGetMscRateANGLE(EGLDisplay dpy,
++ EGLSurface surface,
++ EGLint* numerator,
++ EGLint* denominator);
+ static EGLClientBuffer GL_BINDING_CALL Mock_eglGetNativeClientBufferANDROID(
+ const struct AHardwareBuffer* ahardwarebuffer);
+ static EGLBoolean GL_BINDING_CALL
+diff --git a/ui/gl/generate_bindings.py b/ui/gl/generate_bindings.py
+index 6a89047..01da79a 100755
+--- a/ui/gl/generate_bindings.py
++++ b/ui/gl/generate_bindings.py
+@@ -2452,9 +2452,9 @@
+ ] }],
+ 'arguments': 'EGLDisplay dpy, EGLSurface surface, EGLint timestamp', },
+ { 'return_type': 'EGLBoolean',
+- 'versions': [{ 'name': 'eglGetMscRateCHROMIUM',
++ 'versions': [{ 'name': 'eglGetMscRateANGLE',
+ 'extensions': [
+- 'EGL_CHROMIUM_sync_control'
++ 'EGL_ANGLE_sync_control_rate'
+ ] }],
+ 'arguments':
+ 'EGLDisplay dpy, EGLSurface surface, '
+diff --git a/ui/gl/gl_bindings_api_autogen_egl.h b/ui/gl/gl_bindings_api_autogen_egl.h
+index 8628d7c..30b0ba80 100644
+--- a/ui/gl/gl_bindings_api_autogen_egl.h
++++ b/ui/gl/gl_bindings_api_autogen_egl.h
+@@ -111,10 +111,10 @@
+ EGLBoolean eglGetFrameTimestampSupportedANDROIDFn(EGLDisplay dpy,
+ EGLSurface surface,
+ EGLint timestamp) override;
+-EGLBoolean eglGetMscRateCHROMIUMFn(EGLDisplay dpy,
+- EGLSurface surface,
+- EGLint* numerator,
+- EGLint* denominator) override;
++EGLBoolean eglGetMscRateANGLEFn(EGLDisplay dpy,
++ EGLSurface surface,
++ EGLint* numerator,
++ EGLint* denominator) override;
+ EGLClientBuffer eglGetNativeClientBufferANDROIDFn(
+ const struct AHardwareBuffer* ahardwarebuffer) override;
+ EGLBoolean eglGetNextFrameIdANDROIDFn(EGLDisplay dpy,
+diff --git a/ui/gl/gl_bindings_autogen_egl.cc b/ui/gl/gl_bindings_autogen_egl.cc
+index 2f1ed11..18444223 100644
+--- a/ui/gl/gl_bindings_autogen_egl.cc
++++ b/ui/gl/gl_bindings_autogen_egl.cc
+@@ -187,6 +187,8 @@
+ gfx::HasExtension(extensions, "EGL_ANGLE_stream_producer_d3d_texture");
+ ext.b_EGL_ANGLE_surface_d3d_texture_2d_share_handle = gfx::HasExtension(
+ extensions, "EGL_ANGLE_surface_d3d_texture_2d_share_handle");
++ ext.b_EGL_ANGLE_sync_control_rate =
++ gfx::HasExtension(extensions, "EGL_ANGLE_sync_control_rate");
+ ext.b_EGL_CHROMIUM_sync_control =
+ gfx::HasExtension(extensions, "EGL_CHROMIUM_sync_control");
+ ext.b_EGL_EXT_image_flush_external =
+@@ -278,9 +280,9 @@
+ GetGLProcAddress("eglGetFrameTimestampSupportedANDROID"));
+ }
+
+- if (ext.b_EGL_CHROMIUM_sync_control) {
+- fn.eglGetMscRateCHROMIUMFn = reinterpret_cast<eglGetMscRateCHROMIUMProc>(
+- GetGLProcAddress("eglGetMscRateCHROMIUM"));
++ if (ext.b_EGL_ANGLE_sync_control_rate) {
++ fn.eglGetMscRateANGLEFn = reinterpret_cast<eglGetMscRateANGLEProc>(
++ GetGLProcAddress("eglGetMscRateANGLE"));
+ }
+
+ if (ext.b_EGL_ANDROID_get_native_client_buffer) {
+@@ -602,12 +604,11 @@
+ timestamp);
+ }
+
+-EGLBoolean EGLApiBase::eglGetMscRateCHROMIUMFn(EGLDisplay dpy,
+- EGLSurface surface,
+- EGLint* numerator,
+- EGLint* denominator) {
+- return driver_->fn.eglGetMscRateCHROMIUMFn(dpy, surface, numerator,
+- denominator);
++EGLBoolean EGLApiBase::eglGetMscRateANGLEFn(EGLDisplay dpy,
++ EGLSurface surface,
++ EGLint* numerator,
++ EGLint* denominator) {
++ return driver_->fn.eglGetMscRateANGLEFn(dpy, surface, numerator, denominator);
+ }
+
+ EGLClientBuffer EGLApiBase::eglGetNativeClientBufferANDROIDFn(
+@@ -1117,13 +1118,12 @@
+ timestamp);
+ }
+
+-EGLBoolean TraceEGLApi::eglGetMscRateCHROMIUMFn(EGLDisplay dpy,
+- EGLSurface surface,
+- EGLint* numerator,
+- EGLint* denominator) {
+- TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceEGLAPI::eglGetMscRateCHROMIUM")
+- return egl_api_->eglGetMscRateCHROMIUMFn(dpy, surface, numerator,
+- denominator);
++EGLBoolean TraceEGLApi::eglGetMscRateANGLEFn(EGLDisplay dpy,
++ EGLSurface surface,
++ EGLint* numerator,
++ EGLint* denominator) {
++ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceEGLAPI::eglGetMscRateANGLE")
++ return egl_api_->eglGetMscRateANGLEFn(dpy, surface, numerator, denominator);
+ }
+
+ EGLClientBuffer TraceEGLApi::eglGetNativeClientBufferANDROIDFn(
+@@ -1811,16 +1811,16 @@
+ return result;
+ }
+
+-EGLBoolean LogEGLApi::eglGetMscRateCHROMIUMFn(EGLDisplay dpy,
+- EGLSurface surface,
+- EGLint* numerator,
+- EGLint* denominator) {
+- GL_SERVICE_LOG("eglGetMscRateCHROMIUM"
++EGLBoolean LogEGLApi::eglGetMscRateANGLEFn(EGLDisplay dpy,
++ EGLSurface surface,
++ EGLint* numerator,
++ EGLint* denominator) {
++ GL_SERVICE_LOG("eglGetMscRateANGLE"
+ << "(" << dpy << ", " << surface << ", "
+ << static_cast<const void*>(numerator) << ", "
+ << static_cast<const void*>(denominator) << ")");
+ EGLBoolean result =
+- egl_api_->eglGetMscRateCHROMIUMFn(dpy, surface, numerator, denominator);
++ egl_api_->eglGetMscRateANGLEFn(dpy, surface, numerator, denominator);
+ GL_SERVICE_LOG("GL_RESULT: " << result);
+ return result;
+ }
+diff --git a/ui/gl/gl_bindings_autogen_egl.h b/ui/gl/gl_bindings_autogen_egl.h
+index 546e2c9..6cafd14 100644
+--- a/ui/gl/gl_bindings_autogen_egl.h
++++ b/ui/gl/gl_bindings_autogen_egl.h
+@@ -141,7 +141,7 @@
+ EGLDisplay dpy,
+ EGLSurface surface,
+ EGLint timestamp);
+-typedef EGLBoolean(GL_BINDING_CALL* eglGetMscRateCHROMIUMProc)(
++typedef EGLBoolean(GL_BINDING_CALL* eglGetMscRateANGLEProc)(
+ EGLDisplay dpy,
+ EGLSurface surface,
+ EGLint* numerator,
+@@ -296,6 +296,7 @@
+ bool b_EGL_ANGLE_query_surface_pointer;
+ bool b_EGL_ANGLE_stream_producer_d3d_texture;
+ bool b_EGL_ANGLE_surface_d3d_texture_2d_share_handle;
++ bool b_EGL_ANGLE_sync_control_rate;
+ bool b_EGL_CHROMIUM_sync_control;
+ bool b_EGL_EXT_image_flush_external;
+ bool b_EGL_KHR_fence_sync;
+@@ -351,7 +352,7 @@
+ eglGetFrameTimestampsANDROIDProc eglGetFrameTimestampsANDROIDFn;
+ eglGetFrameTimestampSupportedANDROIDProc
+ eglGetFrameTimestampSupportedANDROIDFn;
+- eglGetMscRateCHROMIUMProc eglGetMscRateCHROMIUMFn;
++ eglGetMscRateANGLEProc eglGetMscRateANGLEFn;
+ eglGetNativeClientBufferANDROIDProc eglGetNativeClientBufferANDROIDFn;
+ eglGetNextFrameIdANDROIDProc eglGetNextFrameIdANDROIDFn;
+ eglGetPlatformDisplayProc eglGetPlatformDisplayFn;
+@@ -512,10 +513,10 @@
+ EGLDisplay dpy,
+ EGLSurface surface,
+ EGLint timestamp) = 0;
+- virtual EGLBoolean eglGetMscRateCHROMIUMFn(EGLDisplay dpy,
+- EGLSurface surface,
+- EGLint* numerator,
+- EGLint* denominator) = 0;
++ virtual EGLBoolean eglGetMscRateANGLEFn(EGLDisplay dpy,
++ EGLSurface surface,
++ EGLint* numerator,
++ EGLint* denominator) = 0;
+ virtual EGLClientBuffer eglGetNativeClientBufferANDROIDFn(
+ const struct AHardwareBuffer* ahardwarebuffer) = 0;
+ virtual EGLBoolean eglGetNextFrameIdANDROIDFn(EGLDisplay dpy,
+@@ -685,8 +686,7 @@
+ ::gl::g_current_egl_context->eglGetFrameTimestampsANDROIDFn
+ #define eglGetFrameTimestampSupportedANDROID \
+ ::gl::g_current_egl_context->eglGetFrameTimestampSupportedANDROIDFn
+-#define eglGetMscRateCHROMIUM \
+- ::gl::g_current_egl_context->eglGetMscRateCHROMIUMFn
++#define eglGetMscRateANGLE ::gl::g_current_egl_context->eglGetMscRateANGLEFn
+ #define eglGetNativeClientBufferANDROID \
+ ::gl::g_current_egl_context->eglGetNativeClientBufferANDROIDFn
+ #define eglGetNextFrameIdANDROID \
+diff --git a/ui/gl/gl_enums_implementation_autogen.h b/ui/gl/gl_enums_implementation_autogen.h
+index d35439c..1209923b 100644
+--- a/ui/gl/gl_enums_implementation_autogen.h
++++ b/ui/gl/gl_enums_implementation_autogen.h
+@@ -829,10 +829,6 @@
+ "GL_FILL_NV",
+ },
+ {
+- 0x1D00,
+- "GL_FLAT_CHROMIUM",
+- },
+- {
+ 0x1E00,
+ "GL_KEEP",
+ },
+@@ -877,14 +873,6 @@
+ "GL_FONT_NUM_GLYPH_INDICES_BIT_NV",
+ },
+ {
+- 0x2400,
+- "GL_EYE_LINEAR_CHROMIUM",
+- },
+- {
+- 0x2401,
+- "GL_OBJECT_LINEAR_CHROMIUM",
+- },
+- {
+ 0x2600,
+ "GL_NEAREST",
+ },
+@@ -2053,10 +2041,6 @@
+ "GL_MAX_CUBE_MAP_TEXTURE_SIZE",
+ },
+ {
+- 0x8576,
+- "GL_CONSTANT_CHROMIUM",
+- },
+- {
+ 0x8589,
+ "GL_SRC1_ALPHA_EXT",
+ },
+@@ -4629,10 +4613,6 @@
+ "GL_PATH_CLIENT_LENGTH_NV",
+ },
+ {
+- 0x907a,
+- "GL_PATH_MITER_LIMIT_CHROMIUM",
+- },
+- {
+ 0x9080,
+ "GL_PATH_FILL_MODE_NV",
+ },
+@@ -4653,10 +4633,6 @@
+ "GL_PATH_STROKE_MASK_NV",
+ },
+ {
+- 0x9086,
+- "GL_PATH_STROKE_BOUND_CHROMIUM",
+- },
+- {
+ 0x9088,
+ "GL_COUNT_UP_NV",
+ },
+@@ -4965,14 +4941,6 @@
+ "GL_CONTEXT_ROBUST_ACCESS_KHR",
+ },
+ {
+- 0x90a3,
+- "GL_SQUARE_CHROMIUM",
+- },
+- {
+- 0x90a4,
+- "GL_ROUND_CHROMIUM",
+- },
+- {
+ 0x9100,
+ "GL_TEXTURE_2D_MULTISAMPLE",
+ },
+diff --git a/ui/gl/gl_mock_autogen_egl.h b/ui/gl/gl_mock_autogen_egl.h
+index bcdd2a3..ba2f95f 100644
+--- a/ui/gl/gl_mock_autogen_egl.h
++++ b/ui/gl/gl_mock_autogen_egl.h
+@@ -121,7 +121,7 @@
+ EGLnsecsANDROID* values));
+ MOCK_METHOD3(GetFrameTimestampSupportedANDROID,
+ EGLBoolean(EGLDisplay dpy, EGLSurface surface, EGLint timestamp));
+-MOCK_METHOD4(GetMscRateCHROMIUM,
++MOCK_METHOD4(GetMscRateANGLE,
+ EGLBoolean(EGLDisplay dpy,
+ EGLSurface surface,
+ EGLint* numerator,
+diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc
+index 72268904..750f3ed 100644
+--- a/ui/gl/gl_surface_egl.cc
++++ b/ui/gl/gl_surface_egl.cc
+@@ -174,6 +174,7 @@
+ bool g_egl_create_context_bind_generates_resource_supported = false;
+ bool g_egl_create_context_webgl_compatability_supported = false;
+ bool g_egl_sync_control_supported = false;
++bool g_egl_sync_control_rate_supported = false;
+ bool g_egl_window_fixed_size_supported = false;
+ bool g_egl_surfaceless_context_supported = false;
+ bool g_egl_surface_orientation_supported = false;
+@@ -266,8 +267,12 @@
+ }
+
+ bool GetMscRate(int32_t* numerator, int32_t* denominator) override {
++ if (!g_egl_sync_control_rate_supported) {
++ return false;
++ }
++
+- bool result = eglGetMscRateCHROMIUM(g_egl_display, surface_, numerator,
+- denominator) == EGL_TRUE;
++ bool result = eglGetMscRateANGLE(g_egl_display, surface_, numerator,
++ denominator) == EGL_TRUE;
+ return result;
+ }
+
+@@ -921,6 +920,8 @@
+ g_egl_create_context_webgl_compatability_supported =
+ HasEGLExtension("EGL_ANGLE_create_context_webgl_compatibility");
+ g_egl_sync_control_supported = HasEGLExtension("EGL_CHROMIUM_sync_control");
++ g_egl_sync_control_rate_supported =
++ HasEGLExtension("EGL_ANGLE_sync_control_rate");
+ g_egl_window_fixed_size_supported =
+ HasEGLExtension("EGL_ANGLE_window_fixed_size");
+ g_egl_surface_orientation_supported =
+@@ -1036,6 +1037,7 @@
+ g_egl_create_context_bind_generates_resource_supported = false;
+ g_egl_create_context_webgl_compatability_supported = false;
+ g_egl_sync_control_supported = false;
++ g_egl_sync_control_rate_supported = false;
+ g_egl_window_fixed_size_supported = false;
+ g_egl_surface_orientation_supported = false;
+ g_egl_surfaceless_context_supported = false;
diff --git a/flags.archlinux.gn b/flags.archlinux.gn
new file mode 100644
index 0000000..df699d5
--- /dev/null
+++ b/flags.archlinux.gn
@@ -0,0 +1,32 @@
+blink_symbol_level=0
+custom_toolchain="//build/toolchain/linux/unbundle:default"
+enable_iterator_debugging=false
+enable_swiftshader=false
+fatal_linker_warnings=false
+ffmpeg_branding="ChromeOS"
+gold_path=""
+goma_dir=""
+host_toolchain="//build/toolchain/linux/unbundle:default"
+icu_use_data_file=false
+is_clang=true
+is_debug=false
+link_pulseaudio=true
+linux_use_bundled_binutils=false
+proprietary_codecs=true
+symbol_level=0
+use_cups=true
+use_custom_libcxx=false
+use_gio=true
+use_gnome_keyring=false
+use_kerberos=false
+use_libjpeg_turbo=true
+use_lld=true
+use_openh264=false
+use_pulseaudio=true
+use_sysroot=false
+use_system_freetype=true
+use_system_harfbuzz=true
+use_system_lcms2=true
+use_system_libjpeg=true
+use_system_zlib=true
+use_vaapi=true
diff --git a/icu67.patch b/icu67.patch
new file mode 100644
index 0000000..bcfcb18
--- /dev/null
+++ b/icu67.patch
@@ -0,0 +1,169 @@
+From 2b107e7670ffb43719a66ee4a55ab408a5dcf2a5 Mon Sep 17 00:00:00 2001
+From: Ujjwal Sharma <ryzokuken@disroot.org>
+Date: Wed, 22 Apr 2020 12:20:17 +0530
+Subject: [PATCH] deps: V8: backport 3f8dc4b2e5ba
+
+Original commit message:
+
+ [intl] Remove soon-to-be removed getAllFieldPositions
+
+ Needed to land ICU67.1 soon.
+
+ Bug: v8:10393
+ Change-Id: I3c7737ca600d6ccfdc46ffaddfb318ce60bc7618
+ Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2136489
+ Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
+ Commit-Queue: Frank Tang <ftang@chromium.org>
+ Cr-Commit-Position: refs/heads/master@{#67027}
+
+Refs: https://github.com/v8/v8/commit/3f8dc4b2e5baf77b463334c769af85b79d8c1463
+---
+ common.gypi | 2 +-
+ deps/v8/src/objects/js-number-format.cc | 72 +++++++++++++------------
+ 2 files changed, 38 insertions(+), 36 deletions(-)
+
+diff --git a/deps/v8/src/objects/js-number-format.cc b/deps/v8/src/objects/js-number-format.cc
+index 92d3e2fb82e..ced408aa173 100644
+--- a/deps/v8/src/objects/js-number-format.cc
++++ b/deps/v8/src/objects/js-number-format.cc
+@@ -1197,42 +1197,31 @@ MaybeHandle<JSNumberFormat> JSNumberFormat::New(Isolate* isolate,
+ }
+
+ namespace {
+-Maybe<icu::UnicodeString> IcuFormatNumber(
++Maybe<bool> IcuFormatNumber(
+ Isolate* isolate,
+ const icu::number::LocalizedNumberFormatter& number_format,
+- Handle<Object> numeric_obj, icu::FieldPositionIterator* fp_iter) {
++ Handle<Object> numeric_obj, icu::number::FormattedNumber* formatted) {
+ // If it is BigInt, handle it differently.
+ UErrorCode status = U_ZERO_ERROR;
+- icu::number::FormattedNumber formatted;
+ if (numeric_obj->IsBigInt()) {
+ Handle<BigInt> big_int = Handle<BigInt>::cast(numeric_obj);
+ Handle<String> big_int_string;
+ ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, big_int_string,
+ BigInt::ToString(isolate, big_int),
+- Nothing<icu::UnicodeString>());
+- formatted = number_format.formatDecimal(
++ Nothing<bool>());
++ *formatted = number_format.formatDecimal(
+ {big_int_string->ToCString().get(), big_int_string->length()}, status);
+ } else {
+ double number = numeric_obj->Number();
+- formatted = number_format.formatDouble(number, status);
++ *formatted = number_format.formatDouble(number, status);
+ }
+ if (U_FAILURE(status)) {
+ // This happen because of icu data trimming trim out "unit".
+ // See https://bugs.chromium.org/p/v8/issues/detail?id=8641
+- THROW_NEW_ERROR_RETURN_VALUE(isolate,
+- NewTypeError(MessageTemplate::kIcuError),
+- Nothing<icu::UnicodeString>());
+- }
+- if (fp_iter) {
+- formatted.getAllFieldPositions(*fp_iter, status);
++ THROW_NEW_ERROR_RETURN_VALUE(
++ isolate, NewTypeError(MessageTemplate::kIcuError), Nothing<bool>());
+ }
+- icu::UnicodeString result = formatted.toString(status);
+- if (U_FAILURE(status)) {
+- THROW_NEW_ERROR_RETURN_VALUE(isolate,
+- NewTypeError(MessageTemplate::kIcuError),
+- Nothing<icu::UnicodeString>());
+- }
+- return Just(result);
++ return Just(true);
+ }
+
+ } // namespace
+@@ -1243,10 +1232,16 @@ MaybeHandle<String> JSNumberFormat::FormatNumeric(
+ Handle<Object> numeric_obj) {
+ DCHECK(numeric_obj->IsNumeric());
+
+- Maybe<icu::UnicodeString> maybe_format =
+- IcuFormatNumber(isolate, number_format, numeric_obj, nullptr);
++ icu::number::FormattedNumber formatted;
++ Maybe<bool> maybe_format =
++ IcuFormatNumber(isolate, number_format, numeric_obj, &formatted);
+ MAYBE_RETURN(maybe_format, Handle<String>());
+- return Intl::ToString(isolate, maybe_format.FromJust());
++ UErrorCode status = U_ZERO_ERROR;
++ icu::UnicodeString result = formatted.toString(status);
++ if (U_FAILURE(status)) {
++ THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kIcuError), String);
++ }
++ return Intl::ToString(isolate, result);
+ }
+
+ namespace {
+@@ -1359,12 +1354,18 @@ std::vector<NumberFormatSpan> FlattenRegionsToParts(
+ }
+
+ namespace {
+-Maybe<int> ConstructParts(Isolate* isolate, const icu::UnicodeString& formatted,
+- icu::FieldPositionIterator* fp_iter,
++Maybe<int> ConstructParts(Isolate* isolate,
++ icu::number::FormattedNumber* formatted,
+ Handle<JSArray> result, int start_index,
+ Handle<Object> numeric_obj, bool style_is_unit) {
++ UErrorCode status = U_ZERO_ERROR;
++ icu::UnicodeString formatted_text = formatted->toString(status);
++ if (U_FAILURE(status)) {
++ THROW_NEW_ERROR_RETURN_VALUE(
++ isolate, NewTypeError(MessageTemplate::kIcuError), Nothing<int>());
++ }
+ DCHECK(numeric_obj->IsNumeric());
+- int32_t length = formatted.length();
++ int32_t length = formatted_text.length();
+ int index = start_index;
+ if (length == 0) return Just(index);
+
+@@ -1373,13 +1374,14 @@ Maybe<int> ConstructParts(Isolate* isolate, const icu::UnicodeString& formatted,
+ // other region covers some part of the formatted string. It's possible
+ // there's another field with exactly the same begin and end as this backdrop,
+ // in which case the backdrop's field_id of -1 will give it lower priority.
+- regions.push_back(NumberFormatSpan(-1, 0, formatted.length()));
++ regions.push_back(NumberFormatSpan(-1, 0, formatted_text.length()));
+
+ {
+- icu::FieldPosition fp;
+- while (fp_iter->next(fp)) {
+- regions.push_back(NumberFormatSpan(fp.getField(), fp.getBeginIndex(),
+- fp.getEndIndex()));
++ icu::ConstrainedFieldPosition cfp;
++ cfp.constrainCategory(UFIELD_CATEGORY_NUMBER);
++ while (formatted->nextPosition(cfp, status)) {
++ regions.push_back(
++ NumberFormatSpan(cfp.getField(), cfp.getStart(), cfp.getLimit()));
+ }
+ }
+
+@@ -1401,7 +1403,7 @@ Maybe<int> ConstructParts(Isolate* isolate, const icu::UnicodeString& formatted,
+ Handle<String> substring;
+ ASSIGN_RETURN_ON_EXCEPTION_VALUE(
+ isolate, substring,
+- Intl::ToString(isolate, formatted, part.begin_pos, part.end_pos),
++ Intl::ToString(isolate, formatted_text, part.begin_pos, part.end_pos),
+ Nothing<int>());
+ Intl::AddElement(isolate, result, index, field_type_string, substring);
+ ++index;
+@@ -1421,14 +1423,14 @@ MaybeHandle<JSArray> JSNumberFormat::FormatToParts(
+ number_format->icu_number_formatter().raw();
+ CHECK_NOT_NULL(fmt);
+
+- icu::FieldPositionIterator fp_iter;
+- Maybe<icu::UnicodeString> maybe_format =
+- IcuFormatNumber(isolate, *fmt, numeric_obj, &fp_iter);
++ icu::number::FormattedNumber formatted;
++ Maybe<bool> maybe_format =
++ IcuFormatNumber(isolate, *fmt, numeric_obj, &formatted);
+ MAYBE_RETURN(maybe_format, Handle<JSArray>());
+
+ Handle<JSArray> result = factory->NewJSArray(0);
+ Maybe<int> maybe_format_to_parts = ConstructParts(
+- isolate, maybe_format.FromJust(), &fp_iter, result, 0, numeric_obj,
++ isolate, &formatted, result, 0, numeric_obj,
+ number_format->style() == JSNumberFormat::Style::UNIT);
+ MAYBE_RETURN(maybe_format_to_parts, Handle<JSArray>());
+
diff --git a/rebuild-Linux-frame-button-cache-when-activation.patch b/rebuild-Linux-frame-button-cache-when-activation.patch
new file mode 100644
index 0000000..40764b3
--- /dev/null
+++ b/rebuild-Linux-frame-button-cache-when-activation.patch
@@ -0,0 +1,62 @@
+From d10f885b9327399be9348b780967ebd6b7f2c4bc Mon Sep 17 00:00:00 2001
+From: Tom Anderson <thomasanderson@chromium.org>
+Date: Fri, 7 Feb 2020 22:44:54 +0000
+Subject: [PATCH] Rebuild Linux frame button cache when activation state
+ changes
+
+This fixes an issue where the frame buttons would always render in an
+inactive state on Linux (see repro steps in bug 1049258).
+
+Bug: 1049258
+R=sky
+CC=pkasting
+
+Change-Id: Ic5af33199003e1d1cdf6cedf506e32388ea11fa9
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2044538
+Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
+Commit-Queue: Scott Violet <sky@chromium.org>
+Reviewed-by: Scott Violet <sky@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#739585}
+---
+ .../ui/views/frame/desktop_linux_browser_frame_view.cc | 6 +++---
+ .../desktop_aura/desktop_window_tree_host_platform.cc | 3 +++
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/chrome/browser/ui/views/frame/desktop_linux_browser_frame_view.cc b/chrome/browser/ui/views/frame/desktop_linux_browser_frame_view.cc
+index 954e776057f..4f579955675 100644
+--- a/chrome/browser/ui/views/frame/desktop_linux_browser_frame_view.cc
++++ b/chrome/browser/ui/views/frame/desktop_linux_browser_frame_view.cc
+@@ -22,13 +22,13 @@ DesktopLinuxBrowserFrameView::DesktopLinuxBrowserFrameView(
+ : OpaqueBrowserFrameView(frame, browser_view, layout),
+ nav_button_provider_(std::move(nav_button_provider)) {}
+
+-DesktopLinuxBrowserFrameView::~DesktopLinuxBrowserFrameView() {}
++DesktopLinuxBrowserFrameView::~DesktopLinuxBrowserFrameView() = default;
+
+ void DesktopLinuxBrowserFrameView::Layout() {
+ // Calling MaybeUpdateCachedFrameButtonImages() from Layout() is sufficient to
+ // catch all cases that could update the appearance, since
+- // DesktopWindowTreeHostPlatform::OnWindowStateChanged() does a layout any
+- // time any properties change.
++ // DesktopWindowTreeHostPlatform::On{Window,Activation}StateChanged() does a
++ // layout any time the maximized and activation state changes, respectively.
+ MaybeUpdateCachedFrameButtonImages();
+ OpaqueBrowserFrameView::Layout();
+ }
+diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc
+index 9c695d8e5b1..9662f19aa90 100644
+--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc
++++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc
+@@ -677,9 +677,12 @@ void DesktopWindowTreeHostPlatform::OnCloseRequest() {
+ }
+
+ void DesktopWindowTreeHostPlatform::OnActivationChanged(bool active) {
++ if (is_active_ == active)
++ return;
+ is_active_ = active;
+ aura::WindowTreeHostPlatform::OnActivationChanged(active);
+ desktop_native_widget_aura_->HandleActivationChanged(active);
++ ScheduleRelayout();
+ }
+
+ base::Optional<gfx::Size>
diff --git a/rename-Relayout-in-DesktopWindowTreeHostPlatform.patch b/rename-Relayout-in-DesktopWindowTreeHostPlatform.patch
new file mode 100644
index 0000000..eda3cbd
--- /dev/null
+++ b/rename-Relayout-in-DesktopWindowTreeHostPlatform.patch
@@ -0,0 +1,64 @@
+From 5a2cd2409c7d65c019ad9f4595a4e85315857ac4 Mon Sep 17 00:00:00 2001
+From: Tom Anderson <thomasanderson@chromium.org>
+Date: Mon, 3 Feb 2020 23:18:46 +0000
+Subject: [PATCH] Rename Relayout() in DesktopWindowTreeHostPlatform to
+ ScheduleRelayout()
+
+R=sky
+
+Bug: None
+Change-Id: I680cafd25935e59a280e3b2baac754d3d5f13a35
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2036553
+Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
+Reviewed-by: Scott Violet <sky@chromium.org>
+Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#737974}
+---
+ .../desktop_aura/desktop_window_tree_host_platform.cc | 6 +++---
+ .../widget/desktop_aura/desktop_window_tree_host_platform.h | 2 +-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc
+index 6c00d49eb3f..9c695d8e5b1 100644
+--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc
++++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc
+@@ -556,7 +556,7 @@ void DesktopWindowTreeHostPlatform::SetFullscreen(bool fullscreen) {
+ DCHECK_EQ(fullscreen, IsFullscreen());
+
+ if (IsFullscreen() == fullscreen)
+- Relayout();
++ ScheduleRelayout();
+ // Else: the widget will be relaid out either when the window bounds change
+ // or when |platform_window|'s fullscreen state changes.
+ }
+@@ -669,7 +669,7 @@ void DesktopWindowTreeHostPlatform::OnWindowStateChanged(
+ // Now that we have different window properties, we may need to relayout the
+ // window. (The windows code doesn't need this because their window change is
+ // synchronous.)
+- Relayout();
++ ScheduleRelayout();
+ }
+
+ void DesktopWindowTreeHostPlatform::OnCloseRequest() {
+@@ -712,7 +712,7 @@ gfx::Rect DesktopWindowTreeHostPlatform::ToPixelRect(
+ return gfx::ToEnclosingRect(rect_in_pixels);
+ }
+
+-void DesktopWindowTreeHostPlatform::Relayout() {
++void DesktopWindowTreeHostPlatform::ScheduleRelayout() {
+ Widget* widget = native_widget_delegate_->AsWidget();
+ NonClientView* non_client_view = widget->non_client_view();
+ // non_client_view may be NULL, especially during creation.
+diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.h b/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.h
+index 89beb8d2245..75a401e02a7 100644
+--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.h
++++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.h
+@@ -129,7 +129,7 @@ class VIEWS_EXPORT DesktopWindowTreeHostPlatform
+ gfx::Rect ToPixelRect(const gfx::Rect& rect_in_dip) const;
+
+ private:
+- void Relayout();
++ void ScheduleRelayout();
+
+ Widget* GetWidget();
+ const Widget* GetWidget() const;
diff --git a/vaapi-build-fix.patch b/vaapi-build-fix.patch
new file mode 100644
index 0000000..2b7851a
--- /dev/null
+++ b/vaapi-build-fix.patch
@@ -0,0 +1,51 @@
+From 5b2ff215473e0526b5b24aeff4ad90d369b21c75 Mon Sep 17 00:00:00 2001
+From: Julien Isorce <julien.isorce@chromium.org>
+Date: Wed, 05 Feb 2020 17:59:59 +0000
+Subject: [PATCH] Fix vaapi with GLX
+
+The signature of ui's gl::GLImageGLX has changed a little bit
+since "mplement GpuMemoryBuffers for EGL and GLX":
+ https://chromium-review.googlesource.com/c/chromium/src/+/1984712
+
+Bug: 1031269
+Test: build with use_vaapi=true and run with --use-gl=desktop, see
+Change-Id: I80b07294b9abdfa8233aaf79f7d9ec4c58117090
+https: //chromium.googlesource.com/chromium/src.git/+/refs/heads/master/docs/gpu/vaapi.md#vaapi-on-linux
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2036494
+Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
+Reviewed-by: Miguel Casas <mcasas@chromium.org>
+Commit-Queue: Julien Isorce <julien.isorce@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#738595}
+---
+
+diff --git a/media/gpu/vaapi/vaapi_picture_tfp.cc b/media/gpu/vaapi/vaapi_picture_tfp.cc
+index 227c31b..b42620d 100644
+--- a/media/gpu/vaapi/vaapi_picture_tfp.cc
++++ b/media/gpu/vaapi/vaapi_picture_tfp.cc
+@@ -57,7 +57,7 @@
+ if (make_context_current_cb_ && !make_context_current_cb_.Run())
+ return false;
+
+- glx_image_ = new gl::GLImageGLX(size_, GL_RGB);
++ glx_image_ = new gl::GLImageGLX(size_, gfx::BufferFormat::BGRX_8888);
+ if (!glx_image_->Initialize(x_pixmap_)) {
+ // x_pixmap_ will be freed in the destructor.
+ DLOG(ERROR) << "Failed creating a GLX Pixmap for TFP";
+--- a/media/mojo/services/gpu_mojo_media_client.cc 2020-04-02 21:11:34.000000000 -0700
++++ b/media/mojo/services/gpu_mojo_media_client.cc 2020-04-09 00:44:58.871366432 -0700
+@@ -158,6 +158,7 @@
+ *d3d11_supported_configs_;
+
+ #elif BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION)
++#if defined(OS_CHROMEOS)
+ if (base::FeatureList::IsEnabled(kChromeosVideoDecoder)) {
+ if (!cros_supported_configs_) {
+ cros_supported_configs_ =
+@@ -167,6 +168,7 @@
+ *cros_supported_configs_;
+ return supported_config_map;
+ }
++#endif //defined(OS_CHROMEOS)
+ #endif
+
+ auto& default_configs =
diff --git a/vdpau-support.patch b/vdpau-support.patch
new file mode 100644
index 0000000..b5372d1
--- /dev/null
+++ b/vdpau-support.patch
@@ -0,0 +1,74 @@
+--- a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
++++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
+@@ -641,6 +641,7 @@ void VaapiVideoDecodeAccelerator::AssignPictureBuffers(
+ // |vpp_vaapi_wrapper_| for VaapiPicture to DownloadFromSurface() the VA's
+ // internal decoded frame.
+ if (buffer_allocation_mode_ != BufferAllocationMode::kNone &&
++ buffer_allocation_mode_ != BufferAllocationMode::kWrapVdpau &&
+ !vpp_vaapi_wrapper_) {
+ vpp_vaapi_wrapper_ = VaapiWrapper::Create(
+ VaapiWrapper::kVideoProcess, VAProfileNone,
+@@ -665,7 +666,8 @@ void VaapiVideoDecodeAccelerator::AssignPictureBuffers(
+ PictureBuffer buffer = buffers[i];
+ buffer.set_size(requested_pic_size_);
+ std::unique_ptr<VaapiPicture> picture = vaapi_picture_factory_->Create(
+- (buffer_allocation_mode_ == BufferAllocationMode::kNone)
++ ((buffer_allocation_mode_ == BufferAllocationMode::kNone) ||
++ (buffer_allocation_mode_ == BufferAllocationMode::kWrapVdpau))
+ ? vaapi_wrapper_
+ : vpp_vaapi_wrapper_,
+ make_context_current_cb_, bind_image_cb_, buffer);
+@@ -1093,6 +1095,12 @@ VaapiVideoDecodeAccelerator::GetSupportedProfiles() {
+
+ VaapiVideoDecodeAccelerator::BufferAllocationMode
+ VaapiVideoDecodeAccelerator::DecideBufferAllocationMode() {
++ // NVIDIA blobs use VDPAU
++ if (VaapiWrapper::GetImplementationType() == VAImplementation::kNVIDIAVDPAU) {
++ LOG(INFO) << "VA-API driver on VDPAU backend";
++ return BufferAllocationMode::kWrapVdpau;
++ }
++
+ // TODO(crbug.com/912295): Enable a better BufferAllocationMode for IMPORT
+ // |output_mode_| as well.
+ if (output_mode_ == VideoDecodeAccelerator::Config::OutputMode::IMPORT)
+@@ -1105,7 +1113,7 @@ VaapiVideoDecodeAccelerator::DecideBufferAllocationMode() {
+ // depends on the bitstream and sometimes it's not enough to cover the amount
+ // of frames needed by the client pipeline (see b/133733739).
+ // TODO(crbug.com/911754): Enable for VP9 Profile 2.
+- if (IsGeminiLakeOrLater() &&
++ if (false && IsGeminiLakeOrLater() &&
+ (profile_ == VP9PROFILE_PROFILE0 || profile_ == VP8PROFILE_ANY)) {
+ // Add one to the reference frames for the one being currently egressed, and
+ // an extra allocation for both |client_| and |decoder_|, see
+--- a/media/gpu/vaapi/vaapi_video_decode_accelerator.h
++++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.h
+@@ -204,6 +204,7 @@ class MEDIA_GPU_EXPORT VaapiVideoDecodeAccelerator
+ // Using |client_|s provided PictureBuffers and as many internally
+ // allocated.
+ kNormal,
++ kWrapVdpau,
+ };
+
+ // Decides the concrete buffer allocation mode, depending on the hardware
+--- a/media/gpu/vaapi/vaapi_wrapper.cc
++++ b/media/gpu/vaapi/vaapi_wrapper.cc
+@@ -131,6 +131,9 @@ media::VAImplementation VendorStringToImplementationType(
+ } else if (base::StartsWith(va_vendor_string, "Intel iHD driver",
+ base::CompareCase::SENSITIVE)) {
+ return media::VAImplementation::kIntelIHD;
++ } else if (base::StartsWith(va_vendor_string, "Splitted-Desktop Systems VDPAU",
++ base::CompareCase::SENSITIVE)) {
++ return media::VAImplementation::kNVIDIAVDPAU;
+ }
+ return media::VAImplementation::kOther;
+ }
+--- a/media/gpu/vaapi/vaapi_wrapper.h
++++ b/media/gpu/vaapi/vaapi_wrapper.h
+@@ -79,6 +79,7 @@ enum class VAImplementation {
+ kIntelIHD,
+ kOther,
+ kInvalid,
++ kNVIDIAVDPAU,
+ };
+
+ // This class handles VA-API calls and ensures proper locking of VA-API calls