- Update to 114.0.5735.133

- Enable AllowQt feature flag
- Fix Qt deps
- Fix Qt logical scale factor
This commit is contained in:
Than Ngo 2023-06-14 14:14:28 +02:00
parent 369ac1d3ad
commit ecbf187d1c
6 changed files with 132 additions and 3 deletions

View File

@ -0,0 +1,46 @@
commit 7b1d747a599a752e493e34e7bbf841d8b4c7882f
Author: Tomasz Śniatowski <tomasz.sniatowski@xperi.com>
Date: Thu May 25 16:09:27 2023 +0000
Dep on //printing in //ui/qt if printing is enabled
qt_ui.h can use printing/printing_context_linux.h, and needs to dep
on //printing if it does, to avoid a missing dependency build break.
Without this fix, a clean build can fail on obj/ui/qt/qt/qt_ui.o with
In file included from ../../ui/qt/qt_ui.cc:8:
In file included from ../../ui/qt/qt_ui.h:21:
../../printing/printing_context_linux.h:12:10: fatal error:
'printing/mojom/print.mojom.h' file not found
(the #include is a // NOGNCHECK one, which is how this came to be)
Change-Id: I70af37071e232ffbf462a05e026051efae044b69
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4566944
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
Auto-Submit: Tomasz Śniatowski <tomasz.sniatowski@xperi.com>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1149138}
diff --git a/ui/qt/BUILD.gn b/ui/qt/BUILD.gn
index 6a67961edc2f7..89fffcf3089f9 100644
--- a/ui/qt/BUILD.gn
+++ b/ui/qt/BUILD.gn
@@ -5,6 +5,7 @@
import("//build/config/chromecast_build.gni")
import("//build/config/linux/pkg_config.gni")
import("//build/config/sysroot.gni")
+import("//printing/buildflags/buildflags.gni")
import("//ui/qt/qt.gni")
assert(use_qt)
@@ -127,6 +128,9 @@ component("qt") {
"//ui/views",
]
public_deps = [ "//skia" ]
+ if (enable_printing) {
+ public_deps += [ "//printing" ]
+ }
sources = [
"qt_ui.cc",

View File

@ -0,0 +1,12 @@
diff -up chromium-114.0.5735.106/ui/linux/linux_ui_factory.cc.me chromium-114.0.5735.106/ui/linux/linux_ui_factory.cc
--- chromium-114.0.5735.106/ui/linux/linux_ui_factory.cc.me 2023-06-11 18:47:09.742886578 +0200
+++ chromium-114.0.5735.106/ui/linux/linux_ui_factory.cc 2023-06-11 18:48:42.231584886 +0200
@@ -127,7 +127,7 @@ LinuxUiAndTheme* GetDefaultLinuxUiAndThe
} // namespace
-BASE_FEATURE(kAllowQt, "AllowQt", base::FEATURE_DISABLED_BY_DEFAULT);
+BASE_FEATURE(kAllowQt, "AllowQt", base::FEATURE_ENABLED_BY_DEFAULT);
LinuxUi* GetDefaultLinuxUi() {
auto* linux_ui = GetDefaultLinuxUiAndTheme();

View File

@ -0,0 +1,59 @@
commit ff39a278ddccf61716a7dbcb575415801bbf8ded
Author: Tom Anderson <thomasanderson@chromium.org>
Date: Wed May 31 18:31:09 2023 +0000
[QT] Account for logical scale factor
Previously we were only using the device pixel ratio. But QT UI
scales with both the device pixel ratio and the logical DPI. This CL
sets Chrome's scale factor to be the product of these two.
R=thestig
CC=jkummerow
Change-Id: I9bd414046058e741450fabae4913d47a16ca48c3
Bug: 1439149
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4575572
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1151380}
diff --git a/ui/qt/qt_shim.cc b/ui/qt/qt_shim.cc
index 0aec9c3aed4ad..3780f8c3988b4 100644
--- a/ui/qt/qt_shim.cc
+++ b/ui/qt/qt_shim.cc
@@ -7,7 +7,7 @@
#include "ui/qt/qt_shim.h"
-#include <stdio.h>
+#include <cmath>
#include <QApplication>
#include <QFont>
@@ -219,7 +219,24 @@ QtShim::QtShim(QtInterface::Delegate* delegate, int* argc, char** argv)
QtShim::~QtShim() = default;
double QtShim::GetScaleFactor() const {
- return app_.devicePixelRatio();
+ constexpr double kDefaultPixelDpi = 96.0;
+ // Use the largest scale factor across all displays as the global scale
+ // factor. This matches the behavior of `app_.devicePixelRatio()`, except
+ // this also takes into account the logical DPI.
+ // TODO(https://crbug.com/1450301): Unlike GTK, QT supports per-display
+ // scaling. Use this instead of the max scale factor.
+ double scale = 0.0;
+ for (QScreen* screen : app_.screens()) {
+ scale =
+ std::max(scale, screen->devicePixelRatio() *
+ screen->logicalDotsPerInch() / kDefaultPixelDpi);
+ }
+ // Round to the nearest 16th so that UI can losslessly multiply and divide
+ // by the scale factor using floating point arithmetic. GtkUi also rounds
+ // in this way, but to 1/64th. 1/16th is chosen here since that's what
+ // KDE settings uses.
+ scale = std::round(scale * 16) / 16;
+ return scale > 0 ? scale : 1.0;
}
FontRenderParams QtShim::GetFontRenderParams() const {

View File

@ -1,4 +1,4 @@
# system wide chromium flags
CHROMIUM_FLAGS=""
CHROMIUM_FLAGS+=" --disable-features=AudioServiceSandbox,Vulkan,AllowQt"
CHROMIUM_FLAGS+=" --disable-features=AudioServiceSandbox,Vulkan"
CHROMIUM_FLAGS+=" --enable-features=VaapiVideoDecoder,VaapiVideoEncoder,VaapiVideoDecodeLinuxGL"

View File

@ -240,7 +240,7 @@
%endif
Name: chromium%{chromium_channel}
Version: 114.0.5735.106
Version: 114.0.5735.133
Release: 1%{?dist}
Summary: A WebKit (Blink) powered web browser that Google doesn't want you to use
Url: http://www.chromium.org/Home
@ -364,6 +364,9 @@ Patch303: chromium-114-typename.patch
Patch320: chromium-114-add_qt6_linuxui_backend.patch
Patch321: chromium-114-qt-handle_scale_factor_changes.patch
Patch322: chromium-114-qt-fix_font_double_scaling.patch
Patch323: chromium-114-qt_deps.patch
Patch324: chromium-114-qt_enable_AllowQt_feature_flag.patch
Patch325: chromium-114-qt_logical_scale_factor.patch
# Use chromium-latest.py to generate clean tarball from released build tarballs, found here:
# http://build.chromium.org/buildbot/official/
@ -965,6 +968,9 @@ udev.
%patch -P320 -p1 -b .add_qt6_linuxui_backend
%patch -P321 -p1 -b .handle_scale_factor_changes
%patch -P322 -p1 -b .fix_font_double_scaling
%patch -P323 -p1 -b .qt_deps
%patch -P324 -p1 -b .qt_enable_AllowQt_feature_flag
%patch -P325 -p1 -b .qt_logical_scale_factor
# Change shebang in all relevant files in this directory and all subdirectories
# See `man find` for how the `-exec command {} +` syntax works
@ -1641,6 +1647,12 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt
%{chromium_path}/chromedriver
%changelog
* Wed Jun 14 2023 Than Ngo <than@redhat.com> - 114.0.5735.133-1
- update to 114.0.5735.133
- Enable AllowQt feature flag
- Fix Qt deps
- Fix Qt logical scale factor
* Wed Jun 07 2023 Than Ngo <than@redhat.com> - 114.0.5735.106-1
- update to 114.0.5735.106

View File

@ -1,3 +1,3 @@
SHA512 (node-v19.8.1-linux-arm64.tar.xz) = 86ff19085669e92ce7afe2fd7d4df0c5441df2d88c00f29d5463b805f3cf5625626db8aebf98349c9a495b772da1ce6d68263730018207ea98815058a1c81397
SHA512 (node-v19.8.1-linux-x64.tar.xz) = 925c0037c6b7074d0b0245bced20d0a0d9b1300f53b808106f16b5018d763f5f5b00bc321b33fa1033d736b1e1076608da9b7fcae66aed53d27b100b1186e2c6
SHA512 (chromium-114.0.5735.106-clean.tar.xz) = d96c2edd6d17beed6a122133d3c5b8677ce091ef4cb350f78260a79de6c0c02a9abd5cd609c93a3e7e6bac3d44b66c32943fd3e1544e037731e17b444f5c6eea
SHA512 (chromium-114.0.5735.133-clean.tar.xz) = 2daccd08a496ad9157e036f893490a77026a9af9f0529bf6dc04ca251dee691ad4edba2fc5195346f3bd74d1cb90029f75cb5bd6e5320ca3857b2eb453965870