diff options
author | Maxim Baz | 2018-04-18 18:00:24 +0200 |
---|---|---|
committer | Maxim Baz | 2018-04-18 18:24:26 +0200 |
commit | 239ea0aff52b278e820db3730cc320a75a79832b (patch) | |
tree | a110cbe358494bede01e03c40bc3b5036966f329 | |
parent | d9ef5b88ee577836f5bcfa63c84d793f99162c95 (diff) | |
download | aur-239ea0aff52b278e820db3730cc320a75a79832b.tar.gz |
Update to 66.0.3359.117
-rw-r--r-- | .SRCINFO | 32 | ||||
-rw-r--r-- | PKGBUILD | 51 | ||||
-rw-r--r-- | allow-stat-in-Linux-for-GPU-process-for-a-list-of-files.patch | 88 | ||||
-rw-r--r-- | chromium-clang-r2.patch | 21 | ||||
-rw-r--r-- | chromium-math.h-r0.patch | 29 | ||||
-rw-r--r-- | chromium-stdint.patch | 21 | ||||
-rw-r--r-- | chromium-vaapi-init-r16.patch | 253 | ||||
-rw-r--r-- | chromium-vaapi-r18.patch (renamed from chromium-vaapi-r16.patch) | 77 | ||||
-rw-r--r-- | fix-frame-buttons-rendering-too-large-when-using-OSX.patch | 60 |
9 files changed, 132 insertions, 500 deletions
@@ -1,7 +1,7 @@ pkgbase = chromium-vaapi pkgdesc = Chromium compiled with VA-API support for Intel Graphics - pkgver = 65.0.3325.181 - pkgrel = 5 + pkgver = 66.0.3359.117 + pkgrel = 1 url = https://www.chromium.org/Home install = chromium.install arch = x86_64 @@ -34,7 +34,6 @@ pkgbase = chromium-vaapi depends = libva depends = flac depends = fontconfig - depends = libvpx depends = icu depends = opus depends = minizip @@ -52,30 +51,25 @@ pkgbase = chromium-vaapi optdepends = libva-intel-driver: Needed to support VA-API for Intel graphics cards provides = chromium conflicts = chromium - source = https://commondatastorage.googleapis.com/chromium-browser-official/chromium-65.0.3325.181.tar.xz + noextract = blink-tools-66.0.3359.117.tar.gz + source = https://commondatastorage.googleapis.com/chromium-browser-official/chromium-66.0.3359.117.tar.xz source = chromium-launcher-6.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v6.tar.gz - source = chromium-65.0.3325.181.txt::https://chromium.googlesource.com/chromium/src.git/+/65.0.3325.181?format=TEXT + source = chromium-66.0.3359.117.txt::https://chromium.googlesource.com/chromium/src/+/66.0.3359.117?format=TEXT + source = https://pkgbuild.com/~foutrelis/sources/chromium/blink-tools-66.0.3359.117.tar.gz source = fix-crash-in-is_cfi-true-builds-with-unbundled-ICU.patch - source = allow-stat-in-Linux-for-GPU-process-for-a-list-of-files.patch + source = fix-frame-buttons-rendering-too-large-when-using-OSX.patch source = chromium-skia-harmony.patch - source = chromium-clang-r2.patch - source = chromium-math.h-r0.patch - source = chromium-stdint.patch source = chromium-widevine.patch - source = chromium-vaapi-init-r16.patch - source = chromium-vaapi-r16.patch - sha256sums = 93666448c6b96ec83e6a35a64cff40db4eb92a154fe1db4e7dab4761d0e38687 + source = chromium-vaapi-r18.patch + sha256sums = 77c5a334644fdc303697b3864c9a6b709cee23ee384f4134308e820af4568ed6 sha256sums = 04917e3cd4307d8e31bfb0027a5dce6d086edb10ff8a716024fbb8bb0c7dccf1 - sha256sums = 2771c049b66c9aba3b945fe065f2610f164d55506eb5d71751a26aaf8b40d4ee + sha256sums = bf9600489198c5a873ef7b12e8ba42e04c667a59b898592ad1b416f66df13d7e + sha256sums = 922db9d6a69a22003caa72c507e1ccbf0c4ee2c254f00e243c97ca572bf1ec56 sha256sums = e3fb73b43bb8c69ff517e66b2cac73d6e759fd240003eb35598df9af442422fe - sha256sums = 4327289866d0b3006de62799ec06b07198a738e50e0a5c2e41ff62dbe00b4a2c + sha256sums = bd5e0e61df3f89172590801aea7c8ac75162c10c7fe83e262e96a14388d1633a sha256sums = feca54ab09ac0fc9d0626770a6b899a6ac5a12173c7d0c1005bc3964ec83e7b3 - sha256sums = 4495e8b29dae242c79ffe4beefc5171eb3c7aacb7e9aebfd2d4d69b9d8c958d3 - sha256sums = fe0ab86aa5b0072db730eccda3e1582ebed4af25815bfd49fe0da24cf63ca902 - sha256sums = c00d2506f1078b38a8ebec474a7318e76a61db1298afb40088a34210f137210f sha256sums = d6fdcb922e5a7fbe15759d39ccc8ea4225821c44d98054ce0f23f9d1f00c9808 - sha256sums = acae2de43c123f19523c4fca3af19c671acbe76f76bd40e285fe3b08cddb7044 - sha256sums = 5bc4f5dc5e9c8d71cf273338f65e82efcebc902e645affb35659532dcf9ad1af + sha256sums = 514f40accb2b4bc439df43f11bb7154a812eeb9fa61777b3d986cfa6bb109ebd pkgname = chromium-vaapi @@ -10,8 +10,8 @@ # Contributor: Daniel J Griffiths <ghost1227@archlinux.us> pkgname=chromium-vaapi -pkgver=65.0.3325.181 -pkgrel=5 +pkgver=66.0.3359.117 +pkgrel=1 _launcher_ver=6 pkgdesc="Chromium compiled with VA-API support for Intel Graphics" arch=('x86_64') @@ -32,29 +32,23 @@ optdepends=('pepper-flash: support for Flash content' install=chromium.install source=(https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$pkgver.tar.xz chromium-launcher-$_launcher_ver.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v$_launcher_ver.tar.gz - chromium-$pkgver.txt::https://chromium.googlesource.com/chromium/src.git/+/$pkgver?format=TEXT + chromium-$pkgver.txt::https://chromium.googlesource.com/chromium/src/+/$pkgver?format=TEXT + https://pkgbuild.com/~foutrelis/sources/chromium/blink-tools-$pkgver.tar.gz fix-crash-in-is_cfi-true-builds-with-unbundled-ICU.patch - allow-stat-in-Linux-for-GPU-process-for-a-list-of-files.patch + fix-frame-buttons-rendering-too-large-when-using-OSX.patch chromium-skia-harmony.patch - chromium-clang-r2.patch - chromium-math.h-r0.patch - chromium-stdint.patch chromium-widevine.patch - chromium-vaapi-init-r16.patch - chromium-vaapi-r16.patch) - -sha256sums=('93666448c6b96ec83e6a35a64cff40db4eb92a154fe1db4e7dab4761d0e38687' + chromium-vaapi-r18.patch) +noextract=(blink-tools-$pkgver.tar.gz) +sha256sums=('77c5a334644fdc303697b3864c9a6b709cee23ee384f4134308e820af4568ed6' '04917e3cd4307d8e31bfb0027a5dce6d086edb10ff8a716024fbb8bb0c7dccf1' - '2771c049b66c9aba3b945fe065f2610f164d55506eb5d71751a26aaf8b40d4ee' + 'bf9600489198c5a873ef7b12e8ba42e04c667a59b898592ad1b416f66df13d7e' + '922db9d6a69a22003caa72c507e1ccbf0c4ee2c254f00e243c97ca572bf1ec56' 'e3fb73b43bb8c69ff517e66b2cac73d6e759fd240003eb35598df9af442422fe' - '4327289866d0b3006de62799ec06b07198a738e50e0a5c2e41ff62dbe00b4a2c' + 'bd5e0e61df3f89172590801aea7c8ac75162c10c7fe83e262e96a14388d1633a' 'feca54ab09ac0fc9d0626770a6b899a6ac5a12173c7d0c1005bc3964ec83e7b3' - '4495e8b29dae242c79ffe4beefc5171eb3c7aacb7e9aebfd2d4d69b9d8c958d3' - 'fe0ab86aa5b0072db730eccda3e1582ebed4af25815bfd49fe0da24cf63ca902' - 'c00d2506f1078b38a8ebec474a7318e76a61db1298afb40088a34210f137210f' 'd6fdcb922e5a7fbe15759d39ccc8ea4225821c44d98054ce0f23f9d1f00c9808' - 'acae2de43c123f19523c4fca3af19c671acbe76f76bd40e285fe3b08cddb7044' - '5bc4f5dc5e9c8d71cf273338f65e82efcebc902e645affb35659532dcf9ad1af') + '514f40accb2b4bc439df43f11bb7154a812eeb9fa61777b3d986cfa6bb109ebd') # 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 @@ -68,7 +62,7 @@ declare -gA _system_libs=( [libdrm]= [libjpeg]=libjpeg #[libpng]=libpng # https://crbug.com/752403#c10 - [libvpx]=libvpx + #[libvpx]=libvpx [libwebp]=libwebp #[libxml]=libxml2 # https://crbug.com/736026 [libxslt]=libxslt @@ -94,6 +88,9 @@ _google_default_client_secret=0ZChLK6AxeA3Isu96MkwqDR4 prepare() { cd "$srcdir/chromium-$pkgver" + # https://crbug.com/832283 + tar xfC ../blink-tools-$pkgver.tar.gz third_party/blink/tools/ + # https://crbug.com/710701 local _chrome_build_hash=$(base64 -d ../chromium-$pkgver.txt | grep -Po '^parent \K[0-9a-f]{40}$') @@ -113,20 +110,19 @@ prepare() { sed "s/@WIDEVINE_VERSION@/Pinkie Pie/" ../chromium-widevine.patch | patch -Np1 + # Work around broken screen sharing in Google Meet + # https://crbug.com/829916#c16 + sed -i 's/"Chromium/"Chrome/' chrome/common/chrome_content_client_constants.cc + # https://crbug.com/822820 patch -Np1 -i ../fix-crash-in-is_cfi-true-builds-with-unbundled-ICU.patch - # https://crbug.com/817400 - patch -Np1 -i ../allow-stat-in-Linux-for-GPU-process-for-a-list-of-files.patch + # https://crbug.com/821881 + patch -Np1 -i ../fix-frame-buttons-rendering-too-large-when-using-OSX.patch # https://crbug.com/skia/6663#c10 patch -Np4 -i ../chromium-skia-harmony.patch - # Fixes from Gentoo - patch -Np1 -i ../chromium-clang-r2.patch - patch -Np1 -i ../chromium-math.h-r0.patch - patch -Np1 -i ../chromium-stdint.patch - # Force script incompatible with Python 3 to use /usr/bin/python2 sed -i '1s|python$|&2|' third_party/dom_distiller_js/protoc_plugins/*.py @@ -135,8 +131,7 @@ prepare() { # VA-API patch msg2 'Applying VA-API patches' - patch -Np1 -i ../chromium-vaapi-init-r16.patch - patch -Np1 -i ../chromium-vaapi-r16.patch + patch -Np1 -i ../chromium-vaapi-r18.patch # Remove bundled libraries for which we will use the system copies; this # *should* do what the remove_bundled_libraries.py script does, with the diff --git a/allow-stat-in-Linux-for-GPU-process-for-a-list-of-files.patch b/allow-stat-in-Linux-for-GPU-process-for-a-list-of-files.patch deleted file mode 100644 index 327d8c3bb569..000000000000 --- a/allow-stat-in-Linux-for-GPU-process-for-a-list-of-files.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 6b1b6d3a8555075e23cca89335e855d55f35fba9 Mon Sep 17 00:00:00 2001 -From: Zhenyao Mo <zmo@chromium.org> -Date: Thu, 29 Mar 2018 23:48:19 +0000 -Subject: [PATCH] Allow `stat` in Linux for GPU process for a list of files. - -This is to unblock certain NVidia driver's glReadPixels calls in the sandboxed -GPU process. - -Note that the needed file /dev/nvidiactl is already in the list for read/write. - -BUG=817400 -TEST=manual -R=tsepez@chromium.org - -Change-Id: I9074a8335a9c4df1487f5a288d5e284bbedf67c3 -Reviewed-on: https://chromium-review.googlesource.com/965462 -Reviewed-by: Zhenyao Mo <zmo@chromium.org> -Reviewed-by: Tom Sepez <tsepez@chromium.org> -Reviewed-by: Robert Sesek <rsesek@chromium.org> -Reviewed-by: Kenneth Russell <kbr@chromium.org> -Commit-Queue: Zhenyao Mo <zmo@chromium.org> -Cr-Commit-Position: refs/heads/master@{#547027} ---- - content/gpu/gpu_sandbox_hook_linux.cc | 5 ++++- - .../service_manager/sandbox/linux/bpf_gpu_policy_linux.cc | 15 ++++++++++++++- - 2 files changed, 18 insertions(+), 2 deletions(-) - -diff --git a/content/gpu/gpu_sandbox_hook_linux.cc b/content/gpu/gpu_sandbox_hook_linux.cc -index ddd7b99485fe..cd914e2f9926 100644 ---- a/content/gpu/gpu_sandbox_hook_linux.cc -+++ b/content/gpu/gpu_sandbox_hook_linux.cc -@@ -153,6 +153,7 @@ void AddStandardGpuWhiteList(std::vector<BrokerFilePermission>* permissions) { - static const char kDriCardBasePath[] = "/dev/dri/card"; - static const char kNvidiaCtlPath[] = "/dev/nvidiactl"; - static const char kNvidiaDeviceBasePath[] = "/dev/nvidia"; -+ static const char kNvidiaDeviceModeSetPath[] = "/dev/nvidia-modeset"; - static const char kNvidiaParamsPath[] = "/proc/driver/nvidia/params"; - static const char kDevShm[] = "/dev/shm/"; - -@@ -172,6 +173,8 @@ void AddStandardGpuWhiteList(std::vector<BrokerFilePermission>* permissions) { - permissions->push_back(BrokerFilePermission::ReadWrite( - base::StringPrintf("%s%d", kNvidiaDeviceBasePath, i))); - } -+ permissions->push_back( -+ BrokerFilePermission::ReadWrite(kNvidiaDeviceModeSetPath)); - permissions->push_back(BrokerFilePermission::ReadOnly(kNvidiaParamsPath)); - } - -@@ -262,9 +265,9 @@ sandbox::syscall_broker::BrokerCommandSet CommandSetForGPU( - sandbox::syscall_broker::BrokerCommandSet command_set; - command_set.set(sandbox::syscall_broker::COMMAND_ACCESS); - command_set.set(sandbox::syscall_broker::COMMAND_OPEN); -+ command_set.set(sandbox::syscall_broker::COMMAND_STAT); - if (IsChromeOS() && options.use_amd_specific_policies) { - command_set.set(sandbox::syscall_broker::COMMAND_READLINK); -- command_set.set(sandbox::syscall_broker::COMMAND_STAT); - } - return command_set; - } -diff --git a/services/service_manager/sandbox/linux/bpf_gpu_policy_linux.cc b/services/service_manager/sandbox/linux/bpf_gpu_policy_linux.cc -index bc16952c0898..d683aacc76f4 100644 ---- a/services/service_manager/sandbox/linux/bpf_gpu_policy_linux.cc -+++ b/services/service_manager/sandbox/linux/bpf_gpu_policy_linux.cc -@@ -61,7 +61,20 @@ ResultExpr GpuProcessPolicy::EvaluateSyscall(int sysno) const { - case __NR_open: - #endif // !defined(__aarch64__) - case __NR_faccessat: -- case __NR_openat: { -+ case __NR_openat: -+#if defined(__NR_stat) -+ case __NR_stat: -+#endif -+#if defined(__NR_stat64) -+ case __NR_stat64: -+#endif -+#if defined(__NR_fstatat) -+ case __NR_fstatat: -+#endif -+#if defined(__NR_newfstatat) -+ case __NR_newfstatat: -+#endif -+ { - auto* broker_process = SandboxLinux::GetInstance()->broker_process(); - DCHECK(broker_process); - return Trap(BrokerProcess::SIGSYS_Handler, broker_process); --- -2.16.2 - diff --git a/chromium-clang-r2.patch b/chromium-clang-r2.patch deleted file mode 100644 index aaee16717643..000000000000 --- a/chromium-clang-r2.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- a/build/config/compiler/BUILD.gn -+++ b/build/config/compiler/BUILD.gn -@@ -422,18 +422,6 @@ - cflags += [ "-fcolor-diagnostics" ] - } - -- # TODO(hans): Remove this once Clang generates better optimized debug info by -- # default. https://crbug.com/765793 -- if (is_clang && !is_nacl && current_toolchain == host_toolchain && -- target_os != "chromeos") { -- cflags += [ -- "-Xclang", -- "-mllvm", -- "-Xclang", -- "-instcombine-lower-dbg-declare=0", -- ] -- } -- - # Print absolute paths in diagnostics. There is no precedent for doing this - # on Linux/Mac (GCC doesn't support it), but MSVC does this with /FC and - # Windows developers rely on it (crbug.com/636109) so only do this on Windows. diff --git a/chromium-math.h-r0.patch b/chromium-math.h-r0.patch deleted file mode 100644 index 6c7c747053a1..000000000000 --- a/chromium-math.h-r0.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 9f63f94a11abc34d40ede8b8712fa15b5844a8c0 Mon Sep 17 00:00:00 2001 -From: Tom Anderson <thomasanderson@chromium.org> -Date: Sat, 27 Jan 2018 20:03:37 +0000 -Subject: [PATCH] Fix build with glibc 2.27 - -BUG=806340 -TBR=hamelphi@chromium.org - -Change-Id: Ib4e5091212d874d9ad88f3e9a1fdfee3ed7e0d5e -Reviewed-on: https://chromium-review.googlesource.com/890059 -Reviewed-by: Thomas Anderson <thomasanderson@chromium.org> -Reviewed-by: Philippe Hamel <hamelphi@chromium.org> -Commit-Queue: Thomas Anderson <thomasanderson@chromium.org> -Cr-Commit-Position: refs/heads/master@{#532249} ---- - -diff --git a/components/assist_ranker/ranker_example_util.cc b/components/assist_ranker/ranker_example_util.cc -index 54d4dbd..ceedd8f 100644 ---- a/components/assist_ranker/ranker_example_util.cc -+++ b/components/assist_ranker/ranker_example_util.cc -@@ -2,6 +2,8 @@ - // Use of this source code is governed by a BSD-style license that can be - // found in the LICENSE file. - -+#include <math.h> -+ - #include "components/assist_ranker/ranker_example_util.h" - #include "base/bit_cast.h" - #include "base/format_macros.h" diff --git a/chromium-stdint.patch b/chromium-stdint.patch deleted file mode 100644 index 877443954faa..000000000000 --- a/chromium-stdint.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 0235c2b657d936f3cdb09053776e5929fc84704b Mon Sep 17 00:00:00 2001 -From: Tomas Popela <tomas.popela@gmail.com> -Date: Wed, 31 Jan 2018 18:57:07 +0000 -Subject: [PATCH] Add missing stdint include - -diff --git a/chrome/browser/vr/sample_queue.cc b/chrome/browser/vr/sample_queue.cc -index c2ca777ce90c..53cb3aab1576 100644 ---- a/chrome/browser/vr/sample_queue.cc -+++ b/chrome/browser/vr/sample_queue.cc -@@ -2,6 +2,8 @@ - // Use of this source code is governed by a BSD-style license that can be - // found in the LICENSE file. - -+#include <stdint.h> -+ - #include "chrome/browser/vr/sample_queue.h" - - namespace vr { --- -2.16.2 - diff --git a/chromium-vaapi-init-r16.patch b/chromium-vaapi-init-r16.patch deleted file mode 100644 index 8b49d2a08e04..000000000000 --- a/chromium-vaapi-init-r16.patch +++ /dev/null @@ -1,253 +0,0 @@ -From 281edc278272f0650fc190c8539d443ac59157bc Mon Sep 17 00:00:00 2001 -From: Daniel Charles <daniel.charles@intel.com> -Date: Thu, 08 Feb 2018 02:36:51 +0000 -Subject: [PATCH] vaapi initialization: move it to vaapi_wrapper - -vaapi loading of libraries happens on the Pre and Post Sandbox -functions. Moving dynamic loading of libaries, i.e. libva,libva-drm -and i965_drv_video shared libraries to vaapi_wrapper. - -When calling PreSandbox function in vaapi_wrapper libva will open -i965_drv_video shared library and both will be available for use - -BUG=785117 -TEST=video initialization of h/w dec/enc, VAVDA/VAVEA/VAJDA subjective - testing and include unittests and autotests - -Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel -Change-Id: I862bb49f1167d7437e80387882cb9081ad53f54b -Signed-off-by: Daniel Charles <daniel.charles@intel.com> -Reviewed-on: https://chromium-review.googlesource.com/666138 -Commit-Queue: Miguel Casas <mcasas@chromium.org> -Reviewed-by: Kenneth Russell <kbr@chromium.org> -Reviewed-by: Antoine Labour <piman@chromium.org> -Reviewed-by: Dongseong Hwang <dongseong.hwang@intel.com> -Reviewed-by: Pawel Osciak <posciak@chromium.org> -Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org> -Cr-Commit-Position: refs/heads/master@{#535274} ---- - -diff --git a/content/gpu/gpu_sandbox_hook_linux.cc b/content/gpu/gpu_sandbox_hook_linux.cc -index e69e23e..5c4013c 100644 ---- a/content/gpu/gpu_sandbox_hook_linux.cc -+++ b/content/gpu/gpu_sandbox_hook_linux.cc -@@ -29,10 +29,6 @@ - #include "services/service_manager/sandbox/linux/bpf_gpu_policy_linux.h" - #include "services/service_manager/sandbox/linux/sandbox_linux.h" - --#if BUILDFLAG(USE_VAAPI) --#include <va/va_version.h> --#endif -- - using sandbox::bpf_dsl::Policy; - using sandbox::syscall_broker::BrokerFilePermission; - using sandbox::syscall_broker::BrokerProcess; -@@ -48,22 +44,6 @@ - #endif - } - --inline bool IsArchitectureX86_64() { --#if defined(__x86_64__) -- return true; --#else -- return false; --#endif --} -- --inline bool IsArchitectureI386() { --#if defined(__i386__) -- return true; --#else -- return false; --#endif --} -- - inline bool IsArchitectureArm() { - #if defined(ARCH_CPU_ARM_FAMILY) - return true; -@@ -88,14 +68,6 @@ - #endif - } - --inline bool IsLibVAVersion2() { --#if BUILDFLAG(USE_VAAPI) && VA_MAJOR_VERSION == 1 -- return true; --#else -- return false; --#endif --} -- - constexpr int dlopen_flag = RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE; - - void AddV4L2GpuWhitelist( -@@ -270,50 +242,6 @@ - } - } - --void LoadStandardLibraries( -- const service_manager::SandboxSeccompBPF::Options& options) { -- if (IsArchitectureX86_64() || IsArchitectureI386()) { -- // Accelerated video dlopen()'s some shared objects -- // inside the sandbox, so preload them now. -- if (IsAcceleratedVideoEnabled(options)) { -- if (IsLibVAVersion2()) { -- if (IsArchitectureX86_64()) { -- dlopen("/usr/lib64/va/drivers/i965_drv_video.so", dlopen_flag); -- dlopen("/usr/lib64/va/drivers/hybrid_drv_video.so", dlopen_flag); -- } else if (IsArchitectureI386()) { -- dlopen("/usr/lib/va/drivers/i965_drv_video.so", dlopen_flag); -- } -- dlopen("libva.so.2", dlopen_flag); --#if defined(USE_OZONE) -- dlopen("libva-drm.so.2", dlopen_flag); --#endif -- } else { -- // If we are linked against libva 1, we have two cases to handle: -- // - the sysroot includes both libva 1 and 2, in which case the drivers -- // are in /usr/lib{64}/va1/ -- // - the sysroot only includes libva 1, in which case the drivers are -- // are in /usr/lib{64}/va/ -- // This is ugly, but temporary until all builds have switched to libva 2. -- if (IsArchitectureX86_64()) { -- if (!dlopen("/usr/lib64/va1/drivers/i965_drv_video.so", dlopen_flag)) -- dlopen("/usr/lib64/va/drivers/i965_drv_video.so", dlopen_flag); -- if (!dlopen("/usr/lib64/va1/drivers/hybrid_drv_video.so", dlopen_flag)) -- dlopen("/usr/lib64/va/drivers/hybrid_drv_video.so", dlopen_flag); -- } else if (IsArchitectureI386()) { -- if (!dlopen("/usr/lib/va1/drivers/i965_drv_video.so", dlopen_flag)) -- dlopen("/usr/lib/va/drivers/i965_drv_video.so", dlopen_flag); -- } -- dlopen("libva.so.1", dlopen_flag); --#if defined(USE_OZONE) -- dlopen("libva-drm.so.1", dlopen_flag); --#elif defined(USE_X11) -- dlopen("libva-x11.so.1", dlopen_flag); --#endif -- } -- } -- } --} -- - bool LoadLibrariesForGpu( - const service_manager::SandboxSeccompBPF::Options& options) { - if (IsChromeOS()) { -@@ -326,7 +254,6 @@ - if (options.use_amd_specific_policies) - return LoadAmdGpuLibraries(); - } -- LoadStandardLibraries(options); - return true; - } - -diff --git a/media/gpu/vaapi/vaapi_wrapper.cc b/media/gpu/vaapi/vaapi_wrapper.cc -index bc3d735..7421a74 100644 ---- a/media/gpu/vaapi/vaapi_wrapper.cc -+++ b/media/gpu/vaapi/vaapi_wrapper.cc -@@ -48,6 +48,11 @@ - using media_gpu_vaapi::kModuleVa_x11; - #endif - using media_gpu_vaapi::InitializeStubs; -+using media_gpu_vaapi::IsVaInitialized; -+#if defined(USE_X11) -+using media_gpu_vaapi::IsVa_x11Initialized; -+#endif -+using media_gpu_vaapi::IsVa_drmInitialized; - using media_gpu_vaapi::StubPathMap; - - #define LOG_VA_ERROR_AND_REPORT(va_error, err_msg) \ -@@ -166,9 +171,6 @@ - void SetDrmFd(base::PlatformFile fd) { drm_fd_.reset(HANDLE_EINTR(dup(fd))); } - - private: -- // Returns false on init failure. -- static bool PostSandboxInitialization(); -- - // Protected by |va_lock_|. - int refcount_; - -@@ -203,41 +205,17 @@ - VADisplayState::Get()->SetDrmFd(drm_file.GetPlatformFile()); - } - --// static --bool VADisplayState::PostSandboxInitialization() { -- const std::string va_suffix(std::to_string(VA_MAJOR_VERSION + 1)); -- StubPathMap paths; -- -- paths[kModuleVa].push_back(std::string("libva.so.") + va_suffix); -- paths[kModuleVa_drm].push_back(std::string("libva-drm.so.") + va_suffix); --#if defined(USE_X11) -- // libva-x11 does not exist on libva >= 2 -- if (VA_MAJOR_VERSION == 0) -- paths[kModuleVa_x11].push_back("libva-x11.so.1"); --#endif -- -- const bool success = InitializeStubs(paths); -- if (!success) { -- static const char kErrorMsg[] = "Failed to initialize VAAPI libs"; --#if defined(OS_CHROMEOS) -- // When Chrome runs on Linux with target_os="chromeos", do not log error -- // message without VAAPI libraries. -- LOG_IF(ERROR, base::SysInfo::IsRunningOnChromeOS()) << kErrorMsg; --#else -- DVLOG(1) << kErrorMsg; --#endif -- } -- return success; --} -- - VADisplayState::VADisplayState() - : refcount_(0), va_display_(nullptr), va_initialized_(false) {} - - bool VADisplayState::Initialize() { - va_lock_.AssertAcquired(); - -- static bool result = PostSandboxInitialization(); -- if (!result) -+ if (!IsVaInitialized() || -+#if defined(USE_X11) -+ !IsVa_x11Initialized() || -+#endif -+ !IsVa_drmInitialized()) - return false; - - if (refcount_++ > 0) -@@ -1169,6 +1147,38 @@ - // static - void VaapiWrapper::PreSandboxInitialization() { - VADisplayState::PreSandboxInitialization(); -+ -+ const std::string va_suffix(std::to_string(VA_MAJOR_VERSION + 1)); -+ StubPathMap paths; -+ -+ paths[kModuleVa].push_back(std::string("libva.so.") + va_suffix); -+ paths[kModuleVa_drm].push_back(std::string("libva-drm.so.") + va_suffix); -+#if defined(USE_X11) -+ paths[kModuleVa_x11].push_back(std::string("libva-x11.so.") + va_suffix); -+#endif -+ -+ // InitializeStubs dlopen() VA-API libraries -+ // libva.so -+ // libva-x11.so (X11) -+ // libva-drm.so (X11 and Ozone). -+ static bool result = InitializeStubs(paths); -+ if (!result) { -+ static const char kErrorMsg[] = "Failed to initialize VAAPI libs"; -+#if defined(OS_CHROMEOS) -+ // When Chrome runs on Linux with target_os="chromeos", do not log error -+ // message without VAAPI libraries. -+ LOG_IF(ERROR, base::SysInfo::IsRunningOnChromeOS()) << kErrorMsg; -+#else -+ DVLOG(1) << kErrorMsg; -+#endif -+ } -+ -+ // VASupportedProfiles::Get creates VADisplayState and in so doing -+ // driver associated libraries are dlopen(), to know: -+ // i965_drv_video.so -+ // hybrid_drv_video.so (platforms that support it) -+ // libcmrt.so (platforms that support it) -+ VASupportedProfiles::Get(); - } - - VaapiWrapper::VaapiWrapper() diff --git a/chromium-vaapi-r16.patch b/chromium-vaapi-r18.patch index 283582d0b4c5..6ae81e139be0 100644 --- a/chromium-vaapi-r16.patch +++ b/chromium-vaapi-r18.patch @@ -1,4 +1,4 @@ -From 4bf343ab8c4a538205f9c1e96a661e40620c716b Mon Sep 17 00:00:00 2001 +From e95d904578c265a84f117d7d5eff598423f9283d Mon Sep 17 00:00:00 2001 From: Daniel Charles <daniel.charles@intel.com> Date: Fri, 09 Feb 2018 14:39:27 -0800 Subject: [PATCH] Enable VAVDA, VAVEA and VAJDA on linux with VAAPI only @@ -29,14 +29,14 @@ TEST=subjective testing with VAVDA,VAVEA and VAJDA, autotest for encoder have libva/intel-vaapi-driver installed and not installed in the system repeat on different hardware families -Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel +Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel Change-Id: Ifbbf5c9e5221a8b5733fc6d4d0cf984a1f103171 Signed-off-by: Daniel Charles <daniel.charles@intel.com> --- --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc -@@ -1249,12 +1249,14 @@ const FeatureEntry kFeatureEntries[] = { +@@ -1234,12 +1234,14 @@ const FeatureEntry kFeatureEntries[] = { flag_descriptions::kUiPartialSwapDescription, kOsAll, SINGLE_DISABLE_VALUE_TYPE(switches::kUIDisablePartialSwap)}, #if BUILDFLAG(ENABLE_WEBRTC) @@ -51,7 +51,7 @@ Signed-off-by: Daniel Charles <daniel.charles@intel.com> {"enable-webrtc-hw-h264-encoding", flag_descriptions::kWebrtcHwH264EncodingName, flag_descriptions::kWebrtcHwH264EncodingDescription, kOsAndroid | kOsCrOS, -@@ -1550,6 +1552,13 @@ const FeatureEntry kFeatureEntries[] = { +@@ -1553,6 +1555,13 @@ const FeatureEntry kFeatureEntries[] = { flag_descriptions::kShowTouchHudDescription, kOsCrOS, SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)}, #endif // OS_CHROMEOS @@ -65,7 +65,7 @@ Signed-off-by: Daniel Charles <daniel.charles@intel.com> { "disable-accelerated-video-decode", flag_descriptions::kAcceleratedVideoDecodeName, -@@ -1557,6 +1566,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -1560,6 +1569,7 @@ const FeatureEntry kFeatureEntries[] = { kOsMac | kOsWin | kOsCrOS | kOsAndroid, SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode), }, @@ -73,7 +73,7 @@ Signed-off-by: Daniel Charles <daniel.charles@intel.com> #if defined(OS_WIN) {"enable-hdr", flag_descriptions::kEnableHDRName, flag_descriptions::kEnableHDRDescription, kOsWin, -@@ -2268,12 +2278,17 @@ const FeatureEntry kFeatureEntries[] = { +@@ -2283,12 +2293,17 @@ const FeatureEntry kFeatureEntries[] = { FEATURE_VALUE_TYPE(features::kOpenVR)}, #endif // ENABLE_OPENVR #endif // ENABLE_VR @@ -118,7 +118,7 @@ Signed-off-by: Daniel Charles <daniel.charles@intel.com> ::switches::kDisableBlinkFeatures, ::switches::kDisableCastStreamingHWEncoding, ::switches::kDisableDistanceFieldText, -@@ -164,7 +170,7 @@ void DeriveCommandLine(const GURL& start +@@ -163,7 +169,7 @@ void DeriveCommandLine(const GURL& start ::switches::kDisableWebGLImageChromium, ::switches::kEnableWebGLImageChromium, ::switches::kEnableWebVR, @@ -143,7 +143,7 @@ Signed-off-by: Daniel Charles <daniel.charles@intel.com> const char kAcceleratedVideoDecodeName[] = "Hardware-accelerated video decode"; const char kAcceleratedVideoDecodeDescription[] = "Hardware-accelerated video decode where available."; -@@ -1597,6 +1604,7 @@ const char kWebrtcEchoCanceller3Name[] = +@@ -1730,6 +1737,7 @@ const char kWebrtcEchoCanceller3Name[] = const char kWebrtcEchoCanceller3Description[] = "Experimental WebRTC echo canceller (AEC3)."; @@ -151,7 +151,7 @@ Signed-off-by: Daniel Charles <daniel.charles@intel.com> const char kWebrtcHwDecodingName[] = "WebRTC hardware video decoding"; const char kWebrtcHwDecodingDescription[] = "Support in WebRTC for decoding video streams using platform hardware."; -@@ -1604,6 +1612,7 @@ const char kWebrtcHwDecodingDescription[ +@@ -1737,6 +1745,7 @@ const char kWebrtcHwDecodingDescription[ const char kWebrtcHwEncodingName[] = "WebRTC hardware video encoding"; const char kWebrtcHwEncodingDescription[] = "Support in WebRTC for encoding video streams using platform hardware."; @@ -159,7 +159,7 @@ Signed-off-by: Daniel Charles <daniel.charles@intel.com> const char kWebrtcHwH264EncodingName[] = "WebRTC hardware h264 video encoding"; const char kWebrtcHwH264EncodingDescription[] = -@@ -2434,14 +2443,16 @@ const char kTranslateNewUxDescription[] +@@ -2561,14 +2570,16 @@ const char kTabStripKeyboardFocusDescrip // Chrome OS ------------------------------------------------------------------- @@ -190,7 +190,7 @@ Signed-off-by: Daniel Charles <daniel.charles@intel.com> extern const char kAcceleratedVideoDecodeName[]; extern const char kAcceleratedVideoDecodeDescription[]; -@@ -1498,13 +1502,17 @@ extern const char kPermissionPromptPersi +@@ -1569,13 +1573,17 @@ extern const char kPermissionPromptPersi #endif // defined(OS_MACOSX) @@ -213,7 +213,7 @@ Signed-off-by: Daniel Charles <daniel.charles@intel.com> --- a/content/browser/gpu/compositor_util.cc +++ b/content/browser/gpu/compositor_util.cc -@@ -98,7 +98,11 @@ const GpuFeatureData GetGpuFeatureData(s +@@ -99,7 +99,11 @@ const GpuFeatureData GetGpuFeatureData(s {"video_decode", manager->GetFeatureStatus( gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE), @@ -227,7 +227,7 @@ Signed-off-by: Daniel Charles <daniel.charles@intel.com> true}, --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc -@@ -120,7 +120,7 @@ static const char* const kSwitchNames[] +@@ -132,7 +132,7 @@ static const char* const kSwitchNames[] switches::kDisableGLExtensions, switches::kDisableLogging, switches::kDisableShaderNameHashing, @@ -238,7 +238,7 @@ Signed-off-by: Daniel Charles <daniel.charles@intel.com> #if defined(OS_WIN) --- a/content/browser/renderer_host/media/video_capture_browsertest.cc +++ b/content/browser/renderer_host/media/video_capture_browsertest.cc -@@ -164,8 +164,13 @@ class VideoCaptureBrowserTest : public C +@@ -163,8 +163,13 @@ class VideoCaptureBrowserTest : public C base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kUseFakeJpegDecodeAccelerator); } else { @@ -282,7 +282,7 @@ Signed-off-by: Daniel Charles <daniel.charles@intel.com> return; --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc -@@ -2530,7 +2530,11 @@ void RenderProcessHostImpl::PropagateBro +@@ -2524,7 +2524,11 @@ void RenderProcessHostImpl::PropagateBro switches::kDefaultTileHeight, switches::kDisable2dCanvasImageChromium, switches::kDisableAcceleratedJpegDecoding, @@ -294,7 +294,7 @@ Signed-off-by: Daniel Charles <daniel.charles@intel.com> switches::kDisableBackgroundTimerThrottling, switches::kDisableBreakpad, switches::kDisableCompositorUkmForTests, -@@ -2663,8 +2667,10 @@ void RenderProcessHostImpl::PropagateBro +@@ -2658,8 +2662,10 @@ void RenderProcessHostImpl::PropagateBro switches::kDisableMojoRenderer, #endif #if BUILDFLAG(ENABLE_WEBRTC) @@ -323,8 +323,8 @@ Signed-off-by: Daniel Charles <daniel.charles@intel.com> private: --- a/content/gpu/BUILD.gn +++ b/content/gpu/BUILD.gn -@@ -125,4 +125,8 @@ target(link_target_type, "gpu_sources") - if (is_desktop_linux && (!is_chromecast || is_cast_desktop_build)) { +@@ -130,4 +130,8 @@ target(link_target_type, "gpu_sources") + (!is_chromecast || is_cast_desktop_build)) { configs += [ "//build/config/linux/dri" ] } + @@ -334,7 +334,7 @@ Signed-off-by: Daniel Charles <daniel.charles@intel.com> } --- a/content/gpu/gpu_main.cc +++ b/content/gpu/gpu_main.cc -@@ -273,7 +273,7 @@ int GpuMain(const MainFunctionParams& pa +@@ -286,7 +286,7 @@ int GpuMain(const MainFunctionParams& pa base::PlatformThread::SetName("CrGpuMain"); @@ -343,7 +343,7 @@ Signed-off-by: Daniel Charles <daniel.charles@intel.com> // Set thread priority before sandbox initialization. base::PlatformThread::SetCurrentThreadPriority(base::ThreadPriority::DISPLAY); #endif -@@ -302,7 +302,7 @@ int GpuMain(const MainFunctionParams& pa +@@ -315,7 +315,7 @@ int GpuMain(const MainFunctionParams& pa GetContentClient()->SetGpuInfo(gpu_init->gpu_info()); base::ThreadPriority io_thread_priority = base::ThreadPriority::NORMAL; @@ -362,7 +362,7 @@ Signed-off-by: Daniel Charles <daniel.charles@intel.com> #include "content/browser/gpu/gpu_process_host.h" #include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" -@@ -55,10 +56,18 @@ const gpu::GpuPreferences GetGpuPreferen +@@ -55,9 +56,17 @@ const gpu::GpuPreferences GetGpuPreferen gpu_preferences.in_process_gpu = command_line->HasSwitch(switches::kInProcessGPU); gpu_preferences.disable_accelerated_video_decode = @@ -376,12 +376,10 @@ Signed-off-by: Daniel Charles <daniel.charles@intel.com> + !command_line->HasSwitch(switches::kEnableAcceleratedVideo); +#else command_line->HasSwitch(switches::kDisableAcceleratedVideoEncode); --#if BUILDFLAG(ENABLE_WEBRTC) +#endif -+#if BUILDFLAG(ENABLE_WEBRTC) && (defined(OS_CHROMEOS) || defined(OS_ANDROID)) - gpu_preferences.disable_web_rtc_hw_encoding = - command_line->HasSwitch(switches::kDisableWebRtcHWEncoding); - #endif + #if defined(OS_WIN) + uint32_t enable_accelerated_vpx_decode_val = + gpu::GpuPreferences::VPX_VENDOR_MICROSOFT; --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc @@ -78,12 +78,21 @@ const char kDisable3DAPIs[] @@ -407,7 +405,7 @@ Signed-off-by: Daniel Charles <daniel.charles@intel.com> // Disables hardware acceleration of video decode, where available. const char kDisableAcceleratedVideoDecode[] = "disable-accelerated-video-decode"; -@@ -888,11 +897,13 @@ const char kZygoteProcess[] +@@ -859,11 +868,13 @@ const char kZygoteProcess[] // ignores this switch on its stable and beta channels. const char kDisableWebRtcEncryption[] = "disable-webrtc-encryption"; @@ -435,7 +433,7 @@ Signed-off-by: Daniel Charles <daniel.charles@intel.com> CONTENT_EXPORT extern const char kDisableAcceleratedVideoDecode[]; CONTENT_EXPORT extern const char kDisableAcceleratedVideoEncode[]; CONTENT_EXPORT extern const char kDisableAudioSupportForDesktopShare[]; -@@ -107,6 +111,9 @@ CONTENT_EXPORT extern const char kDisabl +@@ -106,6 +110,9 @@ CONTENT_EXPORT extern const char kDisabl CONTENT_EXPORT extern const char kDomAutomationController[]; extern const char kDisable2dCanvasClipAntialiasing[]; CONTENT_EXPORT extern const char kDumpBlinkRuntimeCallStats[]; @@ -445,7 +443,7 @@ Signed-off-by: Daniel Charles <daniel.charles@intel.com> CONTENT_EXPORT extern const char kEnableAggressiveDOMStorageFlushing[]; CONTENT_EXPORT extern const char kEnableAutomation[]; CONTENT_EXPORT extern const char kEnablePreferCompositingToLCDText[]; -@@ -244,8 +251,10 @@ CONTENT_EXPORT extern const char kZygote +@@ -240,8 +247,10 @@ CONTENT_EXPORT extern const char kZygote #if BUILDFLAG(ENABLE_WEBRTC) CONTENT_EXPORT extern const char kDisableWebRtcEncryption[]; @@ -458,7 +456,7 @@ Signed-off-by: Daniel Charles <daniel.charles@intel.com> CONTENT_EXPORT extern const char kEnableWebRtcStunOrigin[]; --- a/content/renderer/media/webrtc/peer_connection_dependency_factory.cc +++ b/content/renderer/media/webrtc/peer_connection_dependency_factory.cc -@@ -245,12 +245,19 @@ void PeerConnectionDependencyFactory::In +@@ -282,10 +282,18 @@ void PeerConnectionDependencyFactory::In const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); if (gpu_factories && gpu_factories->IsGpuVideoAcceleratorEnabled()) { @@ -469,20 +467,17 @@ Signed-off-by: Daniel Charles <daniel.charles@intel.com> +#endif decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories)); -- if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) { +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) + if (cmd_line->HasSwitch(switches::kEnableAcceleratedVideo)) +#else -+ if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) + if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) +#endif encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories)); -- } } - #if defined(OS_ANDROID) --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc -@@ -1485,7 +1485,11 @@ media::GpuVideoAcceleratorFactories* Ren +@@ -1581,7 +1581,11 @@ media::GpuVideoAcceleratorFactories* Ren scoped_refptr<base::SingleThreadTaskRunner> media_task_runner = GetMediaThreadTaskRunner(); const bool enable_video_accelerator = @@ -516,8 +511,8 @@ Signed-off-by: Daniel Charles <daniel.charles@intel.com> "cr_bugs": [145531, 332596, 571899, 629434], --- a/media/gpu/BUILD.gn +++ b/media/gpu/BUILD.gn -@@ -24,6 +24,14 @@ if (is_mac) { - import("//build/config/mac/mac_sdk.gni") +@@ -482,6 +482,14 @@ if (use_v4l2_codec || use_vaapi || is_ma + } } +if (is_desktop_linux && use_vaapi) { @@ -529,9 +524,9 @@ Signed-off-by: Daniel Charles <daniel.charles@intel.com> +} + if (use_vaapi) { - action("libva_generate_stubs") { - extra_header = "vaapi/va_stub_header.fragment" -@@ -353,6 +361,10 @@ component("gpu") { + test("jpeg_encode_accelerator_unittest") { + deps = [ +@@ -542,6 +550,10 @@ if (use_v4l2_codec || use_vaapi) { if (use_ozone) { deps += [ "//ui/ozone" ] } @@ -540,5 +535,5 @@ Signed-off-by: Daniel Charles <daniel.charles@intel.com> + public_configs = [ ":libva_config" ] + } } + } - if (is_win) { diff --git a/fix-frame-buttons-rendering-too-large-when-using-OSX.patch b/fix-frame-buttons-rendering-too-large-when-using-OSX.patch new file mode 100644 index 000000000000..c4d02836fe92 --- /dev/null +++ b/fix-frame-buttons-rendering-too-large-when-using-OSX.patch @@ -0,0 +1,60 @@ +From 7ef426c221d11b53b6de507b398e35e8d7b3cc94 Mon Sep 17 00:00:00 2001 +From: Tom Anderson <thomasanderson@chromium.org> +Date: Wed, 4 Apr 2018 01:23:26 +0000 +Subject: [PATCH] Fix frame buttons rendering too large when using + OSX-Arc-White GTK theme + +The check for GTK 3.20 was incorrect as the issue it was trying to fix +was still occurring on GTK 3.20+ systems. This CL adds the correct, +but more complex, check. + +Verified on these configurations: +{GTK 3.18, GTK 3.22} X +{Breeze, Adwaita, OSX-Arc-White, Greybird} X +{scale=1, scale=2} X +{fullscreen, restored} + +BUG=821881 +R=thestig + +Change-Id: I05afa35c1452a46a1abf4c39191a13657bfd8e2c +Reviewed-on: https://chromium-review.googlesource.com/990717 +Reviewed-by: Lei Zhang <thestig@chromium.org> +Commit-Queue: Thomas Anderson <thomasanderson@chromium.org> +Cr-Commit-Position: refs/heads/master@{#547921} +--- + chrome/browser/ui/libgtkui/nav_button_provider_gtk3.cc | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +diff --git a/chrome/browser/ui/libgtkui/nav_button_provider_gtk3.cc b/chrome/browser/ui/libgtkui/nav_button_provider_gtk3.cc +index 31a8087bca11..6a09faec5dd2 100644 +--- a/chrome/browser/ui/libgtkui/nav_button_provider_gtk3.cc ++++ b/chrome/browser/ui/libgtkui/nav_button_provider_gtk3.cc +@@ -213,7 +213,23 @@ class NavButtonImageSource : public gfx::ImageSkiaSource { + // is not scaled for the (unexpected) smaller button size, and the button's + // edges appear cut off. To fix this, manually set the background to scale + // to the button size when it would have clipped. +- if (GtkVersionCheck(3, 20)) { ++ // ++ // GTK's "contain" is unlike CSS's "contain". In CSS, the image would only ++ // be downsized when it would have clipped. In GTK, the image is always ++ // scaled to fit the drawing region (preserving aspect ratio). Only add ++ // "contain" if clipping would occur. ++ cairo_pattern_t* cr_pattern = nullptr; ++ cairo_surface_t* cr_surface = nullptr; ++ gtk_style_context_get(button_context, button_state, ++ GTK_STYLE_PROPERTY_BACKGROUND_IMAGE, &cr_pattern, ++ nullptr); ++ if (cr_pattern && ++ cairo_pattern_get_surface(cr_pattern, &cr_surface) == ++ CAIRO_STATUS_SUCCESS && ++ cr_surface && ++ cairo_surface_get_type(cr_surface) == CAIRO_SURFACE_TYPE_IMAGE && ++ (cairo_image_surface_get_width(cr_surface) > button_size_.width() || ++ cairo_image_surface_get_height(cr_surface) > button_size_.height())) { + ApplyCssToContext(button_context, + ".titlebutton { background-size: contain; }"); + } +-- +2.16.2 + |