summaryrefslogtreecommitdiff
path: root/mozilla-1579794-1.patch
diff options
context:
space:
mode:
authorMartin Stransky <stransky@redhat.com>2019-09-11 08:35:24 +0200
committerMartin Stransky <stransky@redhat.com>2019-09-11 08:35:24 +0200
commit36345da5139b4ffba1e6529abf1240fc80b42c1d (patch)
tree8f67b1852b46760905d9f66c279987867b9d3692 /mozilla-1579794-1.patch
parentAdded fix for mozbz#1579023 (diff)
downloadlibrewolf-fedora-ff-36345da5139b4ffba1e6529abf1240fc80b42c1d.tar.gz
librewolf-fedora-ff-36345da5139b4ffba1e6529abf1240fc80b42c1d.tar.bz2
librewolf-fedora-ff-36345da5139b4ffba1e6529abf1240fc80b42c1d.zip
Added fix for mozbz#1579794 - Flickering on video playback on 4k/HiDPI displays
Diffstat (limited to 'mozilla-1579794-1.patch')
-rw-r--r--mozilla-1579794-1.patch134
1 files changed, 134 insertions, 0 deletions
diff --git a/mozilla-1579794-1.patch b/mozilla-1579794-1.patch
new file mode 100644
index 0000000..60c8cab
--- /dev/null
+++ b/mozilla-1579794-1.patch
@@ -0,0 +1,134 @@
+diff --git a/widget/gtk/WindowSurfaceWayland.h b/widget/gtk/WindowSurfaceWayland.h
+--- a/widget/gtk/WindowSurfaceWayland.h
++++ b/widget/gtk/WindowSurfaceWayland.h
+@@ -154,11 +154,12 @@
+ void Draw(gfx::DrawTarget* aDest,
+ LayoutDeviceIntRegion& aWaylandBufferDamage);
+
+- WindowImageSurface(gfx::SourceSurface* aSurface,
++ WindowImageSurface(gfxImageSurface* aImageSurface,
+ const LayoutDeviceIntRegion& aUpdateRegion);
+
+ private:
+ RefPtr<gfx::SourceSurface> mSurface;
++ RefPtr<gfxImageSurface> mImageSurface;
+ const LayoutDeviceIntRegion mUpdateRegion;
+ };
+
+diff --git a/widget/gtk/WindowSurfaceWayland.cpp b/widget/gtk/WindowSurfaceWayland.cpp
+--- a/widget/gtk/WindowSurfaceWayland.cpp
++++ b/widget/gtk/WindowSurfaceWayland.cpp
+@@ -890,8 +890,12 @@
+ }
+
+ WindowImageSurface::WindowImageSurface(
+- gfx::SourceSurface* aSurface, const LayoutDeviceIntRegion& aUpdateRegion)
+- : mSurface(aSurface), mUpdateRegion(aUpdateRegion){};
++ gfxImageSurface* aImageSurface, const LayoutDeviceIntRegion& aUpdateRegion)
++ : mImageSurface(aImageSurface), mUpdateRegion(aUpdateRegion) {
++ mSurface = gfx::Factory::CreateSourceSurfaceForCairoSurface(
++ mImageSurface->CairoSurface(), mImageSurface->GetSize(),
++ mImageSurface->Format());
++}
+
+ void WindowSurfaceWayland::DrawDelayedImageCommits(
+ gfx::DrawTarget* aDrawTarget, LayoutDeviceIntRegion& aWaylandBufferDamage) {
+@@ -915,36 +919,24 @@
+ LOGWAYLAND(("%s [%p] screenSize [%d x %d]\n", __PRETTY_FUNCTION__,
+ (void*)this, mBufferScreenRect.width, mBufferScreenRect.height));
+
+- RefPtr<gfx::SourceSurface> surf =
+- gfx::Factory::CreateSourceSurfaceForCairoSurface(
+- mImageSurface->CairoSurface(), mImageSurface->GetSize(),
+- mImageSurface->Format());
+- if (!surf) {
+- NS_WARNING("Failed to create source cairo surface!");
+- return false;
+- }
++ mDelayedImageCommits.AppendElement(
++ WindowImageSurface(mImageSurface, aRegion));
++ // mImageSurface is owned by mDelayedImageCommits
++ mImageSurface = nullptr;
+
+ RefPtr<gfx::DrawTarget> dt = LockWaylandBuffer(
+ /* aCanSwitchBuffer */ mWholeWindowBufferDamage);
+- if (dt) {
+- LOGWAYLAND(
+- (" Flushing %ld cached WindowImageSurfaces to Wayland buffer\n",
+- long(mDelayedImageCommits.Length() + 1)));
+-
+- // Draw any delayed image commits first
+- DrawDelayedImageCommits(dt, aWaylandBufferDamage);
+- // Draw image from recent WindowSurfaceWayland::Lock().
+- WindowImageSurface::Draw(surf, dt, aRegion);
+- // Submit all drawing to final Wayland buffer upload
+- aWaylandBufferDamage.OrWith(aRegion);
+- UnlockWaylandBuffer();
+- } else {
+- mDelayedImageCommits.AppendElement(WindowImageSurface(surf, aRegion));
+- LOGWAYLAND((" Added WindowImageSurfaces, cached surfaces %ld\n",
+- long(mDelayedImageCommits.Length())));
++ if (!dt) {
+ return false;
+ }
+
++ LOGWAYLAND((" Flushing %ld cached WindowImageSurfaces to Wayland buffer\n",
++ long(mDelayedImageCommits.Length() + 1)));
++
++ // Draw any delayed image commits first
++ DrawDelayedImageCommits(dt, aWaylandBufferDamage);
++ UnlockWaylandBuffer();
++
+ return true;
+ }
+
+@@ -980,23 +972,6 @@
+ LOGWAYLAND((" mFrameCallback = %p\n", mFrameCallback));
+ LOGWAYLAND((" mLastCommittedSurface = %p\n", mLastCommittedSurface));
+
+- if (!mDrawToWaylandBufferDirectly) {
+- MOZ_ASSERT(mDelayedImageCommits.Length(),
+- "Indirect drawing without any image?");
+-
+- // There's some cached drawings - try to flush them now.
+- RefPtr<gfx::DrawTarget> dt = LockWaylandBuffer(
+- /* aCanSwitchBuffer */ mWholeWindowBufferDamage);
+-
+- if (dt) {
+- LOGWAYLAND(("%s [%p] flushed indirect drawing\n", __PRETTY_FUNCTION__,
+- (void*)this));
+- DrawDelayedImageCommits(dt, mWaylandBufferDamage);
+- UnlockWaylandBuffer();
+- mDrawToWaylandBufferDirectly = true;
+- }
+- }
+-
+ wl_surface* waylandSurface = mWindow->GetWaylandSurface();
+ if (!waylandSurface) {
+ LOGWAYLAND(("%s [%p] mWindow->GetWaylandSurface() failed, delay commit.\n",
+@@ -1105,6 +1080,7 @@
+ mWaylandBufferDamage.OrWith(aInvalidRegion);
+ }
+ UnlockWaylandBuffer();
++ mPendingCommit = true;
+ } else {
+ MOZ_ASSERT(!mWaylandBuffer->IsLocked(),
+ "Drawing to already locked buffer?");
+@@ -1112,12 +1088,13 @@
+ mWaylandBufferDamage)) {
+ // Our cached drawing is flushed, we can draw fullscreen again.
+ mDrawToWaylandBufferDirectly = true;
++ mPendingCommit = true;
+ }
+ }
+
+- // We're ready to commit.
+- mPendingCommit = true;
+- CommitWaylandBuffer();
++ if (mPendingCommit) {
++ CommitWaylandBuffer();
++ }
+ }
+
+ void WindowSurfaceWayland::FrameCallbackHandler() {
+
bgstack15