Update to 62.0
This commit is contained in:
parent
35295a20e5
commit
bd77262828
2
.gitignore
vendored
2
.gitignore
vendored
@ -306,3 +306,5 @@ firefox-3.6.4.source.tar.bz2
|
||||
/firefox-langpacks-61.0.1-20180710.tar.xz
|
||||
/firefox-langpacks-61.0.2-20180809.tar.xz
|
||||
/firefox-61.0.2.source.tar.xz
|
||||
/firefox-langpacks-62.0-20180828.tar.xz
|
||||
/firefox-62.0.source.tar.xz
|
||||
|
57
firefox.spec
57
firefox.spec
@ -102,13 +102,13 @@
|
||||
|
||||
Summary: Mozilla Firefox Web browser
|
||||
Name: firefox
|
||||
Version: 61.0.2
|
||||
Release: 3%{?pre_tag}%{?dist}
|
||||
Version: 62.0
|
||||
Release: 1%{?pre_tag}%{?dist}
|
||||
URL: https://www.mozilla.org/firefox/
|
||||
License: MPLv1.1 or GPLv2+ or LGPLv2+
|
||||
Source0: https://hg.mozilla.org/releases/mozilla-release/archive/firefox-%{version}%{?pre_version}.source.tar.xz
|
||||
%if %{build_langpacks}
|
||||
Source1: firefox-langpacks-%{version}%{?pre_version}-20180809.tar.xz
|
||||
Source1: firefox-langpacks-%{version}%{?pre_version}-20180828.tar.xz
|
||||
%endif
|
||||
Source10: firefox-mozconfig
|
||||
Source12: firefox-redhat-default-prefs.js
|
||||
@ -159,37 +159,15 @@ Patch414: mozilla-1435212-ffmpeg-4.0.patch
|
||||
Patch415: Bug-1238661---fix-mozillaSignalTrampoline-to-work-.patch
|
||||
Patch416: mozilla-1424422.patch
|
||||
Patch417: bug1375074-save-restore-x28.patch
|
||||
Patch418: mozilla-1436242.patch
|
||||
Patch419: rb244676.patch
|
||||
Patch420: rb246462.patch
|
||||
|
||||
Patch421: complete-csd-window-offset-mozilla-1457691.patch
|
||||
|
||||
# Wayland specific upstream patches
|
||||
Patch450: mozilla-1438131.patch
|
||||
Patch451: mozilla-1438136.patch
|
||||
Patch452: mozilla-1460603.patch
|
||||
Patch453: mozilla-1460605-1.patch
|
||||
Patch454: mozilla-1460605-2.patch
|
||||
Patch455: mozilla-1460810.patch
|
||||
Patch456: mozilla-1461306.patch
|
||||
Patch457: mozilla-1462622.patch
|
||||
Patch458: mozilla-1462642.patch
|
||||
Patch459: mozilla-1463753.patch
|
||||
Patch560: rb244010.patch
|
||||
Patch561: rb244012.patch
|
||||
Patch562: rb246410.patch
|
||||
Patch563: rb245262.patch
|
||||
Patch564: mozilla-1464808.patch
|
||||
Patch565: mozilla-1464823.patch
|
||||
Patch566: mozilla-1466473.patch
|
||||
Patch567: mozilla-1444437.patch
|
||||
Patch568: mozilla-1441743.patch
|
||||
Patch569: mozilla-1465371.patch
|
||||
Patch570: mozilla-1467125.patch
|
||||
Patch571: mozilla-1468670.patch
|
||||
Patch572: mozilla-1467128.patch
|
||||
Patch573: rb255772.patch
|
||||
|
||||
# Debian patches
|
||||
Patch500: mozilla-440908.patch
|
||||
@ -356,7 +334,7 @@ This package contains results of tests executed during build.
|
||||
%patch219 -p2 -b .rhbz-1173156
|
||||
%patch221 -p2 -b .fedora-ua
|
||||
%patch224 -p1 -b .1170092
|
||||
%patch225 -p1 -b .1005640-accept-lang
|
||||
#%patch225 -p1 -b .1005640-accept-lang
|
||||
#ARM run-time patch
|
||||
%ifarch aarch64
|
||||
%patch226 -p1 -b .1354671
|
||||
@ -370,7 +348,6 @@ This package contains results of tests executed during build.
|
||||
%endif
|
||||
#%patch416 -p1 -b .1424422
|
||||
#%patch417 -p1 -b .bug1375074-save-restore-x28
|
||||
%patch418 -p1 -b .mozilla-1436242
|
||||
%patch419 -p1 -b .rb244676
|
||||
%patch420 -p1 -b .rb246462
|
||||
|
||||
@ -383,30 +360,9 @@ This package contains results of tests executed during build.
|
||||
|
||||
# Wayland specific upstream patches
|
||||
%if %{?wayland_backend}
|
||||
%patch453 -p1 -b .mozilla-1460605-1
|
||||
%patch454 -p1 -b .mozilla-1460605-2
|
||||
%patch455 -p1 -b .mozilla-1460810
|
||||
%patch456 -p1 -b .mozilla-1461306
|
||||
%patch457 -p1 -b .mozilla-1462622
|
||||
%patch451 -p1 -b .mozilla-1438136
|
||||
%patch450 -p1 -b .mozilla-1438131
|
||||
%patch459 -p1 -b .mozilla-1463753
|
||||
%patch458 -p1 -b .mozilla-1462642
|
||||
%patch452 -p1 -b .mozilla-1460603
|
||||
%patch560 -p1 -b .rb244010
|
||||
%patch561 -p1 -b .rb244012
|
||||
%patch562 -p1 -b .rb246410
|
||||
%patch563 -p1 -b .rb245262
|
||||
%patch564 -p1 -b .mozilla-1464808
|
||||
%patch565 -p1 -b .mozilla-1464823
|
||||
%patch566 -p1 -b .mozilla-1466473
|
||||
%patch567 -p1 -b .mozilla-1444437
|
||||
%patch568 -p1 -b .mozilla-1441743
|
||||
%patch569 -p1 -b .mozilla-1465371
|
||||
#%patch567 -p1 -b .mozilla-1444437 -fix
|
||||
%patch570 -p1 -b .mozilla-1467125
|
||||
%patch571 -p1 -b .mozilla-1468670
|
||||
%patch572 -p1 -b .mozilla-1467128
|
||||
%patch573 -p1 -b .rb255772
|
||||
%endif
|
||||
|
||||
%{__rm} -f .mozconfig
|
||||
@ -936,6 +892,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
%changelog
|
||||
* Tue Aug 28 2018 Martin Stransky <stransky@redhat.com> - 62.0-1
|
||||
- Update to 62.0
|
||||
|
||||
* Wed Aug 15 2018 Ondrej Zoder <ozoder@redhat.com> - 61.0.2-3
|
||||
- Added patches for mozbz#1427700 and mozbz#1463809
|
||||
|
||||
|
@ -1,56 +0,0 @@
|
||||
|
||||
# HG changeset patch
|
||||
# User Jed Davis <jld@mozilla.com>
|
||||
# Date 1526943705 21600
|
||||
# Node ID 6bb3adfa15c6877f7874429462dad88f8c978c4f
|
||||
# Parent 4c71c8454879c841871ecf3afb7dbdc96bad97fc
|
||||
Bug 1436242 - Avoid undefined behavior in IPC fd-passing code. r=froydnj
|
||||
|
||||
MozReview-Commit-ID: 3szIPUssgF5
|
||||
|
||||
diff --git a/ipc/chromium/src/chrome/common/ipc_channel_posix.cc b/ipc/chromium/src/chrome/common/ipc_channel_posix.cc
|
||||
--- a/ipc/chromium/src/chrome/common/ipc_channel_posix.cc
|
||||
+++ b/ipc/chromium/src/chrome/common/ipc_channel_posix.cc
|
||||
@@ -418,20 +418,37 @@ bool Channel::ChannelImpl::ProcessIncomi
|
||||
const int* fds;
|
||||
unsigned num_fds;
|
||||
unsigned fds_i = 0; // the index of the first unused descriptor
|
||||
|
||||
if (input_overflow_fds_.empty()) {
|
||||
fds = wire_fds;
|
||||
num_fds = num_wire_fds;
|
||||
} else {
|
||||
- const size_t prev_size = input_overflow_fds_.size();
|
||||
- input_overflow_fds_.resize(prev_size + num_wire_fds);
|
||||
- memcpy(&input_overflow_fds_[prev_size], wire_fds,
|
||||
- num_wire_fds * sizeof(int));
|
||||
+ // This code may look like a no-op in the case where
|
||||
+ // num_wire_fds == 0, but in fact:
|
||||
+ //
|
||||
+ // 1. wire_fds will be nullptr, so passing it to memcpy is
|
||||
+ // undefined behavior according to the C standard, even though
|
||||
+ // the memcpy length is 0.
|
||||
+ //
|
||||
+ // 2. prev_size will be an out-of-bounds index for
|
||||
+ // input_overflow_fds_; this is undefined behavior according to
|
||||
+ // the C++ standard, even though the element only has its
|
||||
+ // pointer taken and isn't accessed (and the corresponding
|
||||
+ // operation on a C array would be defined).
|
||||
+ //
|
||||
+ // UBSan makes #1 a fatal error, and assertions in libstdc++ do
|
||||
+ // the same for #2 if enabled.
|
||||
+ if (num_wire_fds > 0) {
|
||||
+ const size_t prev_size = input_overflow_fds_.size();
|
||||
+ input_overflow_fds_.resize(prev_size + num_wire_fds);
|
||||
+ memcpy(&input_overflow_fds_[prev_size], wire_fds,
|
||||
+ num_wire_fds * sizeof(int));
|
||||
+ }
|
||||
fds = &input_overflow_fds_[0];
|
||||
num_fds = input_overflow_fds_.size();
|
||||
}
|
||||
|
||||
// The data for the message we're currently reading consists of any data
|
||||
// stored in incoming_message_ followed by data in input_buf_ (followed by
|
||||
// other messages).
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,34 +0,0 @@
|
||||
|
||||
# HG changeset patch
|
||||
# User Evan Klitzke <evan@eklitzke.org>
|
||||
# Date 1526337180 -10800
|
||||
# Node ID 5c1d015760f220f5438ffa23a585140db7a9801d
|
||||
# Parent 505667081ae29ee0a66ef5ba19c3870570b08564
|
||||
Bug 1438136 - [Wayland/Clipboard] Null terminate text string returned by GetClipboardText(), r=stransky
|
||||
|
||||
diff --git a/widget/gtk/nsClipboardWayland.cpp b/widget/gtk/nsClipboardWayland.cpp
|
||||
--- a/widget/gtk/nsClipboardWayland.cpp
|
||||
+++ b/widget/gtk/nsClipboardWayland.cpp
|
||||
@@ -666,19 +666,20 @@ void
|
||||
nsRetrievalContextWayland::TransferFastTrackClipboard(
|
||||
int aClipboardRequestNumber, GtkSelectionData *aSelectionData)
|
||||
{
|
||||
if (mClipboardRequestNumber == aClipboardRequestNumber) {
|
||||
int dataLength = gtk_selection_data_get_length(aSelectionData);
|
||||
if (dataLength > 0) {
|
||||
mClipboardDataLength = dataLength;
|
||||
mClipboardData = reinterpret_cast<char*>(
|
||||
- g_malloc(sizeof(char)*mClipboardDataLength));
|
||||
+ g_malloc(sizeof(char)*(mClipboardDataLength+1)));
|
||||
memcpy(mClipboardData, gtk_selection_data_get_data(aSelectionData),
|
||||
sizeof(char)*mClipboardDataLength);
|
||||
+ mClipboardData[mClipboardDataLength] = '\0';
|
||||
}
|
||||
} else {
|
||||
NS_WARNING("Received obsoleted clipboard data!");
|
||||
}
|
||||
}
|
||||
|
||||
const char*
|
||||
nsRetrievalContextWayland::GetClipboardData(const char* aMimeType,
|
||||
|
@ -1,336 +0,0 @@
|
||||
diff --git a/widget/gtk/WindowSurfaceWayland.h b/widget/gtk/WindowSurfaceWayland.h
|
||||
--- a/widget/gtk/WindowSurfaceWayland.h
|
||||
+++ b/widget/gtk/WindowSurfaceWayland.h
|
||||
@@ -3,16 +3,17 @@
|
||||
* 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_WIDGET_GTK_WINDOW_SURFACE_WAYLAND_H
|
||||
#define _MOZILLA_WIDGET_GTK_WINDOW_SURFACE_WAYLAND_H
|
||||
|
||||
#include <prthread.h>
|
||||
+#include "mozilla/gfx/Types.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace widget {
|
||||
|
||||
// Our general connection to Wayland display server,
|
||||
// holds our display connection and runs event loop.
|
||||
class nsWaylandDisplay : public nsISupports {
|
||||
NS_DECL_THREADSAFE_ISUPPORTS
|
||||
@@ -61,17 +62,17 @@ private:
|
||||
};
|
||||
|
||||
// Holds actual graphics data for wl_surface
|
||||
class WindowBackBuffer {
|
||||
public:
|
||||
WindowBackBuffer(nsWaylandDisplay* aDisplay, int aWidth, int aHeight);
|
||||
~WindowBackBuffer();
|
||||
|
||||
- already_AddRefed<gfx::DrawTarget> Lock(const LayoutDeviceIntRegion& aRegion);
|
||||
+ already_AddRefed<gfx::DrawTarget> Lock();
|
||||
|
||||
void Attach(wl_surface* aSurface);
|
||||
void Detach();
|
||||
bool IsAttached() { return mAttached; }
|
||||
|
||||
bool Resize(int aWidth, int aHeight);
|
||||
bool SetImageDataFromBackBuffer(class WindowBackBuffer* aSourceBuffer);
|
||||
|
||||
@@ -107,27 +108,33 @@ public:
|
||||
WindowSurfaceWayland(nsWindow *aWindow);
|
||||
~WindowSurfaceWayland();
|
||||
|
||||
already_AddRefed<gfx::DrawTarget> Lock(const LayoutDeviceIntRegion& aRegion) override;
|
||||
void Commit(const LayoutDeviceIntRegion& aInvalidRegion) final;
|
||||
void FrameCallbackHandler();
|
||||
|
||||
private:
|
||||
- WindowBackBuffer* GetBufferToDraw(int aWidth, int aHeight);
|
||||
+ WindowBackBuffer* GetFrontBufferToDraw(int aWidth, int aHeight);
|
||||
void UpdateScaleFactor();
|
||||
|
||||
+ already_AddRefed<gfx::DrawTarget> LockFrontBuffer(int aWidth, int aHeight);
|
||||
+ already_AddRefed<gfx::DrawTarget> LockImageSurface(const gfx::IntSize& aLockSize);
|
||||
+ bool CommitImageSurface(const LayoutDeviceIntRegion& aRegion);
|
||||
+
|
||||
// TODO: Do we need to hold a reference to nsWindow object?
|
||||
nsWindow* mWindow;
|
||||
nsWaylandDisplay* mWaylandDisplay;
|
||||
WindowBackBuffer* mFrontBuffer;
|
||||
WindowBackBuffer* mBackBuffer;
|
||||
+ RefPtr<gfxImageSurface> mImageSurface;
|
||||
wl_callback* mFrameCallback;
|
||||
wl_surface* mFrameCallbackSurface;
|
||||
MessageLoop* mDisplayThreadMessageLoop;
|
||||
+ bool mDirectWlBufferDraw;
|
||||
bool mDelayedCommit;
|
||||
bool mFullScreenDamage;
|
||||
bool mIsMainThread;
|
||||
};
|
||||
|
||||
} // namespace widget
|
||||
} // namespace mozilla
|
||||
|
||||
|
||||
diff --git a/widget/gtk/WindowSurfaceWayland.cpp b/widget/gtk/WindowSurfaceWayland.cpp
|
||||
--- a/widget/gtk/WindowSurfaceWayland.cpp
|
||||
+++ b/widget/gtk/WindowSurfaceWayland.cpp
|
||||
@@ -299,16 +299,17 @@ nsWaylandDisplay::Matches(wl_display *aD
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsWaylandDisplay, nsISupports);
|
||||
|
||||
nsWaylandDisplay::nsWaylandDisplay(wl_display *aDisplay)
|
||||
: mThreadId(PR_GetCurrentThread())
|
||||
// gfx::SurfaceFormat::B8G8R8A8 is a basic Wayland format
|
||||
// and is always present.
|
||||
+ // TODO: Provide also format without alpha (Bug 1470126).
|
||||
, mFormat(gfx::SurfaceFormat::B8G8R8A8)
|
||||
, mShm(nullptr)
|
||||
, mDisplay(aDisplay)
|
||||
{
|
||||
if (NS_IsMainThread()) {
|
||||
// Use default event queue in main thread operated by Gtk+.
|
||||
mEventQueue = nullptr;
|
||||
} else {
|
||||
@@ -530,21 +531,19 @@ WindowBackBuffer::SetImageDataFromBackBu
|
||||
}
|
||||
|
||||
mShmPool.SetImageDataFromPool(&aSourceBuffer->mShmPool,
|
||||
aSourceBuffer->mWidth * aSourceBuffer->mHeight * BUFFER_BPP);
|
||||
return true;
|
||||
}
|
||||
|
||||
already_AddRefed<gfx::DrawTarget>
|
||||
-WindowBackBuffer::Lock(const LayoutDeviceIntRegion& aRegion)
|
||||
+WindowBackBuffer::Lock()
|
||||
{
|
||||
- gfx::IntRect bounds = aRegion.GetBounds().ToUnknownRect();
|
||||
- gfx::IntSize lockSize(bounds.XMost(), bounds.YMost());
|
||||
-
|
||||
+ gfx::IntSize lockSize(mWidth, mHeight);
|
||||
return gfxPlatform::CreateDrawTargetForData(static_cast<unsigned char*>(mShmPool.GetImageData()),
|
||||
lockSize,
|
||||
BUFFER_BPP * mWidth,
|
||||
mWaylandDisplay->GetSurfaceFormat());
|
||||
}
|
||||
|
||||
static void
|
||||
frame_callback_handler(void *data, struct wl_callback *callback, uint32_t time)
|
||||
@@ -560,16 +559,17 @@ static const struct wl_callback_listener
|
||||
WindowSurfaceWayland::WindowSurfaceWayland(nsWindow *aWindow)
|
||||
: mWindow(aWindow)
|
||||
, mWaylandDisplay(WaylandDisplayGet(aWindow->GetWaylandDisplay()))
|
||||
, mFrontBuffer(nullptr)
|
||||
, mBackBuffer(nullptr)
|
||||
, mFrameCallback(nullptr)
|
||||
, mFrameCallbackSurface(nullptr)
|
||||
, mDisplayThreadMessageLoop(MessageLoop::current())
|
||||
+ , mDirectWlBufferDraw(true)
|
||||
, mDelayedCommit(false)
|
||||
, mFullScreenDamage(false)
|
||||
, mIsMainThread(NS_IsMainThread())
|
||||
{
|
||||
}
|
||||
|
||||
WindowSurfaceWayland::~WindowSurfaceWayland()
|
||||
{
|
||||
@@ -598,17 +598,17 @@ WindowSurfaceWayland::UpdateScaleFactor(
|
||||
{
|
||||
wl_surface* waylandSurface = mWindow->GetWaylandSurface();
|
||||
if (waylandSurface) {
|
||||
wl_surface_set_buffer_scale(waylandSurface, mWindow->GdkScaleFactor());
|
||||
}
|
||||
}
|
||||
|
||||
WindowBackBuffer*
|
||||
-WindowSurfaceWayland::GetBufferToDraw(int aWidth, int aHeight)
|
||||
+WindowSurfaceWayland::GetFrontBufferToDraw(int aWidth, int aHeight)
|
||||
{
|
||||
if (!mFrontBuffer) {
|
||||
mFrontBuffer = new WindowBackBuffer(mWaylandDisplay, aWidth, aHeight);
|
||||
mBackBuffer = new WindowBackBuffer(mWaylandDisplay, aWidth, aHeight);
|
||||
return mFrontBuffer;
|
||||
}
|
||||
|
||||
if (!mFrontBuffer->IsAttached()) {
|
||||
@@ -647,46 +647,149 @@ WindowSurfaceWayland::GetBufferToDraw(in
|
||||
// the new buffer and leave gecko to render new whole content.
|
||||
mFrontBuffer->Resize(aWidth, aHeight);
|
||||
}
|
||||
|
||||
return mFrontBuffer;
|
||||
}
|
||||
|
||||
already_AddRefed<gfx::DrawTarget>
|
||||
+WindowSurfaceWayland::LockFrontBuffer(int aWidth, int aHeight)
|
||||
+{
|
||||
+ WindowBackBuffer* buffer = GetFrontBufferToDraw(aWidth, aHeight);
|
||||
+ if (buffer) {
|
||||
+ return buffer->Lock();
|
||||
+ }
|
||||
+
|
||||
+ NS_WARNING("WindowSurfaceWayland::LockFrontBuffer(): No buffer available");
|
||||
+ return nullptr;
|
||||
+}
|
||||
+
|
||||
+already_AddRefed<gfx::DrawTarget>
|
||||
+WindowSurfaceWayland::LockImageSurface(const gfx::IntSize& aLockSize)
|
||||
+{
|
||||
+ if (!mImageSurface || mImageSurface->CairoStatus() ||
|
||||
+ !(aLockSize <= mImageSurface->GetSize())) {
|
||||
+ mImageSurface = new gfxImageSurface(aLockSize,
|
||||
+ SurfaceFormatToImageFormat(mWaylandDisplay->GetSurfaceFormat()));
|
||||
+ if (mImageSurface->CairoStatus()) {
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return gfxPlatform::CreateDrawTargetForData(mImageSurface->Data(),
|
||||
+ mImageSurface->GetSize(),
|
||||
+ mImageSurface->Stride(),
|
||||
+ mWaylandDisplay->GetSurfaceFormat());
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ There are some situations which can happen here:
|
||||
+
|
||||
+ A) Lock() is called to whole surface. In that case we don't need
|
||||
+ to clip/buffer the drawing and we can return wl_buffer directly
|
||||
+ for drawing.
|
||||
+ - mFrontBuffer is available - that's an ideal situation.
|
||||
+ - mFrontBuffer is locked by compositor - flip buffers and draw.
|
||||
+ - if we can't flip buffers - go B)
|
||||
+
|
||||
+ B) Lock() is requested for part(s) of screen. We need to provide temporary
|
||||
+ surface to draw into and copy result (clipped) to target wl_surface.
|
||||
+ */
|
||||
+already_AddRefed<gfx::DrawTarget>
|
||||
WindowSurfaceWayland::Lock(const LayoutDeviceIntRegion& aRegion)
|
||||
{
|
||||
MOZ_ASSERT(mIsMainThread == NS_IsMainThread());
|
||||
|
||||
- // We allocate back buffer to widget size but return only
|
||||
- // portion requested by aRegion.
|
||||
- LayoutDeviceIntRect rect = mWindow->GetBounds();
|
||||
- WindowBackBuffer* buffer = GetBufferToDraw(rect.width,
|
||||
- rect.height);
|
||||
- if (!buffer) {
|
||||
- NS_WARNING("No drawing buffer available");
|
||||
- return nullptr;
|
||||
+ LayoutDeviceIntRect screenRect = mWindow->GetBounds();
|
||||
+ gfx::IntRect bounds = aRegion.GetBounds().ToUnknownRect();
|
||||
+ gfx::IntSize lockSize(bounds.XMost(), bounds.YMost());
|
||||
+
|
||||
+ // Are we asked for entire nsWindow to draw?
|
||||
+ mDirectWlBufferDraw = (aRegion.GetNumRects() == 1 &&
|
||||
+ bounds.x == 0 && bounds.y == 0 &&
|
||||
+ lockSize.width == screenRect.width &&
|
||||
+ lockSize.height == screenRect.height);
|
||||
+
|
||||
+ if (mDirectWlBufferDraw) {
|
||||
+ RefPtr<gfx::DrawTarget> dt = LockFrontBuffer(screenRect.width,
|
||||
+ screenRect.height);
|
||||
+ if (dt) {
|
||||
+ return dt.forget();
|
||||
+ }
|
||||
+
|
||||
+ // We don't have any front buffer available. Try indirect drawing
|
||||
+ // to mImageSurface which is mirrored to front buffer at commit.
|
||||
+ mDirectWlBufferDraw = false;
|
||||
}
|
||||
|
||||
- return buffer->Lock(aRegion);
|
||||
+ return LockImageSurface(lockSize);
|
||||
+}
|
||||
+
|
||||
+bool
|
||||
+WindowSurfaceWayland::CommitImageSurface(const LayoutDeviceIntRegion& aRegion)
|
||||
+{
|
||||
+ MOZ_ASSERT(!mDirectWlBufferDraw);
|
||||
+
|
||||
+ LayoutDeviceIntRect screenRect = mWindow->GetBounds();
|
||||
+ gfx::IntRect bounds = aRegion.GetBounds().ToUnknownRect();
|
||||
+
|
||||
+ gfx::Rect rect(bounds);
|
||||
+ if (rect.IsEmpty()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ RefPtr<gfx::DrawTarget> dt = LockFrontBuffer(screenRect.width,
|
||||
+ screenRect.height);
|
||||
+ RefPtr<gfx::SourceSurface> surf =
|
||||
+ gfx::Factory::CreateSourceSurfaceForCairoSurface(mImageSurface->CairoSurface(),
|
||||
+ mImageSurface->GetSize(),
|
||||
+ mImageSurface->Format());
|
||||
+ if (!dt || !surf) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ uint32_t numRects = aRegion.GetNumRects();
|
||||
+ if (numRects != 1) {
|
||||
+ AutoTArray<IntRect, 32> rects;
|
||||
+ rects.SetCapacity(numRects);
|
||||
+ for (auto iter = aRegion.RectIter(); !iter.Done(); iter.Next()) {
|
||||
+ rects.AppendElement(iter.Get().ToUnknownRect());
|
||||
+ }
|
||||
+ dt->PushDeviceSpaceClipRects(rects.Elements(), rects.Length());
|
||||
+ }
|
||||
+
|
||||
+ dt->DrawSurface(surf, rect, rect);
|
||||
+
|
||||
+ if (numRects != 1) {
|
||||
+ dt->PopClip();
|
||||
+ }
|
||||
+
|
||||
+ return true;
|
||||
}
|
||||
|
||||
void
|
||||
WindowSurfaceWayland::Commit(const LayoutDeviceIntRegion& aInvalidRegion)
|
||||
{
|
||||
MOZ_ASSERT(mIsMainThread == NS_IsMainThread());
|
||||
|
||||
wl_surface* waylandSurface = mWindow->GetWaylandSurface();
|
||||
if (!waylandSurface) {
|
||||
// Target window is already destroyed - don't bother to render there.
|
||||
+ NS_WARNING("WindowSurfaceWayland::Commit(): parent wl_surface is already hidden/deleted.");
|
||||
return;
|
||||
}
|
||||
wl_proxy_set_queue((struct wl_proxy *)waylandSurface,
|
||||
mWaylandDisplay->GetEventQueue());
|
||||
|
||||
+ if (!mDirectWlBufferDraw) {
|
||||
+ // We have new content at mImageSurface - copy data to mFrontBuffer first.
|
||||
+ CommitImageSurface(aInvalidRegion);
|
||||
+ }
|
||||
+
|
||||
if (mFullScreenDamage) {
|
||||
LayoutDeviceIntRect rect = mWindow->GetBounds();
|
||||
wl_surface_damage(waylandSurface, 0, 0, rect.width, rect.height);
|
||||
mFullScreenDamage = false;
|
||||
} else {
|
||||
for (auto iter = aInvalidRegion.RectIter(); !iter.Done(); iter.Next()) {
|
||||
const mozilla::LayoutDeviceIntRect &r = iter.Get();
|
||||
wl_surface_damage(waylandSurface, r.x, r.y, r.width, r.height);
|
||||
@@ -730,17 +833,17 @@ WindowSurfaceWayland::FrameCallbackHandl
|
||||
mFrameCallback = nullptr;
|
||||
mFrameCallbackSurface = nullptr;
|
||||
}
|
||||
|
||||
if (mDelayedCommit) {
|
||||
wl_surface* waylandSurface = mWindow->GetWaylandSurface();
|
||||
if (!waylandSurface) {
|
||||
// Target window is already destroyed - don't bother to render there.
|
||||
- NS_WARNING("No drawing buffer available");
|
||||
+ NS_WARNING("WindowSurfaceWayland::FrameCallbackHandler(): parent wl_surface is already hidden/deleted.");
|
||||
return;
|
||||
}
|
||||
wl_proxy_set_queue((struct wl_proxy *)waylandSurface,
|
||||
mWaylandDisplay->GetEventQueue());
|
||||
|
||||
// Send pending surface to compositor and register frame callback
|
||||
// for possible subsequent drawing.
|
||||
mFrameCallback = wl_surface_frame(waylandSurface);
|
@ -1,46 +0,0 @@
|
||||
diff -up firefox-60.0.1/gfx/gl/GLLibraryEGL.cpp.mozilla-1460603 firefox-60.0.1/gfx/gl/GLLibraryEGL.cpp
|
||||
--- firefox-60.0.1/gfx/gl/GLLibraryEGL.cpp.mozilla-1460603 2018-05-16 07:38:30.000000000 +0200
|
||||
+++ firefox-60.0.1/gfx/gl/GLLibraryEGL.cpp 2018-05-25 10:58:45.170047851 +0200
|
||||
@@ -31,6 +31,13 @@
|
||||
#include "GLContextProvider.h"
|
||||
#include "gfxPrefs.h"
|
||||
#include "ScopedGLHelpers.h"
|
||||
+#ifdef MOZ_WIDGET_GTK
|
||||
+#include <gdk/gdk.h>
|
||||
+#ifdef MOZ_WAYLAND
|
||||
+#include <gdk/gdkwayland.h>
|
||||
+#include <dlfcn.h>
|
||||
+#endif // MOZ_WIDGET_GTK
|
||||
+#endif // MOZ_WAYLAND
|
||||
|
||||
namespace mozilla {
|
||||
namespace gl {
|
||||
@@ -566,7 +573,22 @@ GLLibraryEGL::EnsureInitialized(bool for
|
||||
mIsWARP = true;
|
||||
}
|
||||
} else {
|
||||
- chosenDisplay = GetAndInitDisplay(*this, EGL_DEFAULT_DISPLAY);
|
||||
+ void *nativeDisplay = EGL_DEFAULT_DISPLAY;
|
||||
+#ifdef MOZ_WAYLAND
|
||||
+ // Some drivers doesn't support EGL_DEFAULT_DISPLAY
|
||||
+ GdkDisplay *gdkDisplay = gdk_display_get_default();
|
||||
+ if (GDK_IS_WAYLAND_DISPLAY(gdkDisplay)) {
|
||||
+ static auto sGdkWaylandDisplayGetWlDisplay =
|
||||
+ (wl_display *(*)(GdkDisplay *))
|
||||
+ dlsym(RTLD_DEFAULT, "gdk_wayland_display_get_wl_display");
|
||||
+ nativeDisplay = sGdkWaylandDisplayGetWlDisplay(gdkDisplay);
|
||||
+ if (!nativeDisplay) {
|
||||
+ NS_WARNING("Failed to get wl_display.");
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
+ chosenDisplay = GetAndInitDisplay(*this, nativeDisplay);
|
||||
}
|
||||
|
||||
if (!chosenDisplay) {
|
||||
@@ -872,4 +894,3 @@ AfterEGLCall(const char* glFunction)
|
||||
|
||||
} /* namespace gl */
|
||||
} /* namespace mozilla */
|
||||
-
|
@ -1,40 +0,0 @@
|
||||
|
||||
# HG changeset patch
|
||||
# User Martin Stransky <stransky@redhat.com>
|
||||
# Date 1525961643 -7200
|
||||
# Node ID c085f9360dfa4d0fc3d04d6db40d37e1369616b3
|
||||
# Parent acaaa40ebdf142fda38d5661f7631f029a2406c6
|
||||
Bug 1460605 - Use NS_NATIVE_EGL_WINDOW instead of NS_NATIVE_WINDOW on GTK r=lsalzman
|
||||
|
||||
Original patch author is Takuro Ashie <ashie@clear-code.com>
|
||||
|
||||
NS_NATIVE_EGL_WINDOW is exported by Gtk toolkit code and provides both X11 window
|
||||
handle for X11 Gtk backend and EGL window handle for Wayland backend.
|
||||
|
||||
MozReview-Commit-ID: DEmlaLL7zGY
|
||||
|
||||
diff --git a/gfx/gl/GLContextProviderEGL.cpp b/gfx/gl/GLContextProviderEGL.cpp
|
||||
--- a/gfx/gl/GLContextProviderEGL.cpp
|
||||
+++ b/gfx/gl/GLContextProviderEGL.cpp
|
||||
@@ -1,18 +1,16 @@
|
||||
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* 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/. */
|
||||
|
||||
#if defined(MOZ_WIDGET_GTK)
|
||||
- #include <gdk/gdkx.h>
|
||||
- // we're using default display for now
|
||||
- #define GET_NATIVE_WINDOW_FROM_REAL_WIDGET(aWidget) ((EGLNativeWindowType)GDK_WINDOW_XID((GdkWindow*)aWidget->GetNativeData(NS_NATIVE_WINDOW)))
|
||||
- #define GET_NATIVE_WINDOW_FROM_COMPOSITOR_WIDGET(aWidget) ((EGLNativeWindowType)GDK_WINDOW_XID((GdkWindow*)aWidget->RealWidget()->GetNativeData(NS_NATIVE_WINDOW)))
|
||||
+ #define GET_NATIVE_WINDOW_FROM_REAL_WIDGET(aWidget) ((EGLNativeWindowType)aWidget->GetNativeData(NS_NATIVE_EGL_WINDOW))
|
||||
+ #define GET_NATIVE_WINDOW_FROM_COMPOSITOR_WIDGET(aWidget) ((EGLNativeWindowType)aWidget->RealWidget()->GetNativeData(NS_NATIVE_EGL_WINDOW))
|
||||
#elif defined(MOZ_WIDGET_ANDROID)
|
||||
#define GET_NATIVE_WINDOW_FROM_REAL_WIDGET(aWidget) ((EGLNativeWindowType)aWidget->GetNativeData(NS_JAVA_SURFACE))
|
||||
#define GET_NATIVE_WINDOW_FROM_COMPOSITOR_WIDGET(aWidget) (aWidget->AsAndroid()->GetEGLNativeWindow())
|
||||
#elif defined(XP_WIN)
|
||||
#define GET_NATIVE_WINDOW_FROM_REAL_WIDGET(aWidget) ((EGLNativeWindowType)aWidget->GetNativeData(NS_NATIVE_WINDOW))
|
||||
#define GET_NATIVE_WINDOW_FROM_COMPOSITOR_WIDGET(aWidget) ((EGLNativeWindowType)aWidget->AsWindows()->GetHwnd())
|
||||
#else
|
||||
#define GET_NATIVE_WINDOW_FROM_REAL_WIDGET(aWidget) ((EGLNativeWindowType)aWidget->GetNativeData(NS_NATIVE_WINDOW))
|
||||
|
@ -1,292 +0,0 @@
|
||||
|
||||
# HG changeset patch
|
||||
# User Martin Stransky <stransky@redhat.com>
|
||||
# Date 1525961060 -7200
|
||||
# Node ID acaaa40ebdf142fda38d5661f7631f029a2406c6
|
||||
# Parent 5543294befe9494593370f33c40ba50c8239e0c6
|
||||
Bug 1460605 - Provide NS_NATIVE_EGL_WINDOW to get a native EGL window on Wayland, r=jhorak
|
||||
|
||||
Original patch author is Takuro Ashie <ashie@clear-code.com>
|
||||
|
||||
Provide ability to create native EGL window and provide it under NS_NATIVE_EGL_WINDOW
|
||||
to GL code. The native EGL window is owned/managed by mozcontainer.
|
||||
|
||||
MozReview-Commit-ID: 4d0Kk6DRSaD
|
||||
|
||||
diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
|
||||
--- a/config/system-headers.mozbuild
|
||||
+++ b/config/system-headers.mozbuild
|
||||
@@ -1334,8 +1334,14 @@ if CONFIG['MOZ_SYSTEM_ICU']:
|
||||
'unicode/unistr.h',
|
||||
'unicode/unorm.h',
|
||||
'unicode/unum.h',
|
||||
'unicode/upluralrules.h',
|
||||
'unicode/ureldatefmt.h',
|
||||
'unicode/ustring.h',
|
||||
'unicode/utypes.h',
|
||||
]
|
||||
+
|
||||
+if CONFIG['MOZ_WAYLAND']:
|
||||
+ system_headers += [
|
||||
+ 'wayland-client.h',
|
||||
+ 'wayland-egl.h',
|
||||
+ ]
|
||||
diff --git a/widget/gtk/mozcontainer.cpp b/widget/gtk/mozcontainer.cpp
|
||||
--- a/widget/gtk/mozcontainer.cpp
|
||||
+++ b/widget/gtk/mozcontainer.cpp
|
||||
@@ -5,16 +5,17 @@
|
||||
* 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 "mozcontainer.h"
|
||||
#include <gtk/gtk.h>
|
||||
#ifdef MOZ_WAYLAND
|
||||
#include <gdk/gdkx.h>
|
||||
#include <gdk/gdkwayland.h>
|
||||
+#include <wayland-egl.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
#include <atk/atk.h>
|
||||
#include "maiRedundantObjectFactory.h"
|
||||
#endif
|
||||
@@ -202,16 +203,21 @@ void
|
||||
moz_container_init (MozContainer *container)
|
||||
{
|
||||
gtk_widget_set_can_focus(GTK_WIDGET(container), TRUE);
|
||||
gtk_container_set_resize_mode(GTK_CONTAINER(container), GTK_RESIZE_IMMEDIATE);
|
||||
gtk_widget_set_redraw_on_allocate(GTK_WIDGET(container), FALSE);
|
||||
|
||||
#if defined(MOZ_WAYLAND)
|
||||
{
|
||||
+ container->subcompositor = nullptr;
|
||||
+ container->surface = nullptr;
|
||||
+ container->subsurface = nullptr;
|
||||
+ container->eglwindow = nullptr;
|
||||
+
|
||||
GdkDisplay *gdk_display = gtk_widget_get_display(GTK_WIDGET(container));
|
||||
if (GDK_IS_WAYLAND_DISPLAY (gdk_display)) {
|
||||
// Available as of GTK 3.8+
|
||||
static auto sGdkWaylandDisplayGetWlDisplay =
|
||||
(wl_display *(*)(GdkDisplay *))
|
||||
dlsym(RTLD_DEFAULT, "gdk_wayland_display_get_wl_display");
|
||||
|
||||
wl_display* display = sGdkWaylandDisplayGetWlDisplay(gdk_display);
|
||||
@@ -284,16 +290,17 @@ moz_container_map_surface(MozContainer *
|
||||
wl_region_destroy(region);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
moz_container_unmap_surface(MozContainer *container)
|
||||
{
|
||||
+ g_clear_pointer(&container->eglwindow, wl_egl_window_destroy);
|
||||
g_clear_pointer(&container->subsurface, wl_subsurface_destroy);
|
||||
g_clear_pointer(&container->surface, wl_surface_destroy);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void
|
||||
moz_container_map (GtkWidget *widget)
|
||||
@@ -429,16 +436,21 @@ moz_container_size_allocate (GtkWidget
|
||||
// We need to position our subsurface according to GdkWindow
|
||||
// when offset changes (GdkWindow is maximized for instance).
|
||||
// see gtk-clutter-embed.c for reference.
|
||||
if (container->subsurface) {
|
||||
gint x, y;
|
||||
gdk_window_get_position(gtk_widget_get_window(widget), &x, &y);
|
||||
wl_subsurface_set_position(container->subsurface, x, y);
|
||||
}
|
||||
+ if (container->eglwindow) {
|
||||
+ wl_egl_window_resize(container->eglwindow,
|
||||
+ allocation->width, allocation->height,
|
||||
+ 0, 0);
|
||||
+ }
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
moz_container_remove (GtkContainer *container, GtkWidget *child_widget)
|
||||
{
|
||||
MozContainerChild *child;
|
||||
MozContainer *moz_container;
|
||||
@@ -554,9 +566,32 @@ moz_container_get_wl_surface(MozContaine
|
||||
if (!gdk_window_is_visible(window))
|
||||
return nullptr;
|
||||
|
||||
moz_container_map_surface(container);
|
||||
}
|
||||
|
||||
return container->surface;
|
||||
}
|
||||
+
|
||||
+struct wl_egl_window *
|
||||
+moz_container_get_wl_egl_window(MozContainer *container)
|
||||
+{
|
||||
+ if (!container->eglwindow) {
|
||||
+ struct wl_surface *wlsurf = moz_container_get_wl_surface(container);
|
||||
+ if (!wlsurf)
|
||||
+ return nullptr;
|
||||
+
|
||||
+ GdkWindow *window = gtk_widget_get_window(GTK_WIDGET(container));
|
||||
+ container->eglwindow
|
||||
+ = wl_egl_window_create(wlsurf,
|
||||
+ gdk_window_get_width(window),
|
||||
+ gdk_window_get_height(window));
|
||||
+ }
|
||||
+ return container->eglwindow;
|
||||
+}
|
||||
+
|
||||
+gboolean
|
||||
+moz_container_has_wl_egl_window(MozContainer *container)
|
||||
+{
|
||||
+ return container->eglwindow ? true : false;
|
||||
+}
|
||||
#endif
|
||||
diff --git a/widget/gtk/mozcontainer.h b/widget/gtk/mozcontainer.h
|
||||
--- a/widget/gtk/mozcontainer.h
|
||||
+++ b/widget/gtk/mozcontainer.h
|
||||
@@ -67,16 +67,17 @@ struct _MozContainer
|
||||
{
|
||||
GtkContainer container;
|
||||
GList *children;
|
||||
|
||||
#ifdef MOZ_WAYLAND
|
||||
struct wl_subcompositor *subcompositor;
|
||||
struct wl_surface *surface;
|
||||
struct wl_subsurface *subsurface;
|
||||
+ struct wl_egl_window *eglwindow;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct _MozContainerClass
|
||||
{
|
||||
GtkContainerClass parent_class;
|
||||
};
|
||||
|
||||
@@ -90,11 +91,13 @@ void moz_container_move (
|
||||
GtkWidget *child_widget,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
#ifdef MOZ_WAYLAND
|
||||
struct wl_surface* moz_container_get_wl_surface(MozContainer *container);
|
||||
+struct wl_egl_window* moz_container_get_wl_egl_window(MozContainer *container);
|
||||
+gboolean moz_container_has_wl_egl_window(MozContainer *container);
|
||||
#endif
|
||||
|
||||
#endif /* __MOZ_CONTAINER_H__ */
|
||||
diff --git a/widget/gtk/mozwayland/mozwayland.c b/widget/gtk/mozwayland/mozwayland.c
|
||||
--- a/widget/gtk/mozwayland/mozwayland.c
|
||||
+++ b/widget/gtk/mozwayland/mozwayland.c
|
||||
@@ -266,8 +266,26 @@ wl_display_read_events(struct wl_display
|
||||
return -1;
|
||||
}
|
||||
|
||||
MOZ_EXPORT void
|
||||
wl_log_set_handler_client(wl_log_func_t handler)
|
||||
{
|
||||
}
|
||||
|
||||
+MOZ_EXPORT struct wl_egl_window *
|
||||
+wl_egl_window_create(struct wl_surface *surface,
|
||||
+ int width, int height)
|
||||
+{
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+MOZ_EXPORT void
|
||||
+wl_egl_window_destroy(struct wl_egl_window *egl_window)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+MOZ_EXPORT void
|
||||
+wl_egl_window_resize(struct wl_egl_window *egl_window,
|
||||
+ int width, int height,
|
||||
+ int dx, int dy)
|
||||
+{
|
||||
+}
|
||||
diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
|
||||
--- a/widget/gtk/nsWindow.cpp
|
||||
+++ b/widget/gtk/nsWindow.cpp
|
||||
@@ -1734,16 +1734,25 @@ nsWindow::GetNativeData(uint32_t aDataTy
|
||||
return mIMContext.get();
|
||||
}
|
||||
case NS_NATIVE_OPENGL_CONTEXT:
|
||||
return nullptr;
|
||||
#ifdef MOZ_X11
|
||||
case NS_NATIVE_COMPOSITOR_DISPLAY:
|
||||
return gfxPlatformGtk::GetPlatform()->GetCompositorDisplay();
|
||||
#endif // MOZ_X11
|
||||
+ case NS_NATIVE_EGL_WINDOW: {
|
||||
+ if (mIsX11Display)
|
||||
+ return mGdkWindow ? (void*)GDK_WINDOW_XID(mGdkWindow) : nullptr;
|
||||
+#ifdef MOZ_WAYLAND
|
||||
+ if (mContainer)
|
||||
+ return moz_container_get_wl_egl_window(mContainer);
|
||||
+#endif
|
||||
+ return nullptr;
|
||||
+ }
|
||||
default:
|
||||
NS_WARNING("nsWindow::GetNativeData called with bad value");
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsWindow::SetTitle(const nsAString& aTitle)
|
||||
@@ -4303,16 +4312,26 @@ nsWindow::NativeShow(bool aAction)
|
||||
else if (mContainer) {
|
||||
gtk_widget_show(GTK_WIDGET(mContainer));
|
||||
}
|
||||
else if (mGdkWindow) {
|
||||
gdk_window_show_unraised(mGdkWindow);
|
||||
}
|
||||
}
|
||||
else {
|
||||
+#ifdef MOZ_WAYLAND
|
||||
+ if (mContainer && moz_container_has_wl_egl_window(mContainer)) {
|
||||
+ // Because wl_egl_window is destroyed on moz_container_unmap(),
|
||||
+ // the current compositor cannot use it anymore. To avoid crash,
|
||||
+ // destroy the compositor & recreate a new compositor on next
|
||||
+ // expose event.
|
||||
+ DestroyLayerManager();
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
if (mIsTopLevel) {
|
||||
// Workaround window freezes on GTK versions before 3.21.2 by
|
||||
// ensuring that configure events get dispatched to windows before
|
||||
// they are unmapped. See bug 1225044.
|
||||
if (gtk_check_version(3, 21, 2) != nullptr && mPendingConfigures > 0) {
|
||||
GtkAllocation allocation;
|
||||
gtk_widget_get_allocation(GTK_WIDGET(mShell), &allocation);
|
||||
|
||||
diff --git a/widget/nsIWidget.h b/widget/nsIWidget.h
|
||||
--- a/widget/nsIWidget.h
|
||||
+++ b/widget/nsIWidget.h
|
||||
@@ -138,16 +138,17 @@ typedef void* nsNativeWidget;
|
||||
#define NS_NATIVE_CHILD_OF_SHAREABLE_WINDOW 105
|
||||
#endif
|
||||
#if defined(MOZ_WIDGET_GTK)
|
||||
// set/get nsPluginNativeWindowGtk, e10s specific
|
||||
#define NS_NATIVE_PLUGIN_OBJECT_PTR 104
|
||||
#ifdef MOZ_X11
|
||||
#define NS_NATIVE_COMPOSITOR_DISPLAY 105
|
||||
#endif // MOZ_X11
|
||||
+#define NS_NATIVE_EGL_WINDOW 106
|
||||
#endif
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
#define NS_JAVA_SURFACE 100
|
||||
#define NS_PRESENTATION_WINDOW 101
|
||||
#define NS_PRESENTATION_SURFACE 102
|
||||
#endif
|
||||
|
||||
// Must be kept in sync with xpcom/rust/xpcom/src/interfaces/nonidl.rs
|
||||
|
@ -1,30 +0,0 @@
|
||||
# HG changeset patch
|
||||
# User Evan Klitzke <evan@eklitzke.org>
|
||||
# Parent c5e0ee17388381f96d0acf4bdd9d163827719096
|
||||
Bug 1460810 - [Gtk/Wayland] Handle error value (-1) returned by gtk_section_data_get_length(), r=stransky
|
||||
|
||||
diff --git a/widget/gtk/nsClipboardWayland.cpp b/widget/gtk/nsClipboardWayland.cpp
|
||||
--- a/widget/gtk/nsClipboardWayland.cpp
|
||||
+++ b/widget/gtk/nsClipboardWayland.cpp
|
||||
@@ -662,18 +662,19 @@ wayland_clipboard_contents_received(GtkC
|
||||
delete fastTrack;
|
||||
}
|
||||
|
||||
void
|
||||
nsRetrievalContextWayland::TransferFastTrackClipboard(
|
||||
int aClipboardRequestNumber, GtkSelectionData *aSelectionData)
|
||||
{
|
||||
if (mClipboardRequestNumber == aClipboardRequestNumber) {
|
||||
- mClipboardDataLength = gtk_selection_data_get_length(aSelectionData);
|
||||
- if (mClipboardDataLength > 0) {
|
||||
+ int dataLength = gtk_selection_data_get_length(aSelectionData);
|
||||
+ if (dataLength > 0) {
|
||||
+ mClipboardDataLength = dataLength;
|
||||
mClipboardData = reinterpret_cast<char*>(
|
||||
g_malloc(sizeof(char)*mClipboardDataLength));
|
||||
memcpy(mClipboardData, gtk_selection_data_get_data(aSelectionData),
|
||||
sizeof(char)*mClipboardDataLength);
|
||||
}
|
||||
} else {
|
||||
NS_WARNING("Received obsoleted clipboard data!");
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
|
||||
# HG changeset patch
|
||||
# User Martin Stransky <stransky@redhat.com>
|
||||
# Date 1526299286 -7200
|
||||
# Node ID 6495ae9d01e06109539413c538fd25ed942f6eb8
|
||||
# Parent 67553a1262de53d0ec85fdfcf1a2b55631eaca44
|
||||
Bug 1461306 - [Wayland] Don't use sizeof() to get mime type array size, r=jhorak
|
||||
|
||||
MozReview-Commit-ID: GE5helkqoUt
|
||||
|
||||
diff --git a/widget/gtk/nsClipboardWayland.cpp b/widget/gtk/nsClipboardWayland.cpp
|
||||
--- a/widget/gtk/nsClipboardWayland.cpp
|
||||
+++ b/widget/gtk/nsClipboardWayland.cpp
|
||||
@@ -723,17 +723,17 @@ const char*
|
||||
nsRetrievalContextWayland::GetClipboardText(int32_t aWhichClipboard)
|
||||
{
|
||||
GdkAtom selection = GetSelectionAtom(aWhichClipboard);
|
||||
DataOffer* dataOffer = (selection == GDK_SELECTION_PRIMARY) ?
|
||||
mPrimaryOffer : mClipboardOffer;
|
||||
if (!dataOffer)
|
||||
return nullptr;
|
||||
|
||||
- for (unsigned int i = 0; i < sizeof(sTextMimeTypes); i++) {
|
||||
+ for (unsigned int i = 0; i < TEXT_MIME_TYPES_NUM; i++) {
|
||||
if (dataOffer->HasTarget(sTextMimeTypes[i])) {
|
||||
uint32_t unused;
|
||||
return GetClipboardData(sTextMimeTypes[i], aWhichClipboard,
|
||||
&unused);
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -1,36 +0,0 @@
|
||||
|
||||
# HG changeset patch
|
||||
# User Martin Stransky <stransky@redhat.com>
|
||||
# Date 1526647470 -7200
|
||||
# Node ID d41fee41e38400fab5da0689c1f49e30f80e2d1b
|
||||
# Parent d2b91476bebc48f9e89f9d3e6c7b33decb2ae941
|
||||
Bug 1462622 - [Gtk/Linux] Don't use GLXVsyncSource() on non-X11 displays, r=lsalzman
|
||||
|
||||
MozReview-Commit-ID: BBtnNLWqSiq
|
||||
|
||||
diff --git a/gfx/thebes/gfxPlatformGtk.cpp b/gfx/thebes/gfxPlatformGtk.cpp
|
||||
--- a/gfx/thebes/gfxPlatformGtk.cpp
|
||||
+++ b/gfx/thebes/gfxPlatformGtk.cpp
|
||||
@@ -736,18 +736,20 @@ private:
|
||||
};
|
||||
|
||||
already_AddRefed<gfx::VsyncSource>
|
||||
gfxPlatformGtk::CreateHardwareVsyncSource()
|
||||
{
|
||||
// Only use GLX vsync when the OpenGL compositor is being used.
|
||||
// The extra cost of initializing a GLX context while blocking the main
|
||||
// thread is not worth it when using basic composition.
|
||||
+ // Also don't use it on non-X11 displays.
|
||||
if (gfxConfig::IsEnabled(Feature::HW_COMPOSITING)) {
|
||||
- if (gl::sGLXLibrary.SupportsVideoSync()) {
|
||||
+ if (GDK_IS_X11_DISPLAY(gdk_display_get_default()) &&
|
||||
+ gl::sGLXLibrary.SupportsVideoSync()) {
|
||||
RefPtr<VsyncSource> vsyncSource = new GLXVsyncSource();
|
||||
VsyncSource::Display& display = vsyncSource->GetGlobalDisplay();
|
||||
if (!static_cast<GLXVsyncSource::GLXDisplay&>(display).Setup()) {
|
||||
NS_WARNING("Failed to setup GLContext, falling back to software vsync.");
|
||||
return gfxPlatform::CreateHardwareVsyncSource();
|
||||
}
|
||||
return vsyncSource.forget();
|
||||
}
|
||||
|
@ -1,183 +0,0 @@
|
||||
diff -up firefox-60.0.1/gfx/gl/GLContextEGL.h.mozilla-1462642 firefox-60.0.1/gfx/gl/GLContextEGL.h
|
||||
--- firefox-60.0.1/gfx/gl/GLContextEGL.h.mozilla-1462642 2018-05-16 07:38:29.000000000 +0200
|
||||
+++ firefox-60.0.1/gfx/gl/GLContextEGL.h 2018-05-25 10:54:09.271902218 +0200
|
||||
@@ -133,6 +133,10 @@ protected:
|
||||
static EGLSurface CreatePBufferSurfaceTryingPowerOfTwo(EGLConfig config,
|
||||
EGLenum bindToTextureFormat,
|
||||
gfx::IntSize& pbsize);
|
||||
+#if defined(MOZ_WAYLAND)
|
||||
+ static EGLSurface CreateWaylandBufferSurface(EGLConfig config,
|
||||
+ gfx::IntSize& pbsize);
|
||||
+#endif
|
||||
#if defined(MOZ_WIDGET_ANDROID)
|
||||
public:
|
||||
EGLSurface CreateCompatibleSurface(void* aWindow);
|
||||
diff -up firefox-60.0.1/gfx/gl/GLContextProviderEGL.cpp.mozilla-1462642 firefox-60.0.1/gfx/gl/GLContextProviderEGL.cpp
|
||||
--- firefox-60.0.1/gfx/gl/GLContextProviderEGL.cpp.mozilla-1462642 2018-05-25 10:54:09.258902265 +0200
|
||||
+++ firefox-60.0.1/gfx/gl/GLContextProviderEGL.cpp 2018-05-25 10:55:57.634553279 +0200
|
||||
@@ -63,6 +63,17 @@
|
||||
#include "ScopedGLHelpers.h"
|
||||
#include "TextureImageEGL.h"
|
||||
|
||||
+#if defined(MOZ_WAYLAND)
|
||||
+#include "nsAutoPtr.h"
|
||||
+#include "nsDataHashtable.h"
|
||||
+
|
||||
+#include <gtk/gtk.h>
|
||||
+#include <gdk/gdkx.h>
|
||||
+#include <gdk/gdkwayland.h>
|
||||
+#include <wayland-egl.h>
|
||||
+#include <dlfcn.h>
|
||||
+#endif
|
||||
+
|
||||
using namespace mozilla::gfx;
|
||||
|
||||
namespace mozilla {
|
||||
@@ -70,6 +81,35 @@ namespace gl {
|
||||
|
||||
using namespace mozilla::widget;
|
||||
|
||||
+#if defined(MOZ_WAYLAND)
|
||||
+class WaylandGLSurface {
|
||||
+public:
|
||||
+ WaylandGLSurface(struct wl_surface *aWaylandSurface,
|
||||
+ struct wl_egl_window *aEGLWindow);
|
||||
+ ~WaylandGLSurface();
|
||||
+private:
|
||||
+ struct wl_surface *mWaylandSurface;
|
||||
+ struct wl_egl_window *mEGLWindow;
|
||||
+};
|
||||
+
|
||||
+static nsDataHashtable<nsPtrHashKey<void>, WaylandGLSurface*>
|
||||
+ sWaylandGLSurface;
|
||||
+
|
||||
+void
|
||||
+DeleteWaylandGLSurface(EGLSurface surface)
|
||||
+{
|
||||
+ // We're running on Wayland which means our EGLSurface may
|
||||
+ // have attached Wayland backend data which must be released.
|
||||
+ if (GDK_IS_WAYLAND_DISPLAY(gdk_display_get_default())) {
|
||||
+ auto entry = sWaylandGLSurface.Lookup(surface);
|
||||
+ if (entry) {
|
||||
+ delete entry.Data();
|
||||
+ entry.Remove();
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
#define ADD_ATTR_2(_array, _k, _v) do { \
|
||||
(_array).AppendElement(_k); \
|
||||
(_array).AppendElement(_v); \
|
||||
@@ -125,6 +165,9 @@ DestroySurface(EGLSurface oldSurface) {
|
||||
EGL_NO_SURFACE, EGL_NO_SURFACE,
|
||||
EGL_NO_CONTEXT);
|
||||
sEGLLibrary.fDestroySurface(EGL_DISPLAY(), oldSurface);
|
||||
+#if defined(MOZ_WAYLAND)
|
||||
+ DeleteWaylandGLSurface(oldSurface);
|
||||
+#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -588,6 +631,52 @@ TRY_AGAIN_POWER_OF_TWO:
|
||||
return surface;
|
||||
}
|
||||
|
||||
+#if defined(MOZ_WAYLAND)
|
||||
+WaylandGLSurface::WaylandGLSurface(struct wl_surface *aWaylandSurface,
|
||||
+ struct wl_egl_window *aEGLWindow)
|
||||
+ : mWaylandSurface(aWaylandSurface)
|
||||
+ , mEGLWindow(aEGLWindow)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+WaylandGLSurface::~WaylandGLSurface()
|
||||
+{
|
||||
+ wl_egl_window_destroy(mEGLWindow);
|
||||
+ wl_surface_destroy(mWaylandSurface);
|
||||
+}
|
||||
+
|
||||
+EGLSurface
|
||||
+GLContextEGL::CreateWaylandBufferSurface(EGLConfig config,
|
||||
+ mozilla::gfx::IntSize& pbsize)
|
||||
+{
|
||||
+ // Available as of GTK 3.8+
|
||||
+ static auto sGdkWaylandDisplayGetWlCompositor =
|
||||
+ (wl_compositor *(*)(GdkDisplay *))
|
||||
+ dlsym(RTLD_DEFAULT, "gdk_wayland_display_get_wl_compositor");
|
||||
+
|
||||
+ if (!sGdkWaylandDisplayGetWlCompositor)
|
||||
+ return nullptr;
|
||||
+
|
||||
+ struct wl_compositor *compositor =
|
||||
+ sGdkWaylandDisplayGetWlCompositor(gdk_display_get_default());
|
||||
+ struct wl_surface *wlsurface = wl_compositor_create_surface(compositor);
|
||||
+ struct wl_egl_window *eglwindow =
|
||||
+ wl_egl_window_create(wlsurface, pbsize.width, pbsize.height);
|
||||
+
|
||||
+ EGLSurface surface =
|
||||
+ sEGLLibrary.fCreateWindowSurface(EGL_DISPLAY(), config, eglwindow, 0);
|
||||
+
|
||||
+ if (surface) {
|
||||
+ WaylandGLSurface* waylandData =
|
||||
+ new WaylandGLSurface(wlsurface, eglwindow);
|
||||
+ auto entry = sWaylandGLSurface.LookupForAdd(surface);
|
||||
+ entry.OrInsert([&waylandData](){ return waylandData; });
|
||||
+ }
|
||||
+
|
||||
+ return surface;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
static const EGLint kEGLConfigAttribsOffscreenPBuffer[] = {
|
||||
LOCAL_EGL_SURFACE_TYPE, LOCAL_EGL_PBUFFER_BIT,
|
||||
LOCAL_EGL_RENDERABLE_TYPE, LOCAL_EGL_OPENGL_ES2_BIT,
|
||||
@@ -807,7 +896,17 @@ FillContextAttribs(bool alpha, bool dept
|
||||
bool es3, nsTArray<EGLint>* out)
|
||||
{
|
||||
out->AppendElement(LOCAL_EGL_SURFACE_TYPE);
|
||||
+#if defined(MOZ_WAYLAND)
|
||||
+ if (GDK_IS_WAYLAND_DISPLAY(gdk_display_get_default())) {
|
||||
+ // Wayland on desktop does not support PBuffer or FBO.
|
||||
+ // We create a dummy wl_egl_window instead.
|
||||
+ out->AppendElement(LOCAL_EGL_WINDOW_BIT);
|
||||
+ } else {
|
||||
+ out->AppendElement(LOCAL_EGL_PBUFFER_BIT);
|
||||
+ }
|
||||
+#else
|
||||
out->AppendElement(LOCAL_EGL_PBUFFER_BIT);
|
||||
+#endif
|
||||
|
||||
out->AppendElement(LOCAL_EGL_RENDERABLE_TYPE);
|
||||
if (es3) {
|
||||
@@ -926,9 +1025,17 @@ GLContextEGL::CreateEGLPBufferOffscreenC
|
||||
}
|
||||
|
||||
mozilla::gfx::IntSize pbSize(size);
|
||||
- EGLSurface surface = GLContextEGL::CreatePBufferSurfaceTryingPowerOfTwo(config,
|
||||
- LOCAL_EGL_NONE,
|
||||
- pbSize);
|
||||
+ EGLSurface surface = nullptr;
|
||||
+#if defined(MOZ_WAYLAND)
|
||||
+ if (GDK_IS_WAYLAND_DISPLAY(gdk_display_get_default())) {
|
||||
+ surface = GLContextEGL::CreateWaylandBufferSurface(config, pbSize);
|
||||
+ } else
|
||||
+#endif
|
||||
+ {
|
||||
+ surface = GLContextEGL::CreatePBufferSurfaceTryingPowerOfTwo(config,
|
||||
+ LOCAL_EGL_NONE,
|
||||
+ pbSize);
|
||||
+ }
|
||||
if (!surface) {
|
||||
*out_failureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_EGL_POT");
|
||||
NS_WARNING("Failed to create PBuffer for context!");
|
||||
@@ -941,6 +1048,9 @@ GLContextEGL::CreateEGLPBufferOffscreenC
|
||||
if (!gl) {
|
||||
NS_WARNING("Failed to create GLContext from PBuffer");
|
||||
sEGLLibrary.fDestroySurface(sEGLLibrary.Display(), surface);
|
||||
+#if defined(MOZ_WAYLAND)
|
||||
+ DeleteWaylandGLSurface(surface);
|
||||
+#endif
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -1,127 +0,0 @@
|
||||
|
||||
# HG changeset patch
|
||||
# User Martin Stransky <stransky@redhat.com>
|
||||
# Date 1527155477 -7200
|
||||
# Node ID 172827af80fa02953e0c7723c0dee915c411c286
|
||||
# Parent a5c04fe7278db916b3efd5f06a5f2a9da0d64ad2
|
||||
Bug 1463753 - [DragAndDrop] Update mTarget(Wayland)DragContext unconditionally and check its validity after that, r=jhorak
|
||||
|
||||
MozReview-Commit-ID: KiNaPDDVvLu
|
||||
|
||||
diff --git a/widget/gtk/nsDragService.cpp b/widget/gtk/nsDragService.cpp
|
||||
--- a/widget/gtk/nsDragService.cpp
|
||||
+++ b/widget/gtk/nsDragService.cpp
|
||||
@@ -1043,21 +1043,21 @@ nsDragService::IsDataFlavorSupported(con
|
||||
}
|
||||
|
||||
// check the target context vs. this flavor, one at a time
|
||||
GList *tmp = nullptr;
|
||||
if (mTargetDragContext) {
|
||||
tmp = gdk_drag_context_list_targets(mTargetDragContext);
|
||||
}
|
||||
#ifdef MOZ_WAYLAND
|
||||
- else {
|
||||
+ else if (mTargetWaylandDragContext) {
|
||||
tmp = mTargetWaylandDragContext->GetTargets();
|
||||
}
|
||||
+ GList *tmp_head = tmp;
|
||||
#endif
|
||||
- GList *tmp_head = tmp;
|
||||
|
||||
for (; tmp; tmp = tmp->next) {
|
||||
/* Bug 331198 */
|
||||
GdkAtom atom = GDK_POINTER_TO_ATOM(tmp->data);
|
||||
gchar *name = nullptr;
|
||||
name = gdk_atom_name(atom);
|
||||
MOZ_LOG(sDragLm, LogLevel::Debug,
|
||||
("checking %s against %s\n", name, aDataFlavor));
|
||||
@@ -1095,21 +1095,23 @@ nsDragService::IsDataFlavorSupported(con
|
||||
MOZ_LOG(sDragLm, LogLevel::Debug,
|
||||
("good! ( it's text plain and we're checking \
|
||||
against text/unicode or application/x-moz-file)\n"));
|
||||
*_retval = true;
|
||||
}
|
||||
g_free(name);
|
||||
}
|
||||
|
||||
+#ifdef MOZ_WAYLAND
|
||||
// mTargetWaylandDragContext->GetTargets allocates the list
|
||||
// so we need to free it here.
|
||||
- if (!mTargetDragContext) {
|
||||
+ if (!mTargetDragContext && tmp_head) {
|
||||
g_list_free(tmp_head);
|
||||
}
|
||||
+#endif
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsDragService::ReplyToDragMotion(GdkDragContext* aDragContext)
|
||||
{
|
||||
MOZ_LOG(sDragLm, LogLevel::Debug,
|
||||
@@ -2007,23 +2009,19 @@ nsDragService::RunScheduledTask()
|
||||
// This may be the start of a destination drag session.
|
||||
StartDragSession();
|
||||
|
||||
// mTargetWidget may be nullptr if the window has been destroyed.
|
||||
// (The leave event is not scheduled if a drop task is still scheduled.)
|
||||
// We still reply appropriately to indicate that the drop will or didn't
|
||||
// succeeed.
|
||||
mTargetWidget = mTargetWindow->GetMozContainerWidget();
|
||||
- if (mTargetDragContext) {
|
||||
- mTargetDragContext.steal(mPendingDragContext);
|
||||
- }
|
||||
+ mTargetDragContext.steal(mPendingDragContext);
|
||||
#ifdef MOZ_WAYLAND
|
||||
- else {
|
||||
- mTargetWaylandDragContext = mPendingWaylandDragContext.forget();
|
||||
- }
|
||||
+ mTargetWaylandDragContext = mPendingWaylandDragContext.forget();
|
||||
#endif
|
||||
mTargetTime = mPendingTime;
|
||||
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#drag-and-drop-processing-model
|
||||
// (as at 27 December 2010) indicates that a "drop" event should only be
|
||||
// fired (at the current target element) if the current drag operation is
|
||||
// not none. The current drag operation will only be set to a non-none
|
||||
// value during a "dragover" event.
|
||||
@@ -2056,17 +2054,17 @@ nsDragService::RunScheduledTask()
|
||||
#endif
|
||||
} else {
|
||||
// Reply to tell the source whether we can drop and what
|
||||
// action would be taken.
|
||||
if (mTargetDragContext) {
|
||||
ReplyToDragMotion(mTargetDragContext);
|
||||
}
|
||||
#ifdef MOZ_WAYLAND
|
||||
- else {
|
||||
+ else if (mTargetWaylandDragContext) {
|
||||
ReplyToDragMotion(mTargetWaylandDragContext);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (task == eDragTaskDrop) {
|
||||
@@ -2123,17 +2121,17 @@ nsDragService::UpdateDragAction()
|
||||
|
||||
// default is to do nothing
|
||||
int action = nsIDragService::DRAGDROP_ACTION_NONE;
|
||||
GdkDragAction gdkAction = GDK_ACTION_DEFAULT;
|
||||
if (mTargetDragContext) {
|
||||
gdkAction = gdk_drag_context_get_actions(mTargetDragContext);
|
||||
}
|
||||
#ifdef MOZ_WAYLAND
|
||||
- else {
|
||||
+ else if (mTargetWaylandDragContext) {
|
||||
// We got the selected D&D action from compositor on Wayland.
|
||||
gdkAction = mTargetWaylandDragContext->GetSelectedDragAction();
|
||||
}
|
||||
#endif
|
||||
|
||||
// set the default just in case nothing matches below
|
||||
if (gdkAction & GDK_ACTION_DEFAULT)
|
||||
action = nsIDragService::DRAGDROP_ACTION_MOVE;
|
||||
|
@ -1,31 +0,0 @@
|
||||
diff --git a/widget/gtk/nsClipboardWayland.cpp b/widget/gtk/nsClipboardWayland.cpp
|
||||
--- a/widget/gtk/nsClipboardWayland.cpp
|
||||
+++ b/widget/gtk/nsClipboardWayland.cpp
|
||||
@@ -201,21 +201,25 @@ WaylandDataOffer::DragOfferAccept(const
|
||||
}
|
||||
|
||||
/* We follow logic of gdk_wayland_drag_context_commit_status()/gdkdnd-wayland.c
|
||||
* here.
|
||||
*/
|
||||
void
|
||||
WaylandDataOffer::SetDragStatus(GdkDragAction aAction, uint32_t aTime)
|
||||
{
|
||||
- uint32_t dnd_actions = gdk_to_wl_actions(aAction);
|
||||
uint32_t all_actions = WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY |
|
||||
WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE;
|
||||
|
||||
- wl_data_offer_set_actions(mWaylandDataOffer, all_actions, dnd_actions);
|
||||
+ /* Default Firefox D&D action is move so set it here as a preferred one.
|
||||
+ Actual D&D action will be select by Wayland compositor and reported
|
||||
+ at data_offer_action() callback.
|
||||
+ */
|
||||
+ wl_data_offer_set_actions(mWaylandDataOffer, all_actions,
|
||||
+ WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE);
|
||||
|
||||
/* Workaround Wayland D&D architecture here. To get the data_device_drop()
|
||||
signal (which routes to nsDragService::GetData() call) we need to
|
||||
accept at least one mime type before data_device_leave().
|
||||
|
||||
Real wl_data_offer_accept() for actualy requested data mime type is
|
||||
called from nsDragService::GetData().
|
||||
*/
|
@ -1,27 +0,0 @@
|
||||
Bug 1464823 - Don't sync rendering on Mesa as the Mesa Wayland implementation is buggy.
|
||||
|
||||
diff --git a/gfx/gl/GLContextProviderEGL.cpp b/gfx/gl/GLContextProviderEGL.cpp
|
||||
--- a/gfx/gl/GLContextProviderEGL.cpp
|
||||
+++ b/gfx/gl/GLContextProviderEGL.cpp
|
||||
@@ -273,20 +273,17 @@ GLContextEGLFactory::Create(EGLNativeWin
|
||||
if (!gl) {
|
||||
gfxCriticalNote << "Failed to create EGLContext!";
|
||||
mozilla::gl::DestroySurface(surface);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
gl->MakeCurrent();
|
||||
gl->SetIsDoubleBuffered(doubleBuffered);
|
||||
- if (aWebRender && sEGLLibrary.IsANGLE()) {
|
||||
- MOZ_ASSERT(doubleBuffered);
|
||||
- sEGLLibrary.fSwapInterval(EGL_DISPLAY(), 0);
|
||||
- }
|
||||
+ sEGLLibrary.fSwapInterval(EGL_DISPLAY(), 0);
|
||||
return gl.forget();
|
||||
}
|
||||
|
||||
GLContextEGL::GLContextEGL(CreateContextFlags flags, const SurfaceCaps& caps,
|
||||
bool isOffscreen, EGLConfig config, EGLSurface surface,
|
||||
EGLContext context)
|
||||
: GLContext(flags, caps, nullptr, isOffscreen, false)
|
||||
, mConfig(config)
|
@ -1,59 +0,0 @@
|
||||
diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
|
||||
--- a/toolkit/xre/nsAppRunner.cpp
|
||||
+++ b/toolkit/xre/nsAppRunner.cpp
|
||||
@@ -1700,31 +1700,25 @@ ParseRemoteCommandLine(nsCString& progra
|
||||
|
||||
return REMOTE_FOUND;
|
||||
}
|
||||
|
||||
static RemoteResult
|
||||
StartRemoteClient(const char* aDesktopStartupID,
|
||||
nsCString& program,
|
||||
const char* profile,
|
||||
- const char* username,
|
||||
- bool aIsX11Display)
|
||||
+ const char* username)
|
||||
{
|
||||
nsAutoPtr<nsRemoteClient> client;
|
||||
|
||||
- if (aIsX11Display) {
|
||||
- client = new XRemoteClient();
|
||||
- } else {
|
||||
#if defined(MOZ_ENABLE_DBUS) && defined(MOZ_WAYLAND)
|
||||
- client = new DBusRemoteClient();
|
||||
+ client = new DBusRemoteClient();
|
||||
#else
|
||||
- MOZ_ASSERT(false, "Missing remote implementation!");
|
||||
- return REMOTE_NOT_FOUND;
|
||||
+ client = new XRemoteClient();
|
||||
#endif
|
||||
- }
|
||||
|
||||
nsresult rv = client->Init();
|
||||
if (NS_FAILED(rv))
|
||||
return REMOTE_NOT_FOUND;
|
||||
|
||||
nsCString response;
|
||||
bool success = false;
|
||||
rv = client->SendCommandLine(program.get(), username, profile,
|
||||
@@ -4070,18 +4064,17 @@ XREMain::XRE_mainStartup(bool* aExitFlag
|
||||
NS_WARNING("Cannot lock XRemote start mutex");
|
||||
}
|
||||
}
|
||||
|
||||
// Try to remote the entire command line. If this fails, start up normally.
|
||||
const char* desktopStartupIDPtr =
|
||||
mDesktopStartupID.IsEmpty() ? nullptr : mDesktopStartupID.get();
|
||||
|
||||
- rr = StartRemoteClient(desktopStartupIDPtr, program, profile, username,
|
||||
- GDK_IS_X11_DISPLAY(mGdkDisplay));
|
||||
+ rr = StartRemoteClient(desktopStartupIDPtr, program, profile, username);
|
||||
if (rr == REMOTE_FOUND) {
|
||||
*aExitFlag = true;
|
||||
return 0;
|
||||
}
|
||||
if (rr == REMOTE_ARG_BAD) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -1,42 +0,0 @@
|
||||
diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build
|
||||
--- a/toolkit/xre/moz.build
|
||||
+++ b/toolkit/xre/moz.build
|
||||
@@ -116,17 +116,17 @@ UNIFIED_SOURCES += [
|
||||
# they pull in OS X system headers.
|
||||
# nsEmbedFunctions.cpp cannot be built in unified mode because it pulls in X11 headers.
|
||||
SOURCES += [
|
||||
'nsAppRunner.cpp',
|
||||
'nsEmbedFunctions.cpp',
|
||||
'ProfileReset.cpp',
|
||||
]
|
||||
|
||||
-if CONFIG['MOZ_GL_DEFAULT_PROVIDER'] == 'GLX':
|
||||
+if CONFIG['MOZ_X11']:
|
||||
UNIFIED_SOURCES += [
|
||||
'glxtest.cpp',
|
||||
]
|
||||
|
||||
if CONFIG['MOZ_INSTRUMENT_EVENT_LOOP']:
|
||||
UNIFIED_SOURCES += [
|
||||
'EventTracer.cpp',
|
||||
]
|
||||
@@ -142,17 +142,17 @@ if CONFIG['MOZ_PDF_PRINTING']:
|
||||
LOCAL_INCLUDES += [
|
||||
'../components/printingui',
|
||||
]
|
||||
|
||||
include('/ipc/chromium/chromium-config.mozbuild')
|
||||
|
||||
FINAL_LIBRARY = 'xul'
|
||||
|
||||
-if CONFIG['MOZ_GL_DEFAULT_PROVIDER'] == 'GLX':
|
||||
+if CONFIG['MOZ_X11']:
|
||||
DEFINES['USE_GLX_TEST'] = True
|
||||
|
||||
for var in ('MOZ_APP_NAME', 'MOZ_APP_BASENAME', 'MOZ_APP_DISPLAYNAME',
|
||||
'MOZ_APP_VERSION', 'OS_TARGET', 'MOZ_WIDGET_TOOLKIT'):
|
||||
DEFINES[var] = '"%s"' % CONFIG[var]
|
||||
|
||||
if CONFIG['MOZ_UPDATER'] and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
|
||||
DEFINES['MOZ_UPDATER'] = True
|
||||
|
@ -1,102 +0,0 @@
|
||||
diff --git a/widget/gtk/nsGtkKeyUtils.h b/widget/gtk/nsGtkKeyUtils.h
|
||||
--- a/widget/gtk/nsGtkKeyUtils.h
|
||||
+++ b/widget/gtk/nsGtkKeyUtils.h
|
||||
@@ -169,17 +169,20 @@ protected:
|
||||
|
||||
bool mInitialized;
|
||||
|
||||
/**
|
||||
* Initializing methods.
|
||||
*/
|
||||
void Init();
|
||||
void InitXKBExtension();
|
||||
- void InitBySystemSettings();
|
||||
+ void InitBySystemSettingsX11();
|
||||
+#ifdef MOZ_WAYLAND
|
||||
+ void InitBySystemSettingsWayland();
|
||||
+#endif
|
||||
|
||||
/**
|
||||
* mModifierKeys stores each hardware key information.
|
||||
*/
|
||||
struct ModifierKey {
|
||||
guint mHardwareKeycode;
|
||||
guint mMask;
|
||||
|
||||
|
||||
diff --git a/widget/gtk/nsGtkKeyUtils.cpp b/widget/gtk/nsGtkKeyUtils.cpp
|
||||
--- a/widget/gtk/nsGtkKeyUtils.cpp
|
||||
+++ b/widget/gtk/nsGtkKeyUtils.cpp
|
||||
@@ -190,17 +190,21 @@ KeymapWrapper::Init()
|
||||
MOZ_LOG(gKeymapWrapperLog, LogLevel::Info,
|
||||
("%p Init, mGdkKeymap=%p",
|
||||
this, mGdkKeymap));
|
||||
|
||||
mModifierKeys.Clear();
|
||||
memset(mModifierMasks, 0, sizeof(mModifierMasks));
|
||||
|
||||
if (GDK_IS_X11_DISPLAY(gdk_display_get_default()))
|
||||
- InitBySystemSettings();
|
||||
+ InitBySystemSettingsX11();
|
||||
+#ifdef MOZ_WAYLAND
|
||||
+ else
|
||||
+ InitBySystemSettingsWayland();
|
||||
+#endif
|
||||
|
||||
gdk_window_add_filter(nullptr, FilterEvents, this);
|
||||
|
||||
MOZ_LOG(gKeymapWrapperLog, LogLevel::Info,
|
||||
("%p Init, CapsLock=0x%X, NumLock=0x%X, "
|
||||
"ScrollLock=0x%X, Level3=0x%X, Level5=0x%X, "
|
||||
"Shift=0x%X, Ctrl=0x%X, Alt=0x%X, Meta=0x%X, Super=0x%X, Hyper=0x%X",
|
||||
this,
|
||||
@@ -270,20 +274,20 @@ KeymapWrapper::InitXKBExtension()
|
||||
return;
|
||||
}
|
||||
|
||||
MOZ_LOG(gKeymapWrapperLog, LogLevel::Info,
|
||||
("%p InitXKBExtension, Succeeded", this));
|
||||
}
|
||||
|
||||
void
|
||||
-KeymapWrapper::InitBySystemSettings()
|
||||
+KeymapWrapper::InitBySystemSettingsX11()
|
||||
{
|
||||
MOZ_LOG(gKeymapWrapperLog, LogLevel::Info,
|
||||
- ("%p InitBySystemSettings, mGdkKeymap=%p",
|
||||
+ ("%p InitBySystemSettingsX11, mGdkKeymap=%p",
|
||||
this, mGdkKeymap));
|
||||
|
||||
Display* display =
|
||||
gdk_x11_display_get_xdisplay(gdk_display_get_default());
|
||||
|
||||
int min_keycode = 0;
|
||||
int max_keycode = 0;
|
||||
XDisplayKeycodes(display, &min_keycode, &max_keycode);
|
||||
@@ -434,16 +438,26 @@ KeymapWrapper::InitBySystemSettings()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
XFreeModifiermap(xmodmap);
|
||||
XFree(xkeymap);
|
||||
}
|
||||
|
||||
+#ifdef MOZ_WAYLAND
|
||||
+void
|
||||
+KeymapWrapper::InitBySystemSettingsWayland()
|
||||
+{
|
||||
+ // Not implemented yet, but at least Alt modifier should be handled to save
|
||||
+ // popular usage.
|
||||
+ mModifierMasks[INDEX_ALT] = 1 << 3;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
KeymapWrapper::~KeymapWrapper()
|
||||
{
|
||||
gdk_window_remove_filter(nullptr, FilterEvents, this);
|
||||
g_signal_handlers_disconnect_by_func(mGdkKeymap,
|
||||
FuncToGpointer(OnKeysChanged), this);
|
||||
g_signal_handlers_disconnect_by_func(mGdkKeymap,
|
||||
FuncToGpointer(OnDirectionChanged), this);
|
||||
g_object_unref(mGdkKeymap);
|
149
rb244010.patch
149
rb244010.patch
@ -1,149 +0,0 @@
|
||||
diff --git a/gfx/gl/GLContextProviderWayland.cpp b/gfx/gl/GLContextProviderWayland.cpp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gfx/gl/GLContextProviderWayland.cpp
|
||||
@@ -0,0 +1,99 @@
|
||||
+/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
+/* 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/. */
|
||||
+
|
||||
+#ifdef MOZ_WIDGET_GTK
|
||||
+#include <gdk/gdk.h>
|
||||
+#include <gdk/gdkx.h>
|
||||
+#endif
|
||||
+
|
||||
+#include "GLContextProvider.h"
|
||||
+
|
||||
+namespace mozilla {
|
||||
+namespace gl {
|
||||
+
|
||||
+using namespace mozilla::gfx;
|
||||
+using namespace mozilla::widget;
|
||||
+
|
||||
+static class GLContextProviderGLX sGLContextProviderGLX;
|
||||
+static class GLContextProviderEGL sGLContextProviderEGL;
|
||||
+
|
||||
+already_AddRefed<GLContext>
|
||||
+GLContextProviderWayland::CreateWrappingExisting(void* aContext, void* aSurface)
|
||||
+{
|
||||
+ if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
|
||||
+ return sGLContextProviderGLX.CreateWrappingExisting(aContext, aSurface);
|
||||
+ } else {
|
||||
+ return sGLContextProviderEGL.CreateWrappingExisting(aContext, aSurface);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+already_AddRefed<GLContext>
|
||||
+GLContextProviderWayland::CreateForCompositorWidget(CompositorWidget* aCompositorWidget, bool aForceAccelerated)
|
||||
+{
|
||||
+ if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
|
||||
+ return sGLContextProviderGLX.CreateForCompositorWidget(aCompositorWidget, aForceAccelerated);
|
||||
+ } else {
|
||||
+ return sGLContextProviderEGL.CreateForCompositorWidget(aCompositorWidget, aForceAccelerated);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+already_AddRefed<GLContext>
|
||||
+GLContextProviderWayland::CreateForWindow(nsIWidget* aWidget,
|
||||
+ bool aWebRender,
|
||||
+ bool aForceAccelerated)
|
||||
+{
|
||||
+ if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
|
||||
+ return sGLContextProviderGLX.CreateForWindow(aWidget, aWebRender, aForceAccelerated);
|
||||
+ } else {
|
||||
+ return sGLContextProviderEGL.CreateForWindow(aWidget, aWebRender, aForceAccelerated);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/*static*/ already_AddRefed<GLContext>
|
||||
+GLContextProviderWayland::CreateHeadless(CreateContextFlags flags,
|
||||
+ nsACString* const out_failureId)
|
||||
+{
|
||||
+ if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
|
||||
+ return sGLContextProviderGLX.CreateHeadless(flags, out_failureId);
|
||||
+ } else {
|
||||
+ return sGLContextProviderEGL.CreateHeadless(flags, out_failureId);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/*static*/ already_AddRefed<GLContext>
|
||||
+GLContextProviderWayland::CreateOffscreen(const IntSize& size,
|
||||
+ const SurfaceCaps& minCaps,
|
||||
+ CreateContextFlags flags,
|
||||
+ nsACString* const out_failureId)
|
||||
+{
|
||||
+ if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
|
||||
+ return sGLContextProviderGLX.CreateOffscreen(size, minCaps, flags, out_failureId);
|
||||
+ } else {
|
||||
+ return sGLContextProviderEGL.CreateOffscreen(size, minCaps, flags, out_failureId);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/*static*/ GLContext*
|
||||
+GLContextProviderWayland::GetGlobalContext()
|
||||
+{
|
||||
+ if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
|
||||
+ return sGLContextProviderGLX.GetGlobalContext();
|
||||
+ } else {
|
||||
+ return sGLContextProviderEGL.GetGlobalContext();
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/*static*/ void
|
||||
+GLContextProviderWayland::Shutdown()
|
||||
+{
|
||||
+ if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
|
||||
+ sGLContextProviderGLX.Shutdown();
|
||||
+ } else {
|
||||
+ sGLContextProviderEGL.Shutdown();
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+} /* namespace gl */
|
||||
+} /* namespace mozilla */
|
||||
diff --git a/gfx/gl/moz.build b/gfx/gl/moz.build
|
||||
--- a/gfx/gl/moz.build
|
||||
+++ b/gfx/gl/moz.build
|
||||
@@ -8,17 +8,17 @@ gl_provider = 'Null'
|
||||
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
||||
gl_provider = 'WGL'
|
||||
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
|
||||
gl_provider = 'CGL'
|
||||
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit':
|
||||
gl_provider = 'EAGL'
|
||||
elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
|
||||
- if CONFIG['MOZ_EGL_XRENDER_COMPOSITE'] or CONFIG['MOZ_WAYLAND']:
|
||||
+ if CONFIG['MOZ_EGL_XRENDER_COMPOSITE']:
|
||||
gl_provider = 'EGL'
|
||||
else:
|
||||
gl_provider = 'GLX'
|
||||
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
|
||||
gl_provider = 'EGL'
|
||||
|
||||
if CONFIG['MOZ_GL_PROVIDER']:
|
||||
gl_provider = CONFIG['MOZ_GL_PROVIDER']
|
||||
@@ -114,16 +114,21 @@ elif gl_provider == 'GLX':
|
||||
SOURCES += [
|
||||
'GLContextProviderGLX.cpp',
|
||||
'SharedSurfaceGLX.cpp'
|
||||
]
|
||||
EXPORTS += [
|
||||
'SharedSurfaceGLX.h'
|
||||
]
|
||||
|
||||
+if CONFIG['MOZ_WAYLAND']:
|
||||
+ SOURCES += [
|
||||
+ 'GLContextProviderWayland.cpp',
|
||||
+ ]
|
||||
+
|
||||
UNIFIED_SOURCES += [
|
||||
'AndroidSurfaceTexture.cpp',
|
||||
'DecomposeIntoNoRepeatTriangles.cpp',
|
||||
'EGLUtils.cpp',
|
||||
'GfxTexturesReporter.cpp',
|
||||
'GLBlitHelper.cpp',
|
||||
'GLContext.cpp',
|
||||
'GLContextFeatures.cpp',
|
||||
|
@ -1,44 +0,0 @@
|
||||
diff --git a/gfx/gl/GLContextProvider.h b/gfx/gl/GLContextProvider.h
|
||||
--- a/gfx/gl/GLContextProvider.h
|
||||
+++ b/gfx/gl/GLContextProvider.h
|
||||
@@ -36,30 +36,38 @@ namespace gl {
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
#define GL_CONTEXT_PROVIDER_NAME GLContextProviderCGL
|
||||
#include "GLContextProviderImpl.h"
|
||||
#undef GL_CONTEXT_PROVIDER_NAME
|
||||
#define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderCGL
|
||||
#endif
|
||||
|
||||
-#if defined(MOZ_X11) && !defined(MOZ_WAYLAND)
|
||||
+#if defined(MOZ_X11)
|
||||
#define GL_CONTEXT_PROVIDER_NAME GLContextProviderGLX
|
||||
#include "GLContextProviderImpl.h"
|
||||
#undef GL_CONTEXT_PROVIDER_NAME
|
||||
#define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderGLX
|
||||
#endif
|
||||
|
||||
#define GL_CONTEXT_PROVIDER_NAME GLContextProviderEGL
|
||||
#include "GLContextProviderImpl.h"
|
||||
#undef GL_CONTEXT_PROVIDER_NAME
|
||||
#ifndef GL_CONTEXT_PROVIDER_DEFAULT
|
||||
#define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderEGL
|
||||
#endif
|
||||
|
||||
+#if defined(MOZ_WAYLAND)
|
||||
+ #define GL_CONTEXT_PROVIDER_NAME GLContextProviderWayland
|
||||
+ #include "GLContextProviderImpl.h"
|
||||
+ #undef GL_CONTEXT_PROVIDER_NAME
|
||||
+ #undef GL_CONTEXT_PROVIDER_DEFAULT
|
||||
+ #define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderWayland
|
||||
+#endif
|
||||
+
|
||||
#if defined(MOZ_WIDGET_UIKIT)
|
||||
#define GL_CONTEXT_PROVIDER_NAME GLContextProviderEAGL
|
||||
#include "GLContextProviderImpl.h"
|
||||
#undef GL_CONTEXT_PROVIDER_NAME
|
||||
#ifndef GL_CONTEXT_PROVIDER_DEFAULT
|
||||
#define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderEAGL
|
||||
#endif
|
||||
#endif
|
||||
|
@ -1,29 +0,0 @@
|
||||
diff --git a/security/sandbox/linux/SandboxFilter.cpp b/security/sandbox/linux/SandboxFilter.cpp
|
||||
--- a/security/sandbox/linux/SandboxFilter.cpp
|
||||
+++ b/security/sandbox/linux/SandboxFilter.cpp
|
||||
@@ -1048,16 +1048,24 @@ public:
|
||||
|
||||
case __NR_mprotect:
|
||||
case __NR_brk:
|
||||
case __NR_madvise:
|
||||
// libc's realloc uses mremap (Bug 1286119); wasm does too (bug 1342385).
|
||||
case __NR_mremap:
|
||||
return Allow();
|
||||
|
||||
+ // Bug 1462640: Mesa libEGL uses mincore to test whether values
|
||||
+ // are pointers, for reasons.
|
||||
+ case __NR_mincore: {
|
||||
+ Arg<size_t> length(1);
|
||||
+ return If(length == getpagesize(), Allow())
|
||||
+ .Else(SandboxPolicyCommon::EvaluateSyscall(sysno));
|
||||
+ }
|
||||
+
|
||||
case __NR_sigaltstack:
|
||||
return Allow();
|
||||
|
||||
#ifdef __NR_set_thread_area
|
||||
case __NR_set_thread_area:
|
||||
return Allow();
|
||||
#endif
|
||||
|
||||
|
314
rb246410.patch
314
rb246410.patch
@ -1,314 +0,0 @@
|
||||
diff -up firefox-61.0/gfx/gl/GLScreenBuffer.cpp.rb246410 firefox-61.0/gfx/gl/GLScreenBuffer.cpp
|
||||
--- firefox-61.0/gfx/gl/GLScreenBuffer.cpp.rb246410 2018-06-19 01:03:35.000000000 +0200
|
||||
+++ firefox-61.0/gfx/gl/GLScreenBuffer.cpp 2018-06-19 12:25:27.612265592 +0200
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "SharedSurfaceIO.h"
|
||||
#endif
|
||||
|
||||
-#ifdef GL_PROVIDER_GLX
|
||||
+#ifdef MOZ_X11
|
||||
#include "GLXLibrary.h"
|
||||
#include "SharedSurfaceGLX.h"
|
||||
#endif
|
||||
@@ -83,7 +83,7 @@ GLScreenBuffer::CreateFactory(GLContext*
|
||||
if (useGl) {
|
||||
#if defined(XP_MACOSX)
|
||||
factory = SurfaceFactory_IOSurface::Create(gl, caps, ipcChannel, flags);
|
||||
-#elif defined(GL_PROVIDER_GLX)
|
||||
+#elif defined(MOZ_X11)
|
||||
if (sGLXLibrary.UseTextureFromPixmap())
|
||||
factory = SurfaceFactory_GLXDrawable::Create(gl, caps, ipcChannel, flags);
|
||||
#elif defined(MOZ_WIDGET_UIKIT)
|
||||
@@ -119,7 +119,7 @@ GLScreenBuffer::CreateFactory(GLContext*
|
||||
#endif
|
||||
}
|
||||
|
||||
-#ifdef GL_PROVIDER_GLX
|
||||
+#ifdef MOZ_X11
|
||||
if (!factory && sGLXLibrary.UseTextureFromPixmap()) {
|
||||
factory = SurfaceFactory_GLXDrawable::Create(gl, caps, ipcChannel, flags);
|
||||
}
|
||||
diff -up firefox-61.0/gfx/layers/client/TextureClient.cpp.rb246410 firefox-61.0/gfx/layers/client/TextureClient.cpp
|
||||
--- firefox-61.0/gfx/layers/client/TextureClient.cpp.rb246410 2018-06-19 01:03:35.000000000 +0200
|
||||
+++ firefox-61.0/gfx/layers/client/TextureClient.cpp 2018-06-19 12:25:27.612265592 +0200
|
||||
@@ -45,10 +45,8 @@
|
||||
#endif
|
||||
#ifdef MOZ_X11
|
||||
#include "mozilla/layers/TextureClientX11.h"
|
||||
-#ifdef GL_PROVIDER_GLX
|
||||
#include "GLXLibrary.h"
|
||||
#endif
|
||||
-#endif
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
#include "mozilla/layers/MacIOSurfaceTextureClientOGL.h"
|
||||
@@ -1127,7 +1125,6 @@ TextureClient::CreateForDrawing(TextureF
|
||||
{
|
||||
data = X11TextureData::Create(aSize, aFormat, aTextureFlags, aAllocator);
|
||||
}
|
||||
-#ifdef GL_PROVIDER_GLX
|
||||
if (!data && aLayersBackend == LayersBackend::LAYERS_OPENGL &&
|
||||
type == gfxSurfaceType::Xlib &&
|
||||
aFormat != SurfaceFormat::A8 &&
|
||||
@@ -1136,7 +1133,6 @@ TextureClient::CreateForDrawing(TextureF
|
||||
data = X11TextureData::Create(aSize, aFormat, aTextureFlags, aAllocator);
|
||||
}
|
||||
#endif
|
||||
-#endif
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
if (!data && gfxPrefs::UseIOSurfaceTextures()) {
|
||||
diff -up firefox-61.0/gfx/layers/composite/X11TextureHost.cpp.rb246410 firefox-61.0/gfx/layers/composite/X11TextureHost.cpp
|
||||
--- firefox-61.0/gfx/layers/composite/X11TextureHost.cpp.rb246410 2018-06-19 01:03:35.000000000 +0200
|
||||
+++ firefox-61.0/gfx/layers/composite/X11TextureHost.cpp 2018-06-19 12:25:27.612265592 +0200
|
||||
@@ -7,10 +7,8 @@
|
||||
#include "X11TextureHost.h"
|
||||
#include "mozilla/layers/BasicCompositor.h"
|
||||
#include "mozilla/layers/X11TextureSourceBasic.h"
|
||||
-#ifdef GL_PROVIDER_GLX
|
||||
#include "mozilla/layers/CompositorOGL.h"
|
||||
#include "mozilla/layers/X11TextureSourceOGL.h"
|
||||
-#endif
|
||||
#include "gfxXlibSurface.h"
|
||||
#include "gfx2DGlue.h"
|
||||
|
||||
@@ -43,12 +41,10 @@ X11TextureHost::Lock()
|
||||
mTextureSource =
|
||||
new X11TextureSourceBasic(mCompositor->AsBasicCompositor(), mSurface);
|
||||
break;
|
||||
-#ifdef GL_PROVIDER_GLX
|
||||
case LayersBackend::LAYERS_OPENGL:
|
||||
mTextureSource =
|
||||
new X11TextureSourceOGL(mCompositor->AsCompositorOGL(), mSurface);
|
||||
break;
|
||||
-#endif
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -78,11 +74,9 @@ X11TextureHost::GetFormat() const
|
||||
return SurfaceFormat::UNKNOWN;
|
||||
}
|
||||
gfxContentType type = mSurface->GetContentType();
|
||||
-#ifdef GL_PROVIDER_GLX
|
||||
if (mCompositor->GetBackendType() == LayersBackend::LAYERS_OPENGL) {
|
||||
return X11TextureSourceOGL::ContentTypeToSurfaceFormat(type);
|
||||
}
|
||||
-#endif
|
||||
return X11TextureSourceBasic::ContentTypeToSurfaceFormat(type);
|
||||
}
|
||||
|
||||
diff -up firefox-61.0/gfx/layers/ipc/ShadowLayerUtilsX11.cpp.rb246410 firefox-61.0/gfx/layers/ipc/ShadowLayerUtilsX11.cpp
|
||||
--- firefox-61.0/gfx/layers/ipc/ShadowLayerUtilsX11.cpp.rb246410 2018-06-19 01:03:35.000000000 +0200
|
||||
+++ firefox-61.0/gfx/layers/ipc/ShadowLayerUtilsX11.cpp 2018-06-19 12:25:27.612265592 +0200
|
||||
@@ -74,11 +74,9 @@ SurfaceDescriptorX11::SurfaceDescriptorX
|
||||
mFormat = cairo_xlib_surface_get_visual(aSurf->CairoSurface())->visualid;
|
||||
}
|
||||
|
||||
-#ifdef GL_PROVIDER_GLX
|
||||
if (aForwardGLX) {
|
||||
mGLXPixmap = aSurf->GetGLXPixmap();
|
||||
}
|
||||
-#endif
|
||||
}
|
||||
|
||||
SurfaceDescriptorX11::SurfaceDescriptorX11(Drawable aDrawable, XID aFormatID,
|
||||
@@ -109,10 +107,8 @@ SurfaceDescriptorX11::OpenForeign() cons
|
||||
surf = new gfxXlibSurface(display, mId, visual, mSize);
|
||||
}
|
||||
|
||||
-#ifdef GL_PROVIDER_GLX
|
||||
if (mGLXPixmap)
|
||||
surf->BindGLXPixmap(mGLXPixmap);
|
||||
-#endif
|
||||
|
||||
return surf->CairoStatus() ? nullptr : surf.forget();
|
||||
}
|
||||
diff -up firefox-61.0/gfx/layers/opengl/X11TextureSourceOGL.cpp.rb246410 firefox-61.0/gfx/layers/opengl/X11TextureSourceOGL.cpp
|
||||
--- firefox-61.0/gfx/layers/opengl/X11TextureSourceOGL.cpp.rb246410 2018-06-19 01:03:35.000000000 +0200
|
||||
+++ firefox-61.0/gfx/layers/opengl/X11TextureSourceOGL.cpp 2018-06-19 12:25:27.613265589 +0200
|
||||
@@ -4,7 +4,7 @@
|
||||
* 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/. */
|
||||
|
||||
-#ifdef GL_PROVIDER_GLX
|
||||
+#ifdef MOZ_X11
|
||||
|
||||
#include "X11TextureSourceOGL.h"
|
||||
#include "gfxXlibSurface.h"
|
||||
diff -up firefox-61.0/gfx/layers/opengl/X11TextureSourceOGL.h.rb246410 firefox-61.0/gfx/layers/opengl/X11TextureSourceOGL.h
|
||||
--- firefox-61.0/gfx/layers/opengl/X11TextureSourceOGL.h.rb246410 2018-06-19 01:03:35.000000000 +0200
|
||||
+++ firefox-61.0/gfx/layers/opengl/X11TextureSourceOGL.h 2018-06-19 12:25:27.613265589 +0200
|
||||
@@ -7,7 +7,7 @@
|
||||
#ifndef MOZILLA_GFX_X11TEXTURESOURCEOGL__H
|
||||
#define MOZILLA_GFX_X11TEXTURESOURCEOGL__H
|
||||
|
||||
-#ifdef GL_PROVIDER_GLX
|
||||
+#ifdef MOZ_X11
|
||||
|
||||
#include "mozilla/layers/CompositorOGL.h"
|
||||
#include "mozilla/layers/TextureHostOGL.h"
|
||||
diff -up firefox-61.0/gfx/thebes/gfxPlatformGtk.cpp.rb246410 firefox-61.0/gfx/thebes/gfxPlatformGtk.cpp
|
||||
--- firefox-61.0/gfx/thebes/gfxPlatformGtk.cpp.rb246410 2018-06-19 12:25:27.598265633 +0200
|
||||
+++ firefox-61.0/gfx/thebes/gfxPlatformGtk.cpp 2018-06-19 12:26:35.751066530 +0200
|
||||
@@ -42,11 +42,9 @@
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/X11Util.h"
|
||||
|
||||
-#ifdef GL_PROVIDER_GLX
|
||||
#include "GLContextProvider.h"
|
||||
#include "GLContextGLX.h"
|
||||
#include "GLXLibrary.h"
|
||||
-#endif
|
||||
|
||||
/* Undefine the Status from Xlib since it will conflict with system headers on OSX */
|
||||
#if defined(__APPLE__) && defined(Status)
|
||||
@@ -508,7 +506,7 @@ gfxPlatformGtk::CheckVariationFontSuppor
|
||||
return major * 1000000 + minor * 1000 + patch >= 2007001;
|
||||
}
|
||||
|
||||
-#ifdef GL_PROVIDER_GLX
|
||||
+#ifdef MOZ_X11
|
||||
|
||||
class GLXVsyncSource final : public VsyncSource
|
||||
{
|
||||
diff -up firefox-61.0/gfx/thebes/gfxPlatformGtk.h.rb246410 firefox-61.0/gfx/thebes/gfxPlatformGtk.h
|
||||
--- firefox-61.0/gfx/thebes/gfxPlatformGtk.h.rb246410 2018-06-19 01:03:35.000000000 +0200
|
||||
+++ firefox-61.0/gfx/thebes/gfxPlatformGtk.h 2018-06-19 12:25:27.613265589 +0200
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
|
||||
bool AccelerateLayersByDefault() override;
|
||||
|
||||
-#ifdef GL_PROVIDER_GLX
|
||||
+#ifdef MOZ_X11
|
||||
already_AddRefed<mozilla::gfx::VsyncSource> CreateHardwareVsyncSource() override;
|
||||
#endif
|
||||
|
||||
diff -up firefox-61.0/gfx/thebes/gfxXlibSurface.cpp.rb246410 firefox-61.0/gfx/thebes/gfxXlibSurface.cpp
|
||||
--- firefox-61.0/gfx/thebes/gfxXlibSurface.cpp.rb246410 2018-06-19 01:03:35.000000000 +0200
|
||||
+++ firefox-61.0/gfx/thebes/gfxXlibSurface.cpp 2018-06-19 12:25:27.613265589 +0200
|
||||
@@ -25,9 +25,7 @@ using namespace mozilla::gfx;
|
||||
|
||||
gfxXlibSurface::gfxXlibSurface(Display *dpy, Drawable drawable, Visual *visual)
|
||||
: mPixmapTaken(false), mDisplay(dpy), mDrawable(drawable)
|
||||
-#if defined(GL_PROVIDER_GLX)
|
||||
, mGLXPixmap(X11None)
|
||||
-#endif
|
||||
{
|
||||
const gfx::IntSize size = DoSizeQuery();
|
||||
cairo_surface_t *surf = cairo_xlib_surface_create(dpy, drawable, visual, size.width, size.height);
|
||||
@@ -36,9 +34,7 @@ gfxXlibSurface::gfxXlibSurface(Display *
|
||||
|
||||
gfxXlibSurface::gfxXlibSurface(Display *dpy, Drawable drawable, Visual *visual, const gfx::IntSize& size)
|
||||
: mPixmapTaken(false), mDisplay(dpy), mDrawable(drawable)
|
||||
-#if defined(GL_PROVIDER_GLX)
|
||||
, mGLXPixmap(X11None)
|
||||
-#endif
|
||||
{
|
||||
NS_ASSERTION(Factory::CheckSurfaceSize(size, XLIB_IMAGE_SIDE_SIZE_LIMIT),
|
||||
"Bad size");
|
||||
@@ -51,9 +47,7 @@ gfxXlibSurface::gfxXlibSurface(Screen *s
|
||||
const gfx::IntSize& size)
|
||||
: mPixmapTaken(false), mDisplay(DisplayOfScreen(screen)),
|
||||
mDrawable(drawable)
|
||||
-#if defined(GL_PROVIDER_GLX)
|
||||
- , mGLXPixmap(X11None)
|
||||
-#endif
|
||||
+ , mGLXPixmap(X11None)
|
||||
{
|
||||
NS_ASSERTION(Factory::CheckSurfaceSize(size, XLIB_IMAGE_SIDE_SIZE_LIMIT),
|
||||
"Bad Size");
|
||||
@@ -67,9 +61,7 @@ gfxXlibSurface::gfxXlibSurface(Screen *s
|
||||
|
||||
gfxXlibSurface::gfxXlibSurface(cairo_surface_t *csurf)
|
||||
: mPixmapTaken(false)
|
||||
-#if defined(GL_PROVIDER_GLX)
|
||||
- , mGLXPixmap(X11None)
|
||||
-#endif
|
||||
+ , mGLXPixmap(X11None)
|
||||
{
|
||||
NS_PRECONDITION(cairo_surface_status(csurf) == 0,
|
||||
"Not expecting an error surface");
|
||||
@@ -84,11 +76,9 @@ gfxXlibSurface::~gfxXlibSurface()
|
||||
{
|
||||
// gfxASurface's destructor calls RecordMemoryFreed().
|
||||
if (mPixmapTaken) {
|
||||
-#if defined(GL_PROVIDER_GLX)
|
||||
if (mGLXPixmap) {
|
||||
gl::sGLXLibrary.DestroyPixmap(mDisplay, mGLXPixmap);
|
||||
}
|
||||
-#endif
|
||||
XFreePixmap (mDisplay, mDrawable);
|
||||
}
|
||||
}
|
||||
@@ -120,7 +110,7 @@ gfxXlibSurface::TakePixmap()
|
||||
// The bit depth returned from Cairo is technically int, but this is
|
||||
// the last place we'd be worried about that scenario.
|
||||
unsigned int bitDepth = cairo_xlib_surface_get_depth(CairoSurface());
|
||||
- MOZ_ASSERT((bitDepth % 8) == 0, "Memory used not recorded correctly");
|
||||
+ MOZ_ASSERT((bitDepth % 8) == 0, "Memory used not recorded correctly");
|
||||
|
||||
// Divide by 8 because surface_get_depth gives us the number of *bits* per
|
||||
// pixel.
|
||||
@@ -272,7 +262,7 @@ gfxXlibSurface::CreateSimilarSurface(gfx
|
||||
void
|
||||
gfxXlibSurface::Finish()
|
||||
{
|
||||
-#if defined(GL_PROVIDER_GLX)
|
||||
+#if defined(MOZ_X11)
|
||||
if (mPixmapTaken && mGLXPixmap) {
|
||||
gl::sGLXLibrary.DestroyPixmap(mDisplay, mGLXPixmap);
|
||||
mGLXPixmap = X11None;
|
||||
@@ -498,7 +488,7 @@ gfxXlibSurface::DepthOfVisual(const Scre
|
||||
NS_ERROR("Visual not on Screen.");
|
||||
return 0;
|
||||
}
|
||||
-
|
||||
+
|
||||
/* static */
|
||||
Visual*
|
||||
gfxXlibSurface::FindVisual(Screen *screen, gfxImageFormat format)
|
||||
@@ -587,7 +577,7 @@ gfxXlibSurface::XRenderFormat()
|
||||
return cairo_xlib_surface_get_xrender_format(CairoSurface());
|
||||
}
|
||||
|
||||
-#if defined(GL_PROVIDER_GLX)
|
||||
+#if defined(MOZ_X11)
|
||||
GLXPixmap
|
||||
gfxXlibSurface::GetGLXPixmap()
|
||||
{
|
||||
diff -up firefox-61.0/gfx/thebes/gfxXlibSurface.h.rb246410 firefox-61.0/gfx/thebes/gfxXlibSurface.h
|
||||
--- firefox-61.0/gfx/thebes/gfxXlibSurface.h.rb246410 2018-06-19 01:03:35.000000000 +0200
|
||||
+++ firefox-61.0/gfx/thebes/gfxXlibSurface.h 2018-06-19 12:25:27.613265589 +0200
|
||||
@@ -12,9 +12,7 @@
|
||||
#include <X11/Xlib.h>
|
||||
#include "X11UndefineNone.h"
|
||||
|
||||
-#if defined(GL_PROVIDER_GLX)
|
||||
#include "GLXLibrary.h"
|
||||
-#endif
|
||||
|
||||
#include "nsSize.h"
|
||||
|
||||
@@ -86,12 +84,10 @@ public:
|
||||
// Find a visual and colormap pair suitable for rendering to this surface.
|
||||
bool GetColormapAndVisual(Colormap* colormap, Visual **visual);
|
||||
|
||||
-#if defined(GL_PROVIDER_GLX)
|
||||
GLXPixmap GetGLXPixmap();
|
||||
// Binds a GLXPixmap backed by this context's surface.
|
||||
// Primarily for use in sharing surfaces.
|
||||
void BindGLXPixmap(GLXPixmap aPixmap);
|
||||
-#endif
|
||||
|
||||
// Return true if cairo will take its slow path when this surface is used
|
||||
// in a pattern with EXTEND_PAD. As a workaround for XRender's RepeatPad
|
||||
@@ -114,9 +110,7 @@ protected:
|
||||
|
||||
const mozilla::gfx::IntSize DoSizeQuery();
|
||||
|
||||
-#if defined(GL_PROVIDER_GLX)
|
||||
GLXPixmap mGLXPixmap;
|
||||
-#endif
|
||||
};
|
||||
|
||||
#endif /* GFX_XLIBSURFACE_H */
|
@ -1,23 +0,0 @@
|
||||
diff --git a/widget/xremoteclient/DBusRemoteClient.cpp b/widget/xremoteclient/DBusRemoteClient.cpp
|
||||
--- a/widget/xremoteclient/DBusRemoteClient.cpp
|
||||
+++ b/widget/xremoteclient/DBusRemoteClient.cpp
|
||||
@@ -137,17 +137,17 @@ DBusRemoteClient::GetRemoteDestinationNa
|
||||
profileName.get());
|
||||
if (aDestinationName.Length() > DBUS_MAXIMUM_NAME_LENGTH)
|
||||
aDestinationName.Truncate(DBUS_MAXIMUM_NAME_LENGTH);
|
||||
|
||||
static auto sDBusValidateBusName =
|
||||
(bool (*)(const char *, DBusError *))
|
||||
dlsym(RTLD_DEFAULT, "dbus_validate_bus_name");
|
||||
if (!sDBusValidateBusName) {
|
||||
- return false
|
||||
+ return false;
|
||||
}
|
||||
|
||||
if (!sDBusValidateBusName(aDestinationName.get(), nullptr)) {
|
||||
// We don't have a valid busName yet - try to create a default one.
|
||||
aDestinationName = nsPrintfCString("org.mozilla.%s.%s", aProgram,
|
||||
"default");
|
||||
if (!sDBusValidateBusName(aDestinationName.get(), nullptr)) {
|
||||
// We failed completelly to get a valid bus name - just quit
|
||||
|
4
sources
4
sources
@ -1,2 +1,2 @@
|
||||
SHA512 (firefox-langpacks-61.0.2-20180809.tar.xz) = 1123bea1967e8795f8a2a5999244bf99c7fb947fca30d0469c27e9e9b4b182d5fa913150bd16f243898eaf4c14c7645721b0d4c78dfc769a622015410567b93e
|
||||
SHA512 (firefox-61.0.2.source.tar.xz) = a20b127726cf0a082604efcbc9b91ea3c653ac639edb4b26e1fadef51410ccdae9b5d3a534563528945d2425382346858af307e79e8da1e4972aacbe1277f6ff
|
||||
SHA512 (firefox-langpacks-62.0-20180828.tar.xz) = a3995432c54e7b8bf05d0b114977eda5a52f5072bd45ab685c56ab7218e891ebdf724d0aebf9c5e5aafa7b9dcdec2dcbf1a5aae2f23cf5984469c5830e631a00
|
||||
SHA512 (firefox-62.0.source.tar.xz) = 23603b5bead5b030ad5caab84c2f26c323d99e1a12f99a70c511cd6b26b33e332c1c1954d4a6accbec496447a279fac30b4fcba9ea8bd200364f911b82c4b947
|
||||
|
Loading…
Reference in New Issue
Block a user