update qtwebengine patch

This commit is contained in:
Weng Xuetian 2018-05-25 15:21:20 -07:00
parent f62054d260
commit 1ec008eb41
5 changed files with 253 additions and 11 deletions

View File

@ -5,16 +5,23 @@ pkgver=${QSubVersion}
pkgrel=2
arch=('x86_64')
url='http://qt-project.org/'
license=('GPL3' 'LGPL' 'FDL' 'custom')
license=('LGPL3' 'LGPL2.1' 'BSD')
pkgdesc='Provides support for web applications using the Chromium browser project'
depends=('qt5-webchannel' 'qt5-location' 'libxcomposite' 'libxrandr' 'pciutils' 'libxss' 'libvpx'
'libevent' 'libsrtp' 'snappy' 'nss' 'protobuf' 'libxslt' 'libxdamage' 'minizip' 'ffmpeg' 'libxcursor')
# namcap note: libxdamage is needed for nvidia users
makedepends=('python2' 'git' 'gperf' 'jsoncpp' 'ninja')
depends=('qt5-webchannel' 'qt5-location' 'libxcomposite' 'libxrandr' 'pciutils' 'libxss'
'libevent' 'snappy' 'nss' 'protobuf' 'libxslt' 'minizip' 'ffmpeg' 're2' 'libvpx')
makedepends=('python2' 'git' 'gperf' 'jsoncpp' 'ninja' 'qt5-tools')
groups=('qt5')
options=('debug')
source=( $(getSrc ${pkgname}))
md5sums=( $(getSum ${pkgname}) )
source=( $(getSrc ${pkgname})
qtwebengine-harmony.patch qtwebengine-gcc8.patch qtwebengine-ffmpeg4.patch
falkon-copy-menu.patch::"http://code.qt.io/cgit/qt/qtwebengine.git/patch/?id=af0c47b1"
qtwebengine-no-gpu.patch)
md5sums=( $(getSum ${pkgname})
'254061cb349cff714230b7cca83b0a4c'
'c5779e35eb15edf97789885a72ec873a'
'2835f9fe8097ff3d6098812c70f48044'
'4fd37c3ceb4a1f92276cae2c83ee1a5a'
'c182ccd60d079d65203e112c30a4217d')
prepare() {
mkdir -p build
@ -25,6 +32,17 @@ prepare() {
cd $(getPkgName ${pkgname})
# FreeType 2.8.1
patch -Np1 -i ../qtwebengine-harmony.patch
# Fix copy context menu
patch -p1 -i "$srcdir"/falkon-copy-menu.patch
# Disable GPU rendering on Wayland https://bugreports.qt.io/browse/QTBUG-68479
patch -p1 -i "$srcdir"/qtwebengine-no-gpu.patch
# Fix build with gcc8 (Fedora)
cd src/3rdparty/chromium
patch -p1 -i "$srcdir"/qtwebengine-gcc8.patch
# Fix build with ffmpeg 4
patch -p2 -i "$srcdir"/qtwebengine-ffmpeg4.patch
}
build() {
@ -35,8 +53,8 @@ build() {
-proprietary-codecs \
-system-ffmpeg \
-webp \
-spellchecker
# -webengine-icu
-spellchecker \
-webengine-icu
make
}
@ -47,6 +65,5 @@ package() {
# Drop QMAKE_PRL_BUILD_DIR because reference the build dir
qtprlfix
install -d "$pkgdir"/usr/share/licenses
ln -s /usr/share/licenses/qt5-base "$pkgdir"/usr/share/licenses/${pkgname}
install -Dm644 "$srcdir"/${_pkgfqn}/src/3rdparty/chromium/LICENSE "$pkgdir"/usr/share/licenses/${pkgname}/LICENSE.chromium
}

View File

@ -0,0 +1,13 @@
diff --git a/chromium/media/base/decoder_buffer.h b/chromium/media/base/decoder_buffer.h
index 0341e5784f..60ffba708b 100644
--- a/chromium/media/base/decoder_buffer.h
+++ b/chromium/media/base/decoder_buffer.h
@@ -37,7 +37,7 @@ class MEDIA_EXPORT DecoderBuffer
: public base::RefCountedThreadSafe<DecoderBuffer> {
public:
enum {
- kPaddingSize = 32,
+ kPaddingSize = 64,
#if defined(ARCH_CPU_ARM_FAMILY)
kAlignmentSize = 16
#else

View File

@ -0,0 +1,36 @@
diff -up chromium-65.0.3325.162/mojo/public/cpp/bindings/associated_interface_ptr_info.h.boolfix chromium-65.0.3325.162/mojo/public/cpp/bindings/associated_interface_ptr_info.h
--- chromium-65.0.3325.162/mojo/public/cpp/bindings/associated_interface_ptr_info.h.boolfix 2018-03-15 13:07:54.999428755 -0400
+++ chromium-65.0.3325.162/mojo/public/cpp/bindings/associated_interface_ptr_info.h 2018-03-15 13:08:21.270794252 -0400
@@ -45,7 +45,7 @@ class AssociatedInterfacePtrInfo {
bool is_valid() const { return handle_.is_valid(); }
- explicit operator bool() const { return handle_; }
+ explicit operator bool() const { return (bool) handle_; }
ScopedInterfaceEndpointHandle PassHandle() {
return std::move(handle_);
diff -up chromium-65.0.3325.162/mojo/public/cpp/bindings/associated_interface_request.h.boolfix chromium-65.0.3325.162/mojo/public/cpp/bindings/associated_interface_request.h
--- chromium-65.0.3325.162/mojo/public/cpp/bindings/associated_interface_request.h.boolfix 2018-03-15 13:07:09.680523296 -0400
+++ chromium-65.0.3325.162/mojo/public/cpp/bindings/associated_interface_request.h 2018-03-15 13:07:44.429684037 -0400
@@ -50,7 +50,7 @@ class AssociatedInterfaceRequest {
// handle.
bool is_pending() const { return handle_.is_valid(); }
- explicit operator bool() const { return handle_; }
+ explicit operator bool() const { return (bool) handle_; }
ScopedInterfaceEndpointHandle PassHandle() { return std::move(handle_); }
diff -up chromium-65.0.3325.162/mojo/public/cpp/bindings/interface_request.h.boolfix chromium-65.0.3325.162/mojo/public/cpp/bindings/interface_request.h
--- chromium-65.0.3325.162/mojo/public/cpp/bindings/interface_request.h.boolfix 2018-03-15 13:08:33.494499025 -0400
+++ chromium-65.0.3325.162/mojo/public/cpp/bindings/interface_request.h 2018-03-15 13:10:39.218462546 -0400
@@ -54,7 +54,7 @@ class InterfaceRequest {
// Indicates whether the request currently contains a valid message pipe.
bool is_pending() const { return handle_.is_valid(); }
- explicit operator bool() const { return handle_; }
+ explicit operator bool() const { return (bool) handle_; }
// Removes the message pipe from the request and returns it.
ScopedMessagePipeHandle PassMessagePipe() { return std::move(handle_); }

View File

@ -0,0 +1,77 @@
--- qtwebengine-opensource-src-5.9.1/src/3rdparty/chromium/third_party/skia/src/ports/SkFontHost_FreeType.cpp.orig 2017-10-10 17:42:06.956950985 +0200
+++ qtwebengine-opensource-src-5.9.1/src/3rdparty/chromium/third_party/skia/src/ports/SkFontHost_FreeType.cpp 2017-10-10 17:46:05.824187787 +0200
@@ -99,8 +99,6 @@
FreeTypeLibrary()
: fGetVarDesignCoordinates(nullptr)
, fLibrary(nullptr)
- , fIsLCDSupported(false)
- , fLCDExtra(0)
{
if (FT_New_Library(&gFTMemory, &fLibrary)) {
return;
@@ -147,12 +145,7 @@
}
#endif
- // Setup LCD filtering. This reduces color fringes for LCD smoothed glyphs.
- // The default has changed over time, so this doesn't mean the same thing to all users.
- if (FT_Library_SetLcdFilter(fLibrary, FT_LCD_FILTER_DEFAULT) == 0) {
- fIsLCDSupported = true;
- fLCDExtra = 2; //Using a filter adds one full pixel to each side.
- }
+ FT_Library_SetLcdFilter(fLibrary, FT_LCD_FILTER_DEFAULT);
}
~FreeTypeLibrary() {
if (fLibrary) {
@@ -161,8 +153,6 @@
}
FT_Library library() { return fLibrary; }
- bool isLCDSupported() { return fIsLCDSupported; }
- int lcdExtra() { return fLCDExtra; }
// FT_Get_{MM,Var}_{Blend,Design}_Coordinates were added in FreeType 2.7.1.
// Prior to this there was no way to get the coordinates out of the FT_Face.
@@ -173,8 +163,6 @@
private:
FT_Library fLibrary;
- bool fIsLCDSupported;
- int fLCDExtra;
// FT_Library_SetLcdFilterWeights was introduced in FreeType 2.4.0.
// The following platforms provide FreeType of at least 2.4.0.
@@ -704,17 +692,6 @@
rec->fTextSize = SkIntToScalar(1 << 14);
}
- if (isLCD(*rec)) {
- // TODO: re-work so that FreeType is set-up and selected by the SkFontMgr.
- SkAutoMutexAcquire ama(gFTMutex);
- ref_ft_library();
- if (!gFTLibrary->isLCDSupported()) {
- // If the runtime Freetype library doesn't support LCD, disable it here.
- rec->fMaskFormat = SkMask::kA8_Format;
- }
- unref_ft_library();
- }
-
SkPaint::Hinting h = rec->getHinting();
if (SkPaint::kFull_Hinting == h && !isLCD(*rec)) {
// collapse full->normal hinting if we're not doing LCD
@@ -1115,11 +1092,11 @@
void SkScalerContext_FreeType::updateGlyphIfLCD(SkGlyph* glyph) {
if (isLCD(fRec)) {
if (fLCDIsVert) {
- glyph->fHeight += gFTLibrary->lcdExtra();
- glyph->fTop -= gFTLibrary->lcdExtra() >> 1;
+ glyph->fHeight += 2;
+ glyph->fTop -= 1;
} else {
- glyph->fWidth += gFTLibrary->lcdExtra();
- glyph->fLeft -= gFTLibrary->lcdExtra() >> 1;
+ glyph->fWidth += 2;
+ glyph->fLeft -= 1;
}
}
}

View File

@ -0,0 +1,99 @@
From: Antonio Larrosa <alarrosa@suse.com>
Subject: Disable GPU when using nouveau or running on wayland
References: boo#1005323, boo#1060990
Qt WebEngine uses multi-threaded OpenGL, which nouveau does not support.
It also crashes when running on wayland, the cause is not yet known.
Work around these issues by not doing GPU-accelerated rendering in such
cases.
Index: qtwebengine-everywhere-src-5.10.0/src/core/web_engine_context.cpp
===================================================================
--- qtwebengine-everywhere-src-5.10.0.orig/src/core/web_engine_context.cpp
+++ qtwebengine-everywhere-src-5.10.0/src/core/web_engine_context.cpp
@@ -93,6 +93,7 @@
#include <QOffscreenSurface>
#ifndef QT_NO_OPENGL
# include <QOpenGLContext>
+# include <QOpenGLFunctions>
#endif
#include <QQuickWindow>
#include <QStringList>
@@ -167,6 +168,39 @@ void dummyGetPluginCallback(const std::v
}
#endif
+#ifndef QT_NO_OPENGL
+QString openGLVendor()
+{
+ QString vendor;
+
+ QOpenGLContext *oldContext = QOpenGLContext::currentContext();
+ QSurface *oldSurface = 0;
+ if (oldContext)
+ oldSurface = oldContext->surface();
+
+ QScopedPointer<QOffscreenSurface> surface( new QOffscreenSurface );
+ surface->create();
+ QOpenGLContext context;
+ if (!context.create()) {
+ qDebug() << "Error creating openGL context";
+ }
+ else if (!context.makeCurrent(surface.data())) {
+ qDebug() << "Error making openGL context current context";
+ } else {
+ const GLubyte *p;
+ QOpenGLFunctions *f = context.functions();
+ if ((p = f->glGetString(GL_VENDOR)))
+ vendor = QString::fromLatin1(reinterpret_cast<const char *>(p));
+ }
+
+ context.doneCurrent();
+ if (oldContext && oldSurface)
+ oldContext->makeCurrent(oldSurface);
+
+ return vendor;
+}
+#endif
+
} // namespace
namespace QtWebEngineCore {
@@ -379,6 +413,27 @@ WebEngineContext::WebEngineContext()
const char *glType = 0;
#ifndef QT_NO_OPENGL
+ bool disableGpu = qEnvironmentVariableIsSet("QT_WEBENGINE_DISABLE_GPU");
+
+ if (!qEnvironmentVariableIsSet("QT_WEBENGINE_DISABLE_WAYLAND_WORKAROUND") && platform.startsWith("wayland", Qt::CaseInsensitive))
+ {
+ qWarning() << "Running on wayland. Qt WebEngine will disable usage of the GPU.\n"
+ "Note: you can set the QT_WEBENGINE_DISABLE_WAYLAND_WORKAROUND\n"
+ "environment variable before running this application, but this is \n"
+ "not recommended since this usually causes applications to crash.";
+ disableGpu = true;
+ }
+
+ if (!qEnvironmentVariableIsSet("QT_WEBENGINE_DISABLE_NOUVEAU_WORKAROUND") && openGLVendor() == QStringLiteral("nouveau"))
+ {
+ qWarning() << "Nouveau openGL driver detected. Qt WebEngine will disable usage of the GPU.\n"
+ "Note: you can set the QT_WEBENGINE_DISABLE_NOUVEAU_WORKAROUND\n"
+ "environment variable before running this application, but this is \n"
+ "not recommended since this usually causes applications to crash as\n"
+ "Nouveau openGL drivers don't support multithreaded rendering";
+ disableGpu = true;
+ }
+
bool tryGL =
!usingANGLE()
&& (!usingSoftwareDynamicGL()
@@ -389,7 +444,7 @@ WebEngineContext::WebEngineContext()
|| enableWebGLSoftwareRendering
#endif
)
- && !usingQtQuick2DRenderer();
+ && !usingQtQuick2DRenderer() && !disableGpu;
if (tryGL) {
if (qt_gl_global_share_context() && qt_gl_global_share_context()->isValid()) {