summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO43
-rw-r--r--PKGBUILD59
-rw-r--r--chromium-skia-harmony.patch14
-rw-r--r--intel-vp9-quirk.patch12
-rw-r--r--media-Set-allocation-limit-compatible-with-FFmpeg-4.3.patch43
-rw-r--r--nvidia-vdpau.patch65
-rw-r--r--subpixel-anti-aliasing-in-FreeType-2.8.1.patch100
7 files changed, 138 insertions, 198 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 03dd7b197b5c..8c4594eb01c1 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,8 @@
pkgbase = ungoogled-chromium-git
pkgdesc = A lightweight approach to removing Google web service dependency (master branch)
- pkgver = 85.0.4183.121.1.r0.ge46b774
+ pkgver = 88.0.4324.104.1.r3.ga9140d5
pkgrel = 1
url = https://github.com/Eloston/ungoogled-chromium
- install = chromium.install
arch = x86_64
license = BSD
makedepends = python
@@ -17,7 +16,7 @@ pkgbase = ungoogled-chromium-git
makedepends = libpipewire02
makedepends = clang
makedepends = lld
- makedepends = gn-m85
+ makedepends = gn
makedepends = java-runtime-headless
makedepends = python2-setuptools
depends = gtk3
@@ -32,25 +31,23 @@ pkgbase = ungoogled-chromium-git
depends = dbus
depends = libpulse
depends = pciutils
- depends = json-glib
depends = desktop-file-utils
depends = hicolor-icon-theme
- depends = icu
- depends = libxml2
depends = fontconfig
- depends = harfbuzz
depends = libjpeg
- depends = libpng
- depends = re2
+ depends = icu
+ depends = flac
depends = snappy
+ depends = libxml2
depends = ffmpeg
- depends = flac
depends = libwebp
depends = minizip
+ depends = opus
+ depends = harfbuzz
+ depends = re2
depends = libxslt
+ depends = libpng
depends = freetype2
- depends = opus
- optdepends = pepper-flash: support for Flash content
optdepends = libpipewire02: WebRTC desktop sharing under Wayland
optdepends = libva: hardware-accelerated video decode [experimental]
optdepends = kdialog: needed for file dialogs in KDE
@@ -58,26 +55,20 @@ pkgbase = ungoogled-chromium-git
optdepends = kwallet: for storing passwords in KWallet on KDE desktops
provides = chromium
conflicts = chromium
- source = https://commondatastorage.googleapis.com/chromium-browser-official/chromium-85.0.4183.121.tar.xz
+ source = https://commondatastorage.googleapis.com/chromium-browser-official/chromium-88.0.4324.104.tar.xz
source = ungoogled-chromium-master::git://github.com/Eloston/ungoogled-chromium.git
- source = chromium-launcher-6.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v6.tar.gz
+ source = https://github.com/foutrelis/chromium-launcher/archive/v7/chromium-launcher-7.tar.gz
source = chromium-drirc-disable-10bpc-color-configs.conf
- source = https://github.com/stha09/chromium-patches/releases/download/chromium-85-patchset-2/chromium-85-patchset-2.tar.xz
- source = media-Set-allocation-limit-compatible-with-FFmpeg-4.3.patch
- source = intel-vp9-quirk.patch
+ source = https://github.com/stha09/chromium-patches/releases/download/chromium-88-patchset-3/chromium-88-patchset-3.tar.xz
source = wayland-egl.patch
- source = nvidia-vdpau.patch
- source = chromium-skia-harmony.patch
- sha256sums = e018547e54566410fb365d9f3dae10037c30fca5debe6ba8baceef3ad3b03d28
+ source = subpixel-anti-aliasing-in-FreeType-2.8.1.patch
+ sha256sums = 7dbdda0df8955811ada33a9505cad2f2e17f007827c435b591ba571c5dcd0147
sha256sums = SKIP
- sha256sums = 04917e3cd4307d8e31bfb0027a5dce6d086edb10ff8a716024fbb8bb0c7dccf1
+ sha256sums = 86859c11cfc8ba106a3826479c0bc759324a62150b271dd35d1a0f96e890f52f
sha256sums = babda4f5c1179825797496898d77334ac067149cac03d797ab27ac69671a7feb
- sha256sums = 2194fe22b9e5ccdc4a86da4e3572214f670c561486671f57c90636fd3cbfa43e
- sha256sums = 0f041d655335cd2a4773ae7ca5e301a0ff12c6c53f57b7cf6651c268e0420a1c
- sha256sums = a25fc6fccb84fd0a58a799661cd9c4ffeb2731fa49268f43aa7108f1542c5af6
+ sha256sums = e5a60a4c9d0544d3321cc241b4c7bd4adb0a885f090c6c6c21581eac8e3b4ba9
sha256sums = 34d08ea93cb4762cb33c7cffe931358008af32265fc720f2762f0179c3973574
- sha256sums = 8095bf73afbca7c2b07306c5b4dd8f79b66e1053fa4e58b07f71ef938be603f1
- sha256sums = 771292942c0901092a402cc60ee883877a99fb804cb54d568c8c6c94565a48e1
+ sha256sums = 1e2913e21c491d546e05f9b4edf5a6c7a22d89ed0b36ef692ca6272bcd5faec6
pkgname = ungoogled-chromium-git
diff --git a/PKGBUILD b/PKGBUILD
index 63fcd23b5842..d1d8170ae8c2 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -8,56 +8,46 @@
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
pkgname=ungoogled-chromium-git
-pkgver=85.0.4183.121.1.r0.ge46b774
+pkgver=88.0.4324.104.1.r3.ga9140d5
pkgrel=1
-_launcher_ver=6
-_gcc_patchset=2
+_launcher_ver=7
+_gcc_patchset=3
_pkgname=$(echo $pkgname | cut -d\- -f1-2)
_pkgver=$(echo $pkgver | cut -d\. -f1-4)
# ungoogled chromium variables
_uc_ver=master
_uc_usr=Eloston
-_uc_sum='SKIP'
-_uc_url="$_pkgname-$_uc_ver::git://github.com/$_uc_usr/ungoogled-chromium.git"
pkgdesc="A lightweight approach to removing Google web service dependency (master branch)"
arch=('x86_64')
url="https://github.com/Eloston/ungoogled-chromium"
license=('BSD')
depends=('gtk3' 'nss' 'alsa-lib' 'xdg-utils' 'libxss' 'libcups' 'libgcrypt'
- 'ttf-liberation' 'systemd' 'dbus' 'libpulse' 'pciutils' 'json-glib'
+ 'ttf-liberation' 'systemd' 'dbus' 'libpulse' 'pciutils'
'desktop-file-utils' 'hicolor-icon-theme')
makedepends=('python' 'python2' 'gperf' 'mesa' 'ninja' 'nodejs' 'git' 'libva'
- 'libpipewire02' 'clang' 'lld' 'gn-m85' 'java-runtime-headless'
+ 'libpipewire02' 'clang' 'lld' 'gn' 'java-runtime-headless'
'python2-setuptools')
-optdepends=('pepper-flash: support for Flash content'
- 'libpipewire02: WebRTC desktop sharing under Wayland'
+optdepends=('libpipewire02: WebRTC desktop sharing under Wayland'
'libva: hardware-accelerated video decode [experimental]'
'kdialog: needed for file dialogs in KDE'
'org.freedesktop.secrets: password storage backend on GNOME / Xfce'
'kwallet: for storing passwords in KWallet on KDE desktops')
provides=('chromium')
conflicts=('chromium')
-install=chromium.install
source=(https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$_pkgver.tar.xz
- $_uc_url
- chromium-launcher-$_launcher_ver.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v$_launcher_ver.tar.gz
+ $_pkgname-$_uc_ver::git://github.com/$_uc_usr/ungoogled-chromium.git
+ https://github.com/foutrelis/chromium-launcher/archive/v$_launcher_ver/chromium-launcher-$_launcher_ver.tar.gz
chromium-drirc-disable-10bpc-color-configs.conf
https://github.com/stha09/chromium-patches/releases/download/chromium-${pkgver%%.*}-patchset-$_gcc_patchset/chromium-${pkgver%%.*}-patchset-$_gcc_patchset.tar.xz
- media-Set-allocation-limit-compatible-with-FFmpeg-4.3.patch
- intel-vp9-quirk.patch
wayland-egl.patch
- nvidia-vdpau.patch
- chromium-skia-harmony.patch)
-sha256sums=('e018547e54566410fb365d9f3dae10037c30fca5debe6ba8baceef3ad3b03d28'
- $_uc_sum
- '04917e3cd4307d8e31bfb0027a5dce6d086edb10ff8a716024fbb8bb0c7dccf1'
+ subpixel-anti-aliasing-in-FreeType-2.8.1.patch)
+sha256sums=('7dbdda0df8955811ada33a9505cad2f2e17f007827c435b591ba571c5dcd0147'
+ 'SKIP'
+ '86859c11cfc8ba106a3826479c0bc759324a62150b271dd35d1a0f96e890f52f'
'babda4f5c1179825797496898d77334ac067149cac03d797ab27ac69671a7feb'
- '2194fe22b9e5ccdc4a86da4e3572214f670c561486671f57c90636fd3cbfa43e'
- '0f041d655335cd2a4773ae7ca5e301a0ff12c6c53f57b7cf6651c268e0420a1c'
- 'a25fc6fccb84fd0a58a799661cd9c4ffeb2731fa49268f43aa7108f1542c5af6'
+ 'e5a60a4c9d0544d3321cc241b4c7bd4adb0a885f090c6c6c21581eac8e3b4ba9'
'34d08ea93cb4762cb33c7cffe931358008af32265fc720f2762f0179c3973574'
- '8095bf73afbca7c2b07306c5b4dd8f79b66e1053fa4e58b07f71ef938be603f1'
- '771292942c0901092a402cc60ee883877a99fb804cb54d568c8c6c94565a48e1')
+ '1e2913e21c491d546e05f9b4edf5a6c7a22d89ed0b36ef692ca6272bcd5faec6')
# 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
@@ -103,25 +93,18 @@ prepare() {
third_party/blink/renderer/core/xml/parser/xml_document_parser.cc \
third_party/libxml/chromium/*.cc
- # https://crbug.com/1095962
- patch -Np1 -i ../media-Set-allocation-limit-compatible-with-FFmpeg-4.3.patch
+ # Upstream fixes
+ patch -Np1 -d third_party/skia <../subpixel-anti-aliasing-in-FreeType-2.8.1.patch
# Fixes for building with libstdc++ instead of libc++
- patch -Np1 -i ../patches/chromium-85-NearbyShareEncryptedMetadataKey-include.patch
- patch -Np1 -i ../patches/chromium-85-sim_hash-include.patch
-
- # https://crbug.com/skia/6663#c10
- patch -Np0 -i ../chromium-skia-harmony.patch
-
- # Intel KabyLake/GeminiLake VP9 quirk
- patch -Np1 -i ../intel-vp9-quirk.patch
+ patch -Np1 -i ../patches/chromium-87-openscreen-include.patch
+ patch -Np1 -i ../patches/chromium-88-CompositorFrameReporter-dcheck.patch
+ patch -Np1 -i ../patches/chromium-88-ideographicSpaceCharacter.patch
+ patch -Np1 -i ../patches/chromium-88-AXTreeFormatter-include.patch
# Wayland/EGL regression (crbug #1071528 #1071550)
patch -Np1 -i ../wayland-egl.patch
- # NVIDIA vdpau-wrapper
- patch -Np1 -i ../nvidia-vdpau.patch
-
# Ungoogled Chromium changes
_ungoogled_repo="$srcdir/$_pkgname-$_uc_ver"
_utils="${_ungoogled_repo}/utils"
@@ -208,7 +191,7 @@ build() {
CXXFLAGS+=' -Wno-unknown-warning-option'
msg2 'Configuring Chromium'
- gn-m85 gen out/Release --args="${_flags[*]}" --script-executable=/usr/bin/python2
+ gn gen out/Release --args="${_flags[*]}" --script-executable=python2
msg2 'Building Chromium'
ninja -C out/Release chrome chrome_sandbox chromedriver
}
diff --git a/chromium-skia-harmony.patch b/chromium-skia-harmony.patch
deleted file mode 100644
index c96d07e11489..000000000000
--- a/chromium-skia-harmony.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- 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/intel-vp9-quirk.patch b/intel-vp9-quirk.patch
deleted file mode 100644
index d39e0e207cfe..000000000000
--- a/intel-vp9-quirk.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc 2020-07-13 11:40:37.000000000 -0700
-+++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc 2020-07-14 23:59:45.986297984 -0700
-@@ -1175,6 +1175,9 @@
- // allocations.
- // TODO(crbug.com/911754): Enable for VP9 Profile 2.
- if (IsGeminiLakeOrLater() &&
-+#if defined(OS_LINUX)
-+ false &&
-+#endif
- (profile_ == VP9PROFILE_PROFILE0 || profile_ == VP8PROFILE_ANY ||
- (profile_ >= H264PROFILE_MIN && profile_ <= H264PROFILE_MAX))) {
- // Add one to the reference frames for the one being currently egressed, and
diff --git a/media-Set-allocation-limit-compatible-with-FFmpeg-4.3.patch b/media-Set-allocation-limit-compatible-with-FFmpeg-4.3.patch
deleted file mode 100644
index d9319a360386..000000000000
--- a/media-Set-allocation-limit-compatible-with-FFmpeg-4.3.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 7f4c7ff6b0f0e74338c885b0d5e5ef80fed597c3 Mon Sep 17 00:00:00 2001
-From: Dan Sanders <sandersd@chromium.org>
-Date: Tue, 11 Aug 2020 20:38:03 +0000
-Subject: [PATCH] [media] Set allocation limit compatible with FFmpeg 4.3
-
-Previously we set the limit to zero, meaning no limit, but FFmpeg 4.3
-will not allocate at all with that setting.
-
-Changed to std::numeric_limits<size_t>::max().
-
-Bug: 1095962
-Change-Id: I96820c21f794f2814e955ee75ff22dfd31804c29
-Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2349405
-Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
-Commit-Queue: Dan Sanders <sandersd@chromium.org>
-Cr-Commit-Position: refs/heads/master@{#796966}
----
- media/base/media.cc | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/media/base/media.cc b/media/base/media.cc
-index c282ee49a03..11e99c238ba 100644
---- a/media/base/media.cc
-+++ b/media/base/media.cc
-@@ -4,6 +4,9 @@
-
- #include "media/base/media.h"
-
-+#include <stdint.h>
-+#include <limits>
-+
- #include "base/allocator/buildflags.h"
- #include "base/command_line.h"
- #include "base/macros.h"
-@@ -41,7 +44,7 @@ class MediaInitializer {
-
- #if BUILDFLAG(USE_ALLOCATOR_SHIM)
- // Remove allocation limit from ffmpeg, so calls go down to shim layer.
-- av_max_alloc(0);
-+ av_max_alloc(std::numeric_limits<size_t>::max());
- #endif // BUILDFLAG(USE_ALLOCATOR_SHIM)
-
- #endif // BUILDFLAG(ENABLE_FFMPEG)
diff --git a/nvidia-vdpau.patch b/nvidia-vdpau.patch
deleted file mode 100644
index 8d879de7bfd8..000000000000
--- a/nvidia-vdpau.patch
+++ /dev/null
@@ -1,65 +0,0 @@
---- 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)
---- 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
diff --git a/subpixel-anti-aliasing-in-FreeType-2.8.1.patch b/subpixel-anti-aliasing-in-FreeType-2.8.1.patch
new file mode 100644
index 000000000000..c11b512c16ad
--- /dev/null
+++ b/subpixel-anti-aliasing-in-FreeType-2.8.1.patch
@@ -0,0 +1,100 @@
+From f25787b72c20e97cdeb74e037dc1ff56a88b45c6 Mon Sep 17 00:00:00 2001
+From: Ben Wagner <bungeman@google.com>
+Date: Tue, 1 Dec 2020 20:22:00 -0500
+Subject: [PATCH] Subpixel anti-aliasing in FreeType 2.8.1+
+
+FreeType 2.8.1 and later always provide some form of subpixel
+anti-aliasing.
+
+Bug: skia:10950,skia:6663
+Change-Id: I666cc942e73b73073cdabf900c25faa10d9aaf0f
+Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339861
+Reviewed-by: Herb Derby <herb@google.com>
+Commit-Queue: Ben Wagner <bungeman@google.com>
+---
+ src/ports/SkFontHost_FreeType.cpp | 33 ++++++++++++++++++++-----------
+ 1 file changed, 22 insertions(+), 11 deletions(-)
+
+diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp
+index 990eff4f5e..c0aeb792da 100644
+--- a/src/ports/SkFontHost_FreeType.cpp
++++ b/src/ports/SkFontHost_FreeType.cpp
+@@ -32,6 +32,7 @@
+ #include "src/utils/SkMatrix22.h"
+
+ #include <memory>
++#include <tuple>
+
+ #include <ft2build.h>
+ #include FT_ADVANCES_H
+@@ -147,13 +148,16 @@ public:
+ // *reinterpret_cast<void**>(&procPtr) = dlsym(self, "proc");
+ // because clang has not implemented DR573. See http://clang.llvm.org/cxx_dr_status.html .
+
+- FT_Int major, minor, patch;
+- FT_Library_Version(fLibrary, &major, &minor, &patch);
++ using Version = std::tuple<FT_Int, FT_Int, FT_Int>;
++ Version version;
++ FT_Library_Version(fLibrary, &std::get<0>(version),
++ &std::get<1>(version),
++ &std::get<2>(version));
+
+ #if SK_FREETYPE_MINIMUM_RUNTIME_VERSION >= 0x02070100
+ fGetVarDesignCoordinates = FT_Get_Var_Design_Coordinates;
+ #elif SK_FREETYPE_MINIMUM_RUNTIME_VERSION & SK_FREETYPE_DLOPEN
+- if (major > 2 || ((major == 2 && minor > 7) || (major == 2 && minor == 7 && patch >= 0))) {
++ if (Version(2,7,0) <= version) {
+ //The FreeType library is already loaded, so symbols are available in process.
+ void* self = dlopen(nullptr, RTLD_LAZY);
+ if (self) {
+@@ -166,7 +170,7 @@ public:
+ #if SK_FREETYPE_MINIMUM_RUNTIME_VERSION >= 0x02070200
+ FT_Set_Default_Properties(fLibrary);
+ #elif SK_FREETYPE_MINIMUM_RUNTIME_VERSION & SK_FREETYPE_DLOPEN
+- if (major > 2 || ((major == 2 && minor > 7) || (major == 2 && minor == 7 && patch >= 1))) {
++ if (Version(2,7,1) <= version) {
+ //The FreeType library is already loaded, so symbols are available in process.
+ void* self = dlopen(nullptr, RTLD_LAZY);
+ if (self) {
+@@ -185,7 +189,7 @@ public:
+ #if SK_FREETYPE_MINIMUM_RUNTIME_VERSION >= 0x02080000
+ fLightHintingIsYOnly = true;
+ #else
+- if (major > 2 || ((major == 2 && minor > 8) || (major == 2 && minor == 8 && patch >= 0))) {
++ if (Version(2,8,0) <= version) {
+ fLightHintingIsYOnly = true;
+ }
+ #endif
+@@ -194,7 +198,7 @@ public:
+ #if SK_FREETYPE_MINIMUM_RUNTIME_VERSION >= 0x02080100
+ fGetVarAxisFlags = FT_Get_Var_Axis_Flags;
+ #elif SK_FREETYPE_MINIMUM_RUNTIME_VERSION & SK_FREETYPE_DLOPEN
+- if (major > 2 || ((major == 2 && minor > 7) || (major == 2 && minor == 7 && patch >= 0))) {
++ if (Version(2,7,0) <= version) {
+ //The FreeType library is already loaded, so symbols are available in process.
+ void* self = dlopen(nullptr, RTLD_LAZY);
+ if (self) {
+@@ -204,11 +208,18 @@ public:
+ }
+ #endif
+
+- // Setup LCD filtering. This reduces color fringes for LCD smoothed glyphs.
+- // The default has changed over time, so this doesn't mean the same thing to all users.
+- if (FT_Library_SetLcdFilter(fLibrary, FT_LCD_FILTER_DEFAULT) == 0) {
+- fIsLCDSupported = true;
+- fLCDExtra = 2; //Using a filter adds one full pixel to each side.
++ fIsLCDSupported =
++ // Subpixel anti-aliasing may be unfiltered until the LCD filter is set.
++ // Newer versions may still need this, so this test with side effects must come first.
++ // The default has changed over time, so this doesn't mean the same thing to all users.
++ (FT_Library_SetLcdFilter(fLibrary, FT_LCD_FILTER_DEFAULT) == 0) ||
++
++ // In 2.8.1 and later FreeType always provides some form of subpixel anti-aliasing.
++ ((SK_FREETYPE_MINIMUM_RUNTIME_VERSION) >= 0x02080100) ||
++ (Version(2,8,1) <= version);
++
++ if (fIsLCDSupported) {
++ fLCDExtra = 2; // Using a filter may require up to one full pixel to each side.
+ }
+ }
+ ~FreeTypeLibrary() {