extra/firefox to 112.0.2-2

This commit is contained in:
Kevin Mihelich 2023-04-28 00:04:24 +00:00
parent 2f534ae018
commit 6a9a67d4df
3 changed files with 88 additions and 17 deletions

View file

@ -0,0 +1,81 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: stransky <stransky@redhat.com>
Date: Thu, 30 Mar 2023 11:49:53 +0000
Subject: [PATCH] Bug 1803016 [Wayland] Don't commit wl_buffer if buffer scale
doesn't match its size r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D173814
---
widget/gtk/MozContainerWayland.cpp | 7 +++++++
widget/gtk/MozContainerWayland.h | 3 +++
widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp | 17 ++++++++++++++---
3 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/widget/gtk/MozContainerWayland.cpp b/widget/gtk/MozContainerWayland.cpp
index 2a4a492077c3..0d9aacc954b7 100644
--- a/widget/gtk/MozContainerWayland.cpp
+++ b/widget/gtk/MozContainerWayland.cpp
@@ -597,6 +597,13 @@ void moz_container_wayland_set_scale_factor(MozContainer* container) {
}
}
+bool moz_container_wayland_size_matches_scale_factor_locked(
+ const MutexAutoLock& aProofOfLock, MozContainer* container, int aWidth,
+ int aHeight) {
+ return aWidth % container->wl_container.buffer_scale == 0 &&
+ aHeight % container->wl_container.buffer_scale == 0;
+}
+
static bool moz_container_wayland_surface_create_locked(
const MutexAutoLock& aProofOfLock, MozContainer* container) {
MozContainerWayland* wl_container = &container->wl_container;
diff --git a/widget/gtk/MozContainerWayland.h b/widget/gtk/MozContainerWayland.h
index d3c49baae8ac..369d40a55250 100644
--- a/widget/gtk/MozContainerWayland.h
+++ b/widget/gtk/MozContainerWayland.h
@@ -85,6 +85,9 @@ bool moz_container_wayland_egl_window_needs_size_update(MozContainer* container,
void moz_container_wayland_set_scale_factor(MozContainer* container);
void moz_container_wayland_set_scale_factor_locked(
const mozilla::MutexAutoLock& aProofOfLock, MozContainer* container);
+bool moz_container_wayland_size_matches_scale_factor_locked(
+ const mozilla::MutexAutoLock& aProofOfLock, MozContainer* container,
+ int aWidth, int aHeight);
void moz_container_wayland_add_initial_draw_callback_locked(
MozContainer* container, const std::function<void(void)>& initial_draw_cb);
diff --git a/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp b/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp
index 85ab1942d9e6..31091f4b9848 100644
--- a/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp
+++ b/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp
@@ -285,8 +285,8 @@ void WindowSurfaceWaylandMB::Commit(
mFrameInProcess = false;
MozContainer* container = mWindow->GetMozContainer();
- MozContainerSurfaceLock lock(container);
- struct wl_surface* waylandSurface = lock.GetSurface();
+ MozContainerSurfaceLock MozContainerLock(container);
+ struct wl_surface* waylandSurface = MozContainerLock.GetSurface();
if (!waylandSurface) {
LOGWAYLAND(
"WindowSurfaceWaylandMB::Commit [%p] frame queued: can't lock "
@@ -319,8 +319,19 @@ void WindowSurfaceWaylandMB::Commit(
}
}
+ // aProofOfLock is a kind of substitution of MozContainerSurfaceLock.
+ // MozContainer is locked but MozContainerSurfaceLock doen't convert to
+ // MutexAutoLock& so we use aProofOfLock here.
moz_container_wayland_set_scale_factor_locked(aProofOfLock, container);
- mInProgressBuffer->AttachAndCommit(waylandSurface);
+
+ // It's possible that scale factor changed between Lock() and Commit()
+ // but window size is the same.
+ // Don't attach such buffer as it may have incorrect size,
+ // we'll paint new content soon.
+ if (moz_container_wayland_size_matches_scale_factor_locked(
+ aProofOfLock, container, mWindowSize.width, mWindowSize.height)) {
+ mInProgressBuffer->AttachAndCommit(waylandSurface);
+ }
mInProgressBuffer->ResetBufferAge();
mFrontBuffer = mInProgressBuffer;

View file

@ -11,7 +11,7 @@ highmem=1
pkgname=firefox
pkgver=112.0.2
pkgrel=1
pkgrel=2
pkgdesc="Standalone web browser from mozilla.org"
url="https://www.mozilla.org/firefox/"
arch=(x86_64)
@ -69,7 +69,7 @@ source=(
https://archive.mozilla.org/pub/firefox/releases/$pkgver/source/firefox-$pkgver.source.tar.xz{,.asc}
$pkgname.desktop
identity-icons-brand.svg
build-arm-libopus.patch
0001-Bug-1803016-Wayland-Don-t-commit-wl_buffer-if-buffer.patch
)
validpgpkeys=(
'14F26682D0916CDD81E37B6D61B7B526D98F0353' # Mozilla Software Releases <release@mozilla.com>
@ -78,12 +78,12 @@ sha256sums=('e6a4819a3b82b1ca6c45296e50e6c9ab653306eeb540e50ba8683e339565992e'
'SKIP'
'298eae9de76ec53182f38d5c549d0379569916eebf62149f9d7f4a7edef36abf'
'a9b8b4a0a1f4a7b4af77d5fc70c2686d624038909263c795ecc81e0aec7711e9'
'2d4d91f7e35d0860225084e37ec320ca6cae669f6c9c8fe7735cdbd542e3a7c9')
'bfe15651a99ac6d0037867c9db00a0d4340353cdc0ac4a39e43ad61cc2589ed6')
b2sums=('44f2fae6c7260a1a6cad24ee31bbd52bc7efad15ac5b9f64f4bceabda7a371f20a490512cee324e53373b9a96fd218572c1478b76e5931383dbef00cc25743aa'
'SKIP'
'e18f2c22e394ca3b6758bc130245b254947e4d15921be3da443d6d7c3c4b0d22ead1b39fbc10a4f896edd19e2a1dffbd1cbb34dc4beb0621a6ddb70ccc53b3a7'
'63a8dd9d8910f9efb353bed452d8b4b2a2da435857ccee083fc0c557f8c4c1339ca593b463db320f70387a1b63f1a79e709e9d12c69520993e26d85a3d742e34'
'6e5980e56343a23bce4fcda58f6abc8f2debca0c278c87b09e53abb17ff15849c26e8df3bbff2388985f8fe5a4e9be9982c602ef7159546f0ae335fca1000a41')
'ab11b185f32da7a10c22a075d2bf16adadfcfc2d197fc88bd61a03d1873d5cd914cd96edf8af9f054a3cab12629f3f5c29d70d0dce0f0f4bef85f1cfc5a219ee')
# Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
# Note: These are for Arch Linux use ONLY. For your own distribution, please
@ -102,6 +102,9 @@ prepare() {
mkdir mozbuild
cd firefox-$pkgver
# https://bugzilla.mozilla.org/show_bug.cgi?id=1803016
patch -Np1 -i ../0001-Bug-1803016-Wayland-Don-t-commit-wl_buffer-if-buffer.patch
echo -n "$_google_api_key" >google-api-key
echo -n "$_mozilla_api_key" >mozilla-api-key
@ -169,7 +172,6 @@ END
export CXXFLAGS+=" -g0"
export LDFLAGS+=" -Wl,--no-keep-memory"
export RUSTFLAGS="-Cdebuginfo=0"
patch -p1 -i ../build-arm-libopus.patch
}
build() {

View file

@ -1,12 +0,0 @@
diff -up firefox-66.0/media/libopus/silk/arm/arm_silk_map.c.old firefox-66.0/media/libopus/silk/arm/arm_silk_map.c
--- firefox-66.0/media/libopus/silk/arm/arm_silk_map.c.old 2019-03-12 21:07:35.356677522 +0100
+++ firefox-66.0/media/libopus/silk/arm/arm_silk_map.c 2019-03-12 21:07:42.937693394 +0100
@@ -28,7 +28,7 @@ POSSIBILITY OF SUCH DAMAGE.
# include "config.h"
#endif
-#include "main_FIX.h"
+#include "fixed/main_FIX.h"
#include "NSQ.h"
#include "SigProc_FIX.h"