Added fix for mozbz#1627469

This commit is contained in:
Martin Stransky 2020-04-06 15:11:14 +02:00
parent 143fa360a2
commit 2f14c4ee29
2 changed files with 119 additions and 1 deletions

View File

@ -118,7 +118,7 @@ ExcludeArch: s390x
Summary: Mozilla Firefox Web browser Summary: Mozilla Firefox Web browser
Name: firefox Name: firefox
Version: 74.0.1 Version: 74.0.1
Release: 2%{?nss_tag}%{?dist} Release: 3%{?nss_tag}%{?dist}
URL: https://www.mozilla.org/firefox/ URL: https://www.mozilla.org/firefox/
License: MPLv1.1 or GPLv2+ or LGPLv2+ License: MPLv1.1 or GPLv2+ or LGPLv2+
Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz
@ -192,6 +192,7 @@ Patch574: firefox-pipewire.patch
Patch575: mozilla-1609538.patch Patch575: mozilla-1609538.patch
Patch576: mozilla-1623060.patch Patch576: mozilla-1623060.patch
Patch577: mozilla-1624745.patch Patch577: mozilla-1624745.patch
Patch578: mozilla-1627469.patch
# PGO/LTO patches # PGO/LTO patches
Patch600: pgo.patch Patch600: pgo.patch
@ -403,6 +404,7 @@ This package contains results of tests executed during build.
%patch575 -p1 -b .mozilla-1609538 %patch575 -p1 -b .mozilla-1609538
%patch576 -p1 -b .mozilla-1623060 %patch576 -p1 -b .mozilla-1623060
%patch577 -p1 -b .mozilla-1624745 %patch577 -p1 -b .mozilla-1624745
%patch578 -p1 -b .mozilla-1627469
# PGO patches # PGO patches
%patch600 -p1 -b .pgo %patch600 -p1 -b .pgo
@ -969,6 +971,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
#--------------------------------------------------------------------- #---------------------------------------------------------------------
%changelog %changelog
* Mon Apr 06 2020 Martin Stransky <stransky@redhat.com> - 74.0.1-3
- Added fix for mozbz#1627469
* Mon Apr 06 2020 Jan Horak <jhorak@redhat.com> - 74.0.1-2 * Mon Apr 06 2020 Jan Horak <jhorak@redhat.com> - 74.0.1-2
- Fixing pipewire patch - Fixing pipewire patch

113
mozilla-1627469.patch Normal file
View File

@ -0,0 +1,113 @@
diff -up firefox-74.0.1/widget/gtk/WindowSurfaceWayland.cpp.mozilla-1627469 firefox-74.0.1/widget/gtk/WindowSurfaceWayland.cpp
--- firefox-74.0.1/widget/gtk/WindowSurfaceWayland.cpp.mozilla-1627469 2020-04-06 15:07:16.772431937 +0200
+++ firefox-74.0.1/widget/gtk/WindowSurfaceWayland.cpp 2020-04-06 15:09:57.037320477 +0200
@@ -647,13 +647,14 @@ WindowBackBuffer* WindowSurfaceWayland::
LOGWAYLAND(
("WindowSurfaceWayland::NewWaylandBuffer [%p] Requested buffer [%d "
"x %d] DMABuf %d\n",
- (void*)this, mWidgetRect.width, mWidgetRect.height, aUseDMABufBackend));
+ (void*)this, mWLBufferRect.width, mWLBufferRect.height,
+ aUseDMABufBackend));
mWaylandBuffer = WaylandBufferFindAvailable(
- mWidgetRect.width, mWidgetRect.height, aUseDMABufBackend);
+ mWLBufferRect.width, mWLBufferRect.height, aUseDMABufBackend);
if (!mWaylandBuffer) {
- mWaylandBuffer = CreateWaylandBuffer(mWidgetRect.width, mWidgetRect.height,
- aUseDMABufBackend);
+ mWaylandBuffer = CreateWaylandBuffer(
+ mWLBufferRect.width, mWLBufferRect.height, aUseDMABufBackend);
}
return mWaylandBuffer;
@@ -663,7 +664,7 @@ WindowBackBuffer* WindowSurfaceWayland::
LOGWAYLAND(
("WindowSurfaceWayland::GetWaylandBufferRecent [%p] Requested buffer [%d "
"x %d]\n",
- (void*)this, mWidgetRect.width, mWidgetRect.height));
+ (void*)this, mWLBufferRect.width, mWLBufferRect.height));
// There's no buffer created yet, create a new one for partial screen updates.
if (!mWaylandBuffer) {
@@ -675,9 +676,10 @@ WindowBackBuffer* WindowSurfaceWayland::
return nullptr;
}
- if (mWaylandBuffer->IsMatchingSize(mWidgetRect.width, mWidgetRect.height)) {
- LOGWAYLAND((" Size is ok, use the buffer [%d x %d]\n", mWidgetRect.width,
- mWidgetRect.height));
+ if (mWaylandBuffer->IsMatchingSize(mWLBufferRect.width,
+ mWLBufferRect.height)) {
+ LOGWAYLAND((" Size is ok, use the buffer [%d x %d]\n",
+ mWLBufferRect.width, mWLBufferRect.height));
return mWaylandBuffer;
}
@@ -692,7 +694,7 @@ WindowBackBuffer* WindowSurfaceWayland::
LOGWAYLAND(
("WindowSurfaceWayland::GetWaylandBufferWithSwitch [%p] Requested buffer "
"[%d x %d]\n",
- (void*)this, mWidgetRect.width, mWidgetRect.height));
+ (void*)this, mWLBufferRect.width, mWLBufferRect.height));
// There's no buffer created yet or actual buffer is attached, get a new one.
// Use DMABuf for fullscreen updates only.
@@ -701,20 +703,21 @@ WindowBackBuffer* WindowSurfaceWayland::
}
// Reuse existing buffer
- LOGWAYLAND((" Reuse buffer with resize [%d x %d]\n", mWidgetRect.width,
- mWidgetRect.height));
+ LOGWAYLAND((" Reuse buffer with resize [%d x %d]\n", mWLBufferRect.width,
+ mWLBufferRect.height));
// OOM here, just return null to skip this frame.
- if (!mWaylandBuffer->Resize(mWidgetRect.width, mWidgetRect.height)) {
+ if (!mWaylandBuffer->Resize(mWLBufferRect.width, mWLBufferRect.height)) {
return nullptr;
}
return mWaylandBuffer;
}
already_AddRefed<gfx::DrawTarget> WindowSurfaceWayland::LockWaylandBuffer() {
- // Allocated wayland buffer must match widget size, otherwise wayland
- // compositor is confused and may produce various rendering artifacts.
- mWidgetRect = mWindow->GetMozContainerSize();
+ // Allocated wayland buffer can't be bigger than mozilla widget size.
+ LayoutDeviceIntRegion region;
+ region.And(mLockedScreenRect, mWindow->GetMozContainerSize());
+ mWLBufferRect = LayoutDeviceIntRect(region.GetBounds());
// mCanSwitchWaylandBuffer set means we're getting buffer for fullscreen
// update. We can use DMABuf and we can get a new buffer for drawing.
@@ -882,8 +885,8 @@ already_AddRefed<gfx::DrawTarget> Window
LayoutDeviceIntRect size = mWindow->GetMozContainerSize();
// We can draw directly only when widget has the same size as wl_buffer
- mDrawToWaylandBufferDirectly = (size.width == mLockedScreenRect.width &&
- size.height == mLockedScreenRect.height);
+ mDrawToWaylandBufferDirectly = (size.width >= mLockedScreenRect.width &&
+ size.height >= mLockedScreenRect.height);
// We can draw directly only when we redraw significant part of the window
// to avoid flickering.
diff -up firefox-74.0.1/widget/gtk/WindowSurfaceWayland.h.mozilla-1627469 firefox-74.0.1/widget/gtk/WindowSurfaceWayland.h
--- firefox-74.0.1/widget/gtk/WindowSurfaceWayland.h.mozilla-1627469 2020-04-06 15:07:16.773431931 +0200
+++ firefox-74.0.1/widget/gtk/WindowSurfaceWayland.h 2020-04-06 15:07:16.775431919 +0200
@@ -264,11 +264,11 @@ class WindowSurfaceWayland : public Wind
// mLockedScreenRect is window size when our wayland buffer was allocated.
LayoutDeviceIntRect mLockedScreenRect;
- // WidgetRect is an actual size of mozcontainer widget. It can be
- // different than mLockedScreenRect during resize when mBounds are updated
- // immediately but actual GtkWidget size is updated asynchronously
- // (see Bug 1489463).
- LayoutDeviceIntRect mWidgetRect;
+ // mWLBufferRect is an intersection of mozcontainer widgetsize and
+ // mLockedScreenRect size. It can be different than mLockedScreenRect
+ // during resize when mBounds are updated immediately but actual
+ // GtkWidget size is updated asynchronously (see Bug 1489463).
+ LayoutDeviceIntRect mWLBufferRect;
nsWaylandDisplay* mWaylandDisplay;
// Actual buffer (backed by wl_buffer) where all drawings go into.