diff options
author | Jan Beich <jbeich@FreeBSD.org> | 2019-01-21 23:03:45 +0000 |
---|---|---|
committer | Jan Beich <jbeich@FreeBSD.org> | 2019-01-21 23:03:45 +0000 |
commit | 94ba0152445e65e1e80c5c62d4b11c594cfe0158 (patch) | |
tree | 957bfc095bd19d6545720169937ab78ee8fb4d0c /www/firefox | |
parent | 0c02d51ac9bd9121a3cf11ec9a4134a31bff6ab4 (diff) | |
download | ports-94ba0152445e65e1e80c5c62d4b11c594cfe0158.tar.gz ports-94ba0152445e65e1e80c5c62d4b11c594cfe0158.zip |
www/firefox: update to 65.0
Backport a fix for WebRender on Wayland e.g.,
$ GDK_BACKEND=wayland MOZ_WEBRENDER=1 MOZ_ACCELERATED=1 firefox https://example.com/
Changes: https://www.mozilla.org/firefox/65.0/releasenotes/
PR: 233791
Security: b1f7d52f-fc42-48e8-8403-87d4c9d26229
MFH: 2019Q1
Differential Revision: https://reviews.freebsd.org/D18432
Notes
Notes:
svn path=/head/; revision=490910
Diffstat (limited to 'www/firefox')
-rw-r--r-- | www/firefox/Makefile | 7 | ||||
-rw-r--r-- | www/firefox/distinfo | 6 | ||||
-rw-r--r-- | www/firefox/files/patch-bug1511726 | 32 | ||||
-rw-r--r-- | www/firefox/files/patch-bug1514156 | 582 | ||||
-rw-r--r-- | www/firefox/files/patch-bug847568 | 12 |
5 files changed, 626 insertions, 13 deletions
diff --git a/www/firefox/Makefile b/www/firefox/Makefile index 0768459db702..cdae0eacc54e 100644 --- a/www/firefox/Makefile +++ b/www/firefox/Makefile @@ -2,8 +2,7 @@ # $FreeBSD$ PORTNAME= firefox -DISTVERSION= 64.0.2 -PORTREVISION= 1 +DISTVERSION= 65.0 PORTEPOCH= 1 CATEGORIES= www ipv6 MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \ @@ -14,7 +13,7 @@ MAINTAINER= gecko@FreeBSD.org COMMENT= Web browser based on the browser portion of Mozilla BUILD_DEPENDS= nspr>=4.19:devel/nspr \ - nss>=3.40.1:security/nss \ + nss>=3.41:security/nss \ icu>=59.1,1:devel/icu \ libevent>=2.1.8:devel/libevent \ harfbuzz>=1.9.0:print/harfbuzz \ @@ -22,7 +21,7 @@ BUILD_DEPENDS= nspr>=4.19:devel/nspr \ png>=1.6.34:graphics/png \ libvorbis>=1.3.6,3:audio/libvorbis \ libvpx>=1.5.0:multimedia/libvpx \ - sqlite3>=3.25.1:databases/sqlite3 \ + sqlite3>=3.25.3:databases/sqlite3 \ ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \ v4l_compat>0:multimedia/v4l_compat \ autoconf-2.13:devel/autoconf213 \ diff --git a/www/firefox/distinfo b/www/firefox/distinfo index da2884416789..acaaac695753 100644 --- a/www/firefox/distinfo +++ b/www/firefox/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1546973911 -SHA256 (firefox-64.0.2.source.tar.xz) = 34cf115a4eeb4d73f7199396bb3a5d5843c8c455eae4213bf451c4db88768f1f -SIZE (firefox-64.0.2.source.tar.xz) = 273075852 +TIMESTAMP = 1548089834 +SHA256 (firefox-65.0.source.tar.xz) = 106b14cf9fbbc13d376b391a722678d69b44ad8481b5e325170588e4ac236a76 +SIZE (firefox-65.0.source.tar.xz) = 278717736 diff --git a/www/firefox/files/patch-bug1511726 b/www/firefox/files/patch-bug1511726 new file mode 100644 index 000000000000..57509e260832 --- /dev/null +++ b/www/firefox/files/patch-bug1511726 @@ -0,0 +1,32 @@ +Don't try to use shader disk cache if disabled + +diff --git gfx/webrender_bindings/RenderThread.cpp gfx/webrender_bindings/RenderThread.cpp +index 1e60a900ff5a..92dc857b8390 100644 +--- gfx/webrender_bindings/RenderThread.cpp ++++ gfx/webrender_bindings/RenderThread.cpp +@@ -768,7 +768,9 @@ WebRenderProgramCache::WebRenderProgramCache(wr::WrThreadPool* aThreadPool) { + path.Append(gfx::gfxVars::ProfDirectory()); + } + mProgramCache = wr_program_cache_new(&path, aThreadPool); +- wr_try_load_shader_from_disk(mProgramCache); ++ if (gfxVars::UseWebRenderProgramBinaryDisk()) { ++ wr_try_load_shader_from_disk(mProgramCache); ++ } + } + + WebRenderProgramCache::~WebRenderProgramCache() { +diff --git gfx/webrender_bindings/src/bindings.rs gfx/webrender_bindings/src/bindings.rs +index 56bebc2882a0..88f7a1827264 100644 +--- gfx/webrender_bindings/src/bindings.rs ++++ gfx/webrender_bindings/src/bindings.rs +@@ -914,9 +914,7 @@ pub unsafe extern "C" fn wr_program_cache_delete(program_cache: *mut WrProgramCa + + #[no_mangle] + pub unsafe extern "C" fn wr_try_load_shader_from_disk(program_cache: *mut WrProgramCache) { +- if !program_cache.is_null() { +- (*program_cache).try_load_from_disk(); +- } ++ (*program_cache).try_load_from_disk(); + } + + #[no_mangle] diff --git a/www/firefox/files/patch-bug1514156 b/www/firefox/files/patch-bug1514156 new file mode 100644 index 000000000000..91b836e20682 --- /dev/null +++ b/www/firefox/files/patch-bug1514156 @@ -0,0 +1,582 @@ +commit 9b55d8d04f4b +Author: Sotaro Ikeda <sotaro.ikeda.g@gmail.com> +Date: Thu Jan 3 22:36:09 2019 -0800 + + Bug 1514156 - Add RenderCompositorEGL for Wayland +--- + gfx/gl/GLContextEGL.h | 4 + + gfx/gl/GLContextProviderEGL.cpp | 29 ++++++ + gfx/webrender_bindings/RenderCompositor.cpp | 12 +++ + gfx/webrender_bindings/RenderCompositorEGL.cpp | 135 +++++++++++++++++++++++++ + gfx/webrender_bindings/RenderCompositorEGL.h | 54 ++++++++++ + gfx/webrender_bindings/moz.build | 10 ++ + widget/gtk/CompositorWidgetChild.cpp | 6 ++ + widget/gtk/CompositorWidgetChild.h | 4 +- + widget/gtk/CompositorWidgetParent.cpp | 6 ++ + widget/gtk/CompositorWidgetParent.h | 2 + + widget/gtk/GtkCompositorWidget.cpp | 15 ++- + widget/gtk/GtkCompositorWidget.h | 9 ++ + widget/gtk/PCompositorWidget.ipdl | 1 + + widget/gtk/mozcontainer.cpp | 11 ++ + widget/gtk/mozcontainer.h | 2 + + widget/gtk/nsWindow.cpp | 16 +++ + widget/gtk/nsWindow.h | 1 + + 17 files changed, 315 insertions(+), 2 deletions(-) + +diff --git gfx/gl/GLContextEGL.h gfx/gl/GLContextEGL.h +index 95d5e0c02e23..adb37e59a9f7 100644 +--- gfx/gl/GLContextEGL.h ++++ gfx/gl/GLContextEGL.h +@@ -91,6 +91,10 @@ class GLContextEGL : public GLContext { + CreateContextFlags flags, const gfx::IntSize& size, + const SurfaceCaps& minCaps, nsACString* const out_FailureId); + ++#if defined(MOZ_WAYLAND) ++ static EGLSurface CreateEGLSurfaceForCompositorWidget( ++ widget::CompositorWidget* aCompositorWidget, bool aForceAccelerated); ++#endif + protected: + friend class GLContextProviderEGL; + friend class GLContextEGLFactory; +diff --git gfx/gl/GLContextProviderEGL.cpp gfx/gl/GLContextProviderEGL.cpp +index 774eb34a8e87..25aa779a7d64 100644 +--- gfx/gl/GLContextProviderEGL.cpp ++++ gfx/gl/GLContextProviderEGL.cpp +@@ -295,6 +295,35 @@ already_AddRefed<GLContext> GLContextEGLFactory::Create( + return gl.forget(); + } + ++#if defined(MOZ_WAYLAND) ++/* static */ EGLSurface GLContextEGL::CreateEGLSurfaceForCompositorWidget( ++ widget::CompositorWidget* aCompositorWidget, bool aForceAccelerated) ++{ ++ nsCString discardFailureId; ++ if (!GLLibraryEGL::EnsureInitialized(false, &discardFailureId)) { ++ gfxCriticalNote << "Failed to load EGL library 6!"; ++ return EGL_NO_SURFACE; ++ } ++ ++ MOZ_ASSERT(aCompositorWidget); ++ EGLNativeWindowType window = GET_NATIVE_WINDOW_FROM_COMPOSITOR_WIDGET(aCompositorWidget); ++ bool useWebRender = aCompositorWidget->GetCompositorOptions().UseWebRender(); ++ ++ EGLConfig config; ++ if (!CreateConfig(&config, useWebRender)) { ++ gfxCriticalNote << "Failed to create EGLConfig!"; ++ return EGL_NO_SURFACE; ++ } ++ ++ EGLSurface surface = EGL_NO_SURFACE; ++ if (window) { ++ surface = mozilla::gl::CreateSurfaceFromNativeWindow(window, config); ++ } ++ ++ return surface; ++} ++#endif ++ + GLContextEGL::GLContextEGL(CreateContextFlags flags, const SurfaceCaps& caps, + bool isOffscreen, EGLConfig config, + EGLSurface surface, EGLContext context) +diff --git gfx/webrender_bindings/RenderCompositor.cpp gfx/webrender_bindings/RenderCompositor.cpp +index 051482fbabbf..a58268096a89 100644 +--- gfx/webrender_bindings/RenderCompositor.cpp ++++ gfx/webrender_bindings/RenderCompositor.cpp +@@ -16,6 +16,10 @@ + #include "mozilla/webrender/RenderCompositorANGLE.h" + #endif + ++#ifdef MOZ_WAYLAND ++#include "mozilla/webrender/RenderCompositorEGL.h" ++#endif ++ + namespace mozilla { + namespace wr { + +@@ -26,6 +30,14 @@ namespace wr { + return RenderCompositorANGLE::Create(std::move(aWidget)); + } + #endif ++ ++#ifdef MOZ_WIDGET_GTK ++ UniquePtr<RenderCompositor> eglCompositor = RenderCompositorEGL::Create(aWidget); ++ if (eglCompositor) { ++ return eglCompositor; ++ } ++#endif ++ + return RenderCompositorOGL::Create(std::move(aWidget)); + } + +diff --git gfx/webrender_bindings/RenderCompositorEGL.cpp gfx/webrender_bindings/RenderCompositorEGL.cpp +new file mode 100644 +index 000000000000..16245f59afbd +--- /dev/null ++++ gfx/webrender_bindings/RenderCompositorEGL.cpp +@@ -0,0 +1,135 @@ ++/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* vim: set ts=8 sts=2 et sw=2 tw=80: */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#include "RenderCompositorEGL.h" ++ ++#include "GLContext.h" ++#include "GLContextEGL.h" ++#include "GLContextProvider.h" ++#include "GLLibraryEGL.h" ++#include "mozilla/widget/CompositorWidget.h" ++#include "mozilla/widget/GtkCompositorWidget.h" ++ ++#include <gdk/gdk.h> ++#include <gdk/gdkx.h> ++ ++namespace mozilla { ++namespace wr { ++ ++/* static */ UniquePtr<RenderCompositor> RenderCompositorEGL::Create( ++ RefPtr<widget::CompositorWidget> aWidget) { ++ ++ if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) { ++ return nullptr; ++ } ++ ++ RefPtr<gl::GLContext> gl; ++ gl = CreateGLContext(aWidget); ++ if (!gl) { ++ return nullptr; ++ } ++ return MakeUnique<RenderCompositorEGL>(std::move(gl), std::move(aWidget)); ++} ++ ++/* static */ already_AddRefed<gl::GLContext> ++RenderCompositorEGL::CreateGLContext(RefPtr<widget::CompositorWidget> aWidget) { ++ nsCString discardFailureId; ++ //auto flags = gl::CreateContextFlags::PREFER_ES3; ++ ++ // Create GLContext with dummy EGLSurface. ++ RefPtr<gl::GLContext> gl = ++ //gl::GLContextProviderEGL::CreateHeadless(flags, &discardFailureId); //XXX headless context did not work. ++ gl::GLContextProviderEGL::CreateForCompositorWidget(aWidget, true); ++ if (!gl) { ++ gfxCriticalNote << "Failed GL context creation for WebRender: " ++ << gfx::hexa(gl.get()); ++ return nullptr; ++ } ++ ++ if (!gl->MakeCurrent()) { ++ gfxCriticalNote << "Failed GL context creation for WebRender: " ++ << gfx::hexa(gl.get()); ++ return nullptr; ++ } ++ ++ return gl.forget(); ++} ++ ++/* static */ EGLSurface RenderCompositorEGL::CreateEGLSurface( ++ widget::CompositorWidget* aWidget) { ++ EGLSurface surface = EGL_NO_SURFACE; ++ surface = gl::GLContextEGL::CreateEGLSurfaceForCompositorWidget( ++ aWidget, /* aForceAccelerated */ true); ++ if (surface == EGL_NO_SURFACE) { ++ gfxCriticalNote << "Failed to create EGLSurface"; ++ } ++ return surface; ++} ++ ++RenderCompositorEGL::RenderCompositorEGL( ++ RefPtr<gl::GLContext>&& aGL, RefPtr<widget::CompositorWidget>&& aWidget) ++ : RenderCompositor(std::move(aWidget)), mGL(aGL), mEGLSurface(EGL_NO_SURFACE) { ++ MOZ_ASSERT(mGL); ++} ++ ++RenderCompositorEGL::~RenderCompositorEGL() { ++ DestroyEGLSurface(); ++} ++ ++bool RenderCompositorEGL::BeginFrame() { ++ ++ if (mWidget->AsX11() && mWidget->AsX11()->WaylandRequestsUpdatingEGLSurface()) { ++ mEGLSurface = CreateEGLSurface(mWidget); ++ printf_stderr("RenderCompositorEGL::BeginFrame() mEGLSurface %p\n", mEGLSurface); ++ gl::GLContextEGL::Cast(gl())->SetEGLSurfaceOverride(mEGLSurface); ++ } ++ ++ if (!mGL->MakeCurrent()) { ++ gfxCriticalNote << "Failed to make render context current, can't draw."; ++ return false; ++ } ++ ++ return true; ++} ++ ++void RenderCompositorEGL::EndFrame() ++{ ++ if (mEGLSurface != EGL_NO_SURFACE) { ++ mGL->SwapBuffers(); ++ } ++} ++ ++void RenderCompositorEGL::WaitForGPU() {} ++ ++void RenderCompositorEGL::Pause() { ++} ++ ++bool RenderCompositorEGL::Resume() { ++ return true; ++} ++ ++bool RenderCompositorEGL::MakeCurrent() { ++ gl::GLContextEGL::Cast(gl())->SetEGLSurfaceOverride(mEGLSurface); ++ return gl()->MakeCurrent(); ++} ++ ++void RenderCompositorEGL::DestroyEGLSurface() { ++ auto* egl = gl::GLLibraryEGL::Get(); ++ ++ // Release EGLSurface of back buffer before calling ResizeBuffers(). ++ if (mEGLSurface) { ++ gl::GLContextEGL::Cast(gl())->SetEGLSurfaceOverride(EGL_NO_SURFACE); ++ egl->fDestroySurface(egl->Display(), mEGLSurface); ++ mEGLSurface = nullptr; ++ } ++} ++ ++LayoutDeviceIntSize RenderCompositorEGL::GetBufferSize() { ++ return mWidget->GetClientSize(); ++} ++ ++} // namespace wr ++} // namespace mozilla +diff --git gfx/webrender_bindings/RenderCompositorEGL.h gfx/webrender_bindings/RenderCompositorEGL.h +new file mode 100644 +index 000000000000..f12e16d974af +--- /dev/null ++++ gfx/webrender_bindings/RenderCompositorEGL.h +@@ -0,0 +1,54 @@ ++/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* vim: set ts=8 sts=2 et sw=2 tw=80: */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#ifndef MOZILLA_GFX_RENDERCOMPOSITOR_EGL_H ++#define MOZILLA_GFX_RENDERCOMPOSITOR_EGL_H ++ ++#include "GLTypes.h" ++#include "mozilla/webrender/RenderCompositor.h" ++ ++namespace mozilla { ++ ++namespace wr { ++ ++class RenderCompositorEGL : public RenderCompositor { ++ public: ++ static UniquePtr<RenderCompositor> Create( ++ RefPtr<widget::CompositorWidget> aWidget); ++ ++ RenderCompositorEGL(RefPtr<gl::GLContext>&& aGL, ++ RefPtr<widget::CompositorWidget>&& aWidget); ++ virtual ~RenderCompositorEGL(); ++ ++ bool BeginFrame() override; ++ void EndFrame() override; ++ void WaitForGPU() override; ++ void Pause() override; ++ bool Resume() override; ++ ++ gl::GLContext* gl() const override { return mGL; } ++ ++ bool MakeCurrent() override; ++ ++ bool UseANGLE() const override { return false; } ++ ++ LayoutDeviceIntSize GetBufferSize() override; ++ ++ protected: ++ static already_AddRefed<gl::GLContext> CreateGLContext( ++ RefPtr<widget::CompositorWidget> aWidget); ++ static EGLSurface CreateEGLSurface(widget::CompositorWidget* aWidget); ++ ++ void DestroyEGLSurface(); ++ ++ RefPtr<gl::GLContext> mGL; ++ EGLSurface mEGLSurface; ++}; ++ ++} // namespace wr ++} // namespace mozilla ++ ++#endif // MOZILLA_GFX_RENDERCOMPOSITOR_EGL_H +diff --git gfx/webrender_bindings/moz.build gfx/webrender_bindings/moz.build +index 4acdfbb817d3..f632bc5d24d9 100644 +--- gfx/webrender_bindings/moz.build ++++ gfx/webrender_bindings/moz.build +@@ -67,6 +67,14 @@ if CONFIG['MOZ_ENABLE_D3D10_LAYER']: + 'RenderCompositorANGLE.cpp', + ] + ++if CONFIG['MOZ_WAYLAND']: ++ EXPORTS.mozilla.webrender += [ ++ 'RenderCompositorEGL.h', ++ ] ++ SOURCES += [ ++ 'RenderCompositorEGL.cpp', ++ ] ++ + if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk3'): + CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS'] + CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS'] +@@ -75,5 +83,7 @@ include('/ipc/chromium/chromium-config.mozbuild') + + FINAL_LIBRARY = 'xul' + ++CXXFLAGS += CONFIG['TK_CFLAGS'] ++ + if CONFIG['CC_TYPE'] == 'clang-cl': + AllowCompilerWarnings() # workaround for bug 1090497 +diff --git widget/gtk/CompositorWidgetChild.cpp widget/gtk/CompositorWidgetChild.cpp +index b746fec0a283..07847a298707 100644 +--- widget/gtk/CompositorWidgetChild.cpp ++++ widget/gtk/CompositorWidgetChild.cpp +@@ -35,5 +35,11 @@ void CompositorWidgetChild::NotifyClientSizeChanged( + Unused << SendNotifyClientSizeChanged(aClientSize); + } + ++#ifdef MOZ_WAYLAND ++void CompositorWidgetChild::RequestsUpdatingEGLSurface() { ++ Unused << SendRequestsUpdatingEGLSurface(); ++} ++#endif ++ + } // namespace widget + } // namespace mozilla +diff --git widget/gtk/CompositorWidgetChild.h widget/gtk/CompositorWidgetChild.h +index fe3285eb6f22..0167dbb051c6 100644 +--- widget/gtk/CompositorWidgetChild.h ++++ widget/gtk/CompositorWidgetChild.h +@@ -24,7 +24,9 @@ class CompositorWidgetChild final : public PCompositorWidgetChild, + mozilla::ipc::IPCResult RecvUnobserveVsync() override; + + void NotifyClientSizeChanged(const LayoutDeviceIntSize& aClientSize) override; +- ++#ifdef MOZ_WAYLAND ++ void RequestsUpdatingEGLSurface() override; ++#endif + private: + RefPtr<CompositorVsyncDispatcher> mVsyncDispatcher; + RefPtr<CompositorWidgetVsyncObserver> mVsyncObserver; +diff --git widget/gtk/CompositorWidgetParent.cpp widget/gtk/CompositorWidgetParent.cpp +index ae49ec9174bc..b4031883d3a8 100644 +--- widget/gtk/CompositorWidgetParent.cpp ++++ widget/gtk/CompositorWidgetParent.cpp +@@ -40,5 +40,11 @@ mozilla::ipc::IPCResult CompositorWidgetParent::RecvNotifyClientSizeChanged( + return IPC_OK(); + } + ++mozilla::ipc::IPCResult CompositorWidgetParent::RecvRequestsUpdatingEGLSurface() ++{ ++ RequestsUpdatingEGLSurface(); ++ return IPC_OK(); ++} ++ + } // namespace widget + } // namespace mozilla +diff --git widget/gtk/CompositorWidgetParent.h widget/gtk/CompositorWidgetParent.h +index 5d0ccfcf50f2..8ddd58a8964f 100644 +--- widget/gtk/CompositorWidgetParent.h ++++ widget/gtk/CompositorWidgetParent.h +@@ -27,6 +27,8 @@ class CompositorWidgetParent final : public PCompositorWidgetParent, + mozilla::ipc::IPCResult RecvNotifyClientSizeChanged( + const LayoutDeviceIntSize& aClientSize) override; + ++ mozilla::ipc::IPCResult RecvRequestsUpdatingEGLSurface() override; ++ + private: + RefPtr<VsyncObserver> mVsyncObserver; + }; +diff --git widget/gtk/GtkCompositorWidget.cpp widget/gtk/GtkCompositorWidget.cpp +index bc21d6c4d05e..f787e8c23797 100644 +--- widget/gtk/GtkCompositorWidget.cpp ++++ widget/gtk/GtkCompositorWidget.cpp +@@ -17,7 +17,8 @@ namespace widget { + GtkCompositorWidget::GtkCompositorWidget( + const GtkCompositorWidgetInitData& aInitData, + const layers::CompositorOptions& aOptions, nsWindow* aWindow) +- : CompositorWidget(aOptions), mWidget(aWindow) { ++ : CompositorWidget(aOptions), mWidget(aWindow), ++ mWaylandRequestsUpdatingEGLSurface(false) { + // If we have a nsWindow, then grab the already existing display connection + // If we don't, then use the init data to connect to the display + if (aWindow) { +@@ -85,6 +86,18 @@ void GtkCompositorWidget::NotifyClientSizeChanged( + mClientSize = aClientSize; + } + ++#ifdef MOZ_WAYLAND ++void GtkCompositorWidget::RequestsUpdatingEGLSurface() { ++ mWaylandRequestsUpdatingEGLSurface = true; ++} ++ ++bool GtkCompositorWidget::WaylandRequestsUpdatingEGLSurface() { ++ bool ret = mWaylandRequestsUpdatingEGLSurface; ++ mWaylandRequestsUpdatingEGLSurface = false; ++ return ret; ++} ++#endif ++ + LayoutDeviceIntSize GtkCompositorWidget::GetClientSize() { return mClientSize; } + + uintptr_t GtkCompositorWidget::GetWidgetKey() { +diff --git widget/gtk/GtkCompositorWidget.h widget/gtk/GtkCompositorWidget.h +index fd0c71426c18..75e156dffb02 100644 +--- widget/gtk/GtkCompositorWidget.h ++++ widget/gtk/GtkCompositorWidget.h +@@ -20,6 +20,10 @@ class PlatformCompositorWidgetDelegate : public CompositorWidgetDelegate { + virtual void NotifyClientSizeChanged( + const LayoutDeviceIntSize& aClientSize) = 0; + ++#ifdef MOZ_WAYLAND ++ virtual void RequestsUpdatingEGLSurface() = 0; ++#endif ++ + // CompositorWidgetDelegate Overrides + + PlatformCompositorWidgetDelegate* AsPlatformSpecificDelegate() override { +@@ -62,11 +66,16 @@ class GtkCompositorWidget : public CompositorWidget, + + void NotifyClientSizeChanged(const LayoutDeviceIntSize& aClientSize) override; + ++#ifdef MOZ_WAYLAND ++ void RequestsUpdatingEGLSurface() override; ++ bool WaylandRequestsUpdatingEGLSurface(); ++#endif + protected: + nsWindow* mWidget; + + private: + LayoutDeviceIntSize mClientSize; ++ bool mWaylandRequestsUpdatingEGLSurface; + + Display* mXDisplay; + Window mXWindow; +diff --git widget/gtk/PCompositorWidget.ipdl widget/gtk/PCompositorWidget.ipdl +index 178fe78e4dc2..51390e400649 100644 +--- widget/gtk/PCompositorWidget.ipdl ++++ widget/gtk/PCompositorWidget.ipdl +@@ -19,6 +19,7 @@ parent: + async __delete__(); + + async NotifyClientSizeChanged(LayoutDeviceIntSize aClientSize); ++ async RequestsUpdatingEGLSurface(); + + child: + +diff --git widget/gtk/mozcontainer.cpp widget/gtk/mozcontainer.cpp +index 8be1f133d39f..8461e7b9d470 100644 +--- widget/gtk/mozcontainer.cpp ++++ widget/gtk/mozcontainer.cpp +@@ -160,6 +160,7 @@ void moz_container_init(MozContainer *container) { + // We can draw to x11 window any time. + container->ready_to_draw = GDK_IS_X11_DISPLAY(gdk_display_get_default()); + container->surface_needs_clear = true; ++ container->egl_surface_needs_update = false; + #endif + } + +@@ -177,6 +178,9 @@ static void frame_callback_handler(void *data, struct wl_callback *callback, + uint32_t time) { + MozContainer *container = MOZ_CONTAINER(data); + g_clear_pointer(&container->frame_callback_handler, wl_callback_destroy); ++ if (!container->ready_to_draw) { ++ container->egl_surface_needs_update = true; ++ } + container->ready_to_draw = true; + } + +@@ -210,6 +214,7 @@ static void moz_container_unmap_wayland(MozContainer *container) { + g_clear_pointer(&container->frame_callback_handler, wl_callback_destroy); + + container->surface_needs_clear = true; ++ container->egl_surface_needs_update = false; + container->ready_to_draw = false; + } + +@@ -548,4 +553,10 @@ gboolean moz_container_surface_needs_clear(MozContainer *container) { + container->surface_needs_clear = false; + return state; + } ++ ++gboolean moz_container_egl_surface_needs_update(MozContainer *container){ ++ gboolean state = container->egl_surface_needs_update; ++ container->egl_surface_needs_update = false; ++ return state; ++} + #endif +diff --git widget/gtk/mozcontainer.h widget/gtk/mozcontainer.h +index e9c218c1bc3e..1ed6f439805d 100644 +--- widget/gtk/mozcontainer.h ++++ widget/gtk/mozcontainer.h +@@ -77,6 +77,7 @@ struct _MozContainer { + struct wl_egl_window *eglwindow; + struct wl_callback *frame_callback_handler; + gboolean surface_needs_clear; ++ gboolean egl_surface_needs_update; + gboolean ready_to_draw; + #endif + }; +@@ -96,6 +97,7 @@ struct wl_egl_window *moz_container_get_wl_egl_window( + + gboolean moz_container_has_wl_egl_window(MozContainer *container); + gboolean moz_container_surface_needs_clear(MozContainer *container); ++gboolean moz_container_egl_surface_needs_update(MozContainer *container); + #endif + + #endif /* __MOZ_CONTAINER_H__ */ +diff --git widget/gtk/nsWindow.cpp widget/gtk/nsWindow.cpp +index 50e6354ea374..ceabbf583a42 100644 +--- widget/gtk/nsWindow.cpp ++++ widget/gtk/nsWindow.cpp +@@ -1885,6 +1885,11 @@ gboolean nsWindow::OnExposeEvent(cairo_t *cr) { + region.ScaleRoundOut(scale, scale); + + if (GetLayerManager()->AsKnowsCompositor() && mCompositorSession) { ++#ifdef MOZ_WAYLAND ++ if(mCompositorWidgetDelegate && WaylandRequestsUpdatingEGLSurface()) { ++ mCompositorWidgetDelegate->RequestsUpdatingEGLSurface(); ++ } ++#endif + // We need to paint to the screen even if nothing changed, since if we + // don't have a compositing window manager, our pixels could be stale. + GetLayerManager()->SetNeedsComposite(true); +@@ -6405,6 +6410,17 @@ bool nsWindow::WaylandSurfaceNeedsClear() { + "nsWindow::WaylandSurfaceNeedsClear(): We don't have any mContainer!"); + return false; + } ++ ++bool nsWindow::WaylandRequestsUpdatingEGLSurface() { ++ if (mContainer) { ++ return moz_container_egl_surface_needs_update(MOZ_CONTAINER(mContainer)); ++ } ++ ++ NS_WARNING( ++ "nsWindow::WaylandSurfaceNeedsClear(): We don't have any mContainer!"); ++ return false; ++} ++ + #endif + + #ifdef MOZ_X11 +diff --git widget/gtk/nsWindow.h widget/gtk/nsWindow.h +index b528ebfdeccb..ea0be70d7eb2 100644 +--- widget/gtk/nsWindow.h ++++ widget/gtk/nsWindow.h +@@ -343,6 +343,7 @@ class nsWindow final : public nsBaseWidget { + wl_display* GetWaylandDisplay(); + wl_surface* GetWaylandSurface(); + bool WaylandSurfaceNeedsClear(); ++ bool WaylandRequestsUpdatingEGLSurface(); + #endif + virtual void GetCompositorWidgetInitData( + mozilla::widget::CompositorWidgetInitData* aInitData) override; diff --git a/www/firefox/files/patch-bug847568 b/www/firefox/files/patch-bug847568 index becc63bcfc5b..e185483ec441 100644 --- a/www/firefox/files/patch-bug847568 +++ b/www/firefox/files/patch-bug847568 @@ -213,9 +213,9 @@ diff --git toolkit/library/moz.build toolkit/library/moz.build index 24f940e1ed7e..079a575adec3 100644 --- toolkit/library/moz.build +++ toolkit/library/moz.build -@@ -223,6 +223,12 @@ if CONFIG['MOZ_SYSTEM_JPEG']: - if CONFIG['MOZ_SYSTEM_PNG']: - OS_LIBS += CONFIG['MOZ_PNG_LIBS'] +@@ -226,6 +226,12 @@ if CONFIG['MOZ_SYSTEM_PNG']: + if CONFIG['MOZ_SYSTEM_WEBP']: + OS_LIBS += CONFIG['MOZ_WEBP_LIBS'] +if CONFIG['MOZ_SYSTEM_GRAPHITE2']: + OS_LIBS += CONFIG['MOZ_GRAPHITE2_LIBS'] @@ -230,7 +230,7 @@ diff --git toolkit/moz.configure toolkit/moz.configure index 9297e4d6f501..d8e273887e4b 100644 --- toolkit/moz.configure +++ toolkit/moz.configure -@@ -883,6 +883,26 @@ add_old_configure_assignment('FT2_LIBS', +@@ -894,6 +894,26 @@ add_old_configure_assignment('FT2_LIBS', add_old_configure_assignment('FT2_CFLAGS', ft2_info.cflags) @@ -254,6 +254,6 @@ index 9297e4d6f501..d8e273887e4b 100644 + +set_config('MOZ_SYSTEM_HARFBUZZ', depends_if(system_harfbuzz)(lambda _: True)) + - # Mortar + # Marionette remote protocol # ============================================================== - option('--enable-mortar', help='Enable mortar extension') + # |