webkit2gtk: update to 2.42.5

This commit is contained in:
chrysos349 2024-02-20 00:49:10 +03:00 committed by oreo639
parent 3e8b9f9ad7
commit 5534c3c4fb
10 changed files with 129 additions and 554 deletions

View file

@ -1,241 +0,0 @@
Original source: Jacek Piszczek <jacek.piszczek@runbox.com>
diff --git a/Source/WebCore/platform/graphics/PixelBufferConversion.cpp b/Source/WebCore/platform/graphics/PixelBufferConversion.cpp
index 9acf304d..618b7b26 100644
--- a/Source/WebCore/platform/graphics/PixelBufferConversion.cpp
+++ b/Source/WebCore/platform/graphics/PixelBufferConversion.cpp
@@ -140,9 +140,17 @@ static void convertImagePixelsAccelerated(const ConstPixelBufferConversionView&
enum class PixelFormatConversion { None, Permute };
template<PixelFormatConversion pixelFormatConversion>
+#if CPU(BIG_ENDIAN)
+static void convertSinglePixelPremultipliedToPremultiplied(PixelFormat sourcePixelFormat, const uint8_t* sourcePixel, PixelFormat destinationPixelFormat, uint8_t* destinationPixel)
+#else
static void convertSinglePixelPremultipliedToPremultiplied(const uint8_t* sourcePixel, uint8_t* destinationPixel)
+#endif
{
+#if CPU(BIG_ENDIAN)
+ uint8_t alpha = sourcePixel[sourcePixelFormat == PixelFormat::ARGB8 ? 0 : 3];
+#else
uint8_t alpha = sourcePixel[3];
+#endif
if (!alpha) {
reinterpret_cast<uint32_t*>(destinationPixel)[0] = 0;
return;
@@ -151,23 +158,81 @@ static void convertSinglePixelPremultipliedToPremultiplied(const uint8_t* source
if constexpr (pixelFormatConversion == PixelFormatConversion::None)
reinterpret_cast<uint32_t*>(destinationPixel)[0] = reinterpret_cast<const uint32_t*>(sourcePixel)[0];
else {
+#if CPU(BIG_ENDIAN)
+ // Swap pixel channels ARGB <-> RGBA.
+ if (destinationPixelFormat == PixelFormat::ARGB8)
+ {
+ destinationPixel[0] = sourcePixel[3];
+ destinationPixel[1] = sourcePixel[0];
+ destinationPixel[2] = sourcePixel[1];
+ destinationPixel[3] = sourcePixel[2];
+ }
+ else
+ {
+ destinationPixel[0] = sourcePixel[1];
+ destinationPixel[1] = sourcePixel[2];
+ destinationPixel[2] = sourcePixel[3];
+ destinationPixel[3] = sourcePixel[0];
+ }
+#else
// Swap pixel channels BGRA <-> RGBA.
destinationPixel[0] = sourcePixel[2];
destinationPixel[1] = sourcePixel[1];
destinationPixel[2] = sourcePixel[0];
destinationPixel[3] = sourcePixel[3];
+#endif
}
}
template<PixelFormatConversion pixelFormatConversion>
+#if CPU(BIG_ENDIAN)
+static void convertSinglePixelPremultipliedToUnpremultiplied(PixelFormat sourcePixelFormat, const uint8_t* sourcePixel, PixelFormat destinationPixelFormat, uint8_t* destinationPixel)
+#else
static void convertSinglePixelPremultipliedToUnpremultiplied(const uint8_t* sourcePixel, uint8_t* destinationPixel)
+#endif
{
+#if CPU(BIG_ENDIAN)
+ uint8_t alpha = sourcePixel[sourcePixelFormat == PixelFormat::ARGB8 ? 0 : 3];
+#else
uint8_t alpha = sourcePixel[3];
+#endif
if (!alpha || alpha == 255) {
+#if CPU(BIG_ENDIAN)
+ convertSinglePixelPremultipliedToPremultiplied<pixelFormatConversion>(sourcePixelFormat, sourcePixel, destinationPixelFormat, destinationPixel);
+#else
convertSinglePixelPremultipliedToPremultiplied<pixelFormatConversion>(sourcePixel, destinationPixel);
+#endif
return;
}
+#if CPU(BIG_ENDIAN)
+ UNUSED_PARAM(destinationPixelFormat);
+ if constexpr (pixelFormatConversion == PixelFormatConversion::None) {
+ if (sourcePixelFormat == PixelFormat::ARGB8) {
+ destinationPixel[0] = alpha;
+ destinationPixel[1] = (sourcePixel[1] * 255) / alpha;
+ destinationPixel[2] = (sourcePixel[2] * 255) / alpha;
+ destinationPixel[3] = (sourcePixel[3] * 255) / alpha;
+ } else {
+ destinationPixel[0] = (sourcePixel[0] * 255) / alpha;
+ destinationPixel[1] = (sourcePixel[1] * 255) / alpha;
+ destinationPixel[2] = (sourcePixel[2] * 255) / alpha;
+ destinationPixel[3] = alpha;
+ }
+ } else {
+ if (sourcePixelFormat == PixelFormat::ARGB8) {
+ destinationPixel[0] = (sourcePixel[1] * 255) / alpha;
+ destinationPixel[1] = (sourcePixel[2] * 255) / alpha;
+ destinationPixel[2] = (sourcePixel[3] * 255) / alpha;
+ destinationPixel[3] = alpha;
+ } else {
+ destinationPixel[0] = alpha;
+ destinationPixel[1] = (sourcePixel[0] * 255) / alpha;
+ destinationPixel[2] = (sourcePixel[1] * 255) / alpha;
+ destinationPixel[3] = (sourcePixel[2] * 255) / alpha;
+ }
+ }
+#else
if constexpr (pixelFormatConversion == PixelFormatConversion::None) {
destinationPixel[0] = (sourcePixel[0] * 255) / alpha;
destinationPixel[1] = (sourcePixel[1] * 255) / alpha;
@@ -180,17 +245,58 @@ static void convertSinglePixelPremultipliedToUnpremultiplied(const uint8_t* sour
destinationPixel[2] = (sourcePixel[0] * 255) / alpha;
destinationPixel[3] = alpha;
}
+#endif
}
template<PixelFormatConversion pixelFormatConversion>
+#if CPU(BIG_ENDIAN)
+static void convertSinglePixelUnpremultipliedToPremultiplied(PixelFormat sourcePixelFormat, const uint8_t* sourcePixel, PixelFormat destinationPixelFormat, uint8_t* destinationPixel)
+#else
static void convertSinglePixelUnpremultipliedToPremultiplied(const uint8_t* sourcePixel, uint8_t* destinationPixel)
+#endif
{
+#if CPU(BIG_ENDIAN)
+ uint8_t alpha = sourcePixel[sourcePixelFormat == PixelFormat::ARGB8 ? 0 : 3];
+#else
uint8_t alpha = sourcePixel[3];
+#endif
if (!alpha || alpha == 255) {
+#if CPU(BIG_ENDIAN)
+ convertSinglePixelPremultipliedToPremultiplied<pixelFormatConversion>(sourcePixelFormat, sourcePixel, destinationPixelFormat, destinationPixel);
+#else
convertSinglePixelPremultipliedToPremultiplied<pixelFormatConversion>(sourcePixel, destinationPixel);
+#endif
return;
}
+#if CPU(BIG_ENDIAN)
+ UNUSED_PARAM(destinationPixelFormat);
+ if constexpr (pixelFormatConversion == PixelFormatConversion::None) {
+ if (sourcePixelFormat == PixelFormat::ARGB8) {
+ destinationPixel[0] = alpha;
+ destinationPixel[1] = (sourcePixel[1] * alpha + 254) / 255;
+ destinationPixel[2] = (sourcePixel[2] * alpha + 254) / 255;
+ destinationPixel[3] = (sourcePixel[3] * alpha + 254) / 255;
+ } else {
+ destinationPixel[0] = (sourcePixel[0] * alpha + 254) / 255;
+ destinationPixel[1] = (sourcePixel[1] * alpha + 254) / 255;
+ destinationPixel[2] = (sourcePixel[2] * alpha + 254) / 255;
+ destinationPixel[3] = alpha;
+ }
+ } else {
+ if (sourcePixelFormat == PixelFormat::ARGB8) {
+ destinationPixel[0] = (sourcePixel[1] * alpha + 254) / 255;
+ destinationPixel[1] = (sourcePixel[2] * alpha + 254) / 255;
+ destinationPixel[2] = (sourcePixel[3] * alpha + 254) / 255;
+ destinationPixel[3] = alpha;
+ } else {
+ destinationPixel[0] = alpha;
+ destinationPixel[1] = (sourcePixel[0] * alpha + 254) / 255;
+ destinationPixel[2] = (sourcePixel[1] * alpha + 254) / 255;
+ destinationPixel[3] = (sourcePixel[2] * alpha + 254) / 255;
+ }
+ }
+#else
if constexpr (pixelFormatConversion == PixelFormatConversion::None) {
destinationPixel[0] = (sourcePixel[0] * alpha + 254) / 255;
destinationPixel[1] = (sourcePixel[1] * alpha + 254) / 255;
@@ -203,23 +309,49 @@ static void convertSinglePixelUnpremultipliedToPremultiplied(const uint8_t* sour
destinationPixel[2] = (sourcePixel[0] * alpha + 254) / 255;
destinationPixel[3] = alpha;
}
+#endif
}
template<PixelFormatConversion pixelFormatConversion>
+#if CPU(BIG_ENDIAN)
+static void convertSinglePixelUnpremultipliedToUnpremultiplied(PixelFormat sourcePixelFormat, const uint8_t* sourcePixel, PixelFormat destinationPixelFormat, uint8_t* destinationPixel)
+#else
static void convertSinglePixelUnpremultipliedToUnpremultiplied(const uint8_t* sourcePixel, uint8_t* destinationPixel)
+#endif
{
if constexpr (pixelFormatConversion == PixelFormatConversion::None)
reinterpret_cast<uint32_t*>(destinationPixel)[0] = reinterpret_cast<const uint32_t*>(sourcePixel)[0];
else {
+#if CPU(BIG_ENDIAN)
+ UNUSED_PARAM(sourcePixelFormat);
+ // Swap pixel channels ARGB <-> RGBA.
+ if (destinationPixelFormat == PixelFormat::ARGB8) {
+ destinationPixel[0] = sourcePixel[3];
+ destinationPixel[1] = sourcePixel[0];
+ destinationPixel[2] = sourcePixel[1];
+ destinationPixel[3] = sourcePixel[2];
+ }
+ else {
+ destinationPixel[0] = sourcePixel[1];
+ destinationPixel[1] = sourcePixel[2];
+ destinationPixel[2] = sourcePixel[3];
+ destinationPixel[3] = sourcePixel[0];
+ }
+#else
// Swap pixel channels BGRA <-> RGBA.
destinationPixel[0] = sourcePixel[2];
destinationPixel[1] = sourcePixel[1];
destinationPixel[2] = sourcePixel[0];
destinationPixel[3] = sourcePixel[3];
+#endif
}
}
+#if CPU(BIG_ENDIAN)
+template<void (*convertFunctor)(PixelFormat, const uint8_t*, PixelFormat, uint8_t*)>
+#else
template<void (*convertFunctor)(const uint8_t*, uint8_t*)>
+#endif
static void convertImagePixelsUnaccelerated(const ConstPixelBufferConversionView& source, const PixelBufferConversionView& destination, const IntSize& destinationSize)
{
const uint8_t* sourceRows = source.rows;
@@ -228,7 +360,11 @@ static void convertImagePixelsUnaccelerated(const ConstPixelBufferConversionView
size_t bytesPerRow = destinationSize.width() * 4;
for (int y = 0; y < destinationSize.height(); ++y) {
for (size_t x = 0; x < bytesPerRow; x += 4)
+#if CPU(BIG_ENDIAN)
+ convertFunctor(source.format.pixelFormat, &sourceRows[x], destination.format.pixelFormat, &destinationRows[x]);
+#else
convertFunctor(&sourceRows[x], &destinationRows[x]);
+#endif
sourceRows += source.bytesPerRow;
destinationRows += destination.bytesPerRow;
}
diff --git a/Source/WebCore/platform/graphics/PixelFormat.h b/Source/WebCore/platform/graphics/PixelFormat.h
index 1ca711b8..4a7168f8 100644
--- a/Source/WebCore/platform/graphics/PixelFormat.h
+++ b/Source/WebCore/platform/graphics/PixelFormat.h
@@ -33,6 +33,9 @@ namespace WebCore {
enum class PixelFormat : uint8_t {
RGBA8,
BGRA8,
+#if CPU(BIG_ENDIAN)
+ ARGB8 = BGRA8, // BGRA will actually be ARGB on BIG_ENDIAN
+#endif
RGB10,
RGB10A8,
};

View file

@ -1,206 +0,0 @@
Source: Jacek Piszczek <jacek.piszczek@runbox.com>
https://tenfourfox.tenderapp.com/discussions/problems/7505-problems-uploading-to-facebook
Updated by @q66.
diff --git a/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h b/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h
index e76dada0..4de2e3ea 100644
--- a/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h
+++ b/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h
@@ -198,3 +198,9 @@
#else
#define OFFLINE_ASM_HAVE_FAST_TLS 0
#endif
+
+#if CPU(BIG_ENDIAN)
+#define OFFLINE_ASM_BIG_ENDIAN 1
+#else
+#define OFFLINE_ASM_BIG_ENDIAN 0
+#endif
diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm b/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
index 22716f81..4f9374ce 100644
--- a/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
@@ -1732,7 +1732,11 @@ llintOpWithMetadata(op_get_by_val, OpGetByVal, macro (size, get, dispatch, metad
.opGetByValNotDouble:
subi ArrayStorageShape, t2
- bia t2, SlowPutArrayStorageShape - ArrayStorageShape, .opGetByValNotIndexedStorage
+ if BIG_ENDIAN
+ bia t2, SlowPutArrayStorageShape - ArrayStorageShape, .opGetByValSlow
+ else
+ bia t2, SlowPutArrayStorageShape - ArrayStorageShape, .opGetByValNotIndexedStorage
+ end
biaeq t1, -sizeof IndexingHeader + IndexingHeader::u.lengths.vectorLength[t3], .opGetByValSlow
loadi ArrayStorage::m_vector + TagOffset[t3, t1, 8], t2
loadi ArrayStorage::m_vector + PayloadOffset[t3, t1, 8], t1
diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm b/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
index c453351d..e61529e5 100644
--- a/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
@@ -1867,7 +1867,11 @@ llintOpWithMetadata(op_get_by_val, OpGetByVal, macro (size, get, dispatch, metad
.opGetByValNotDouble:
subi ArrayStorageShape, t2
- bia t2, SlowPutArrayStorageShape - ArrayStorageShape, .opGetByValNotIndexedStorage
+ if BIG_ENDIAN
+ bia t2, SlowPutArrayStorageShape - ArrayStorageShape, .opGetByValSlow
+ else
+ bia t2, SlowPutArrayStorageShape - ArrayStorageShape, .opGetByValNotIndexedStorage
+ end
biaeq t1, -sizeof IndexingHeader + IndexingHeader::u.lengths.vectorLength[t3], .opGetByValSlow
get(m_dst, t0)
loadq ArrayStorage::m_vector[t3, t1, 8], t2
diff --git a/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h b/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h
index 86f48a02..1541b3a8 100644
--- a/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h
+++ b/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h
@@ -29,6 +29,7 @@
#include "ThrowScope.h"
#include "ToNativeFromValue.h"
#include <wtf/CheckedArithmetic.h>
+#include <wtf/FlipBytes.h>
namespace JSC {
@@ -147,7 +148,18 @@ public:
JSValue getIndexQuickly(size_t i) const
{
+#if CPU(BIG_ENDIAN)
+ switch (Adaptor::typeValue) {
+ case TypeFloat32:
+ case TypeFloat64:
+ return Adaptor::toJSValue(nullptr, getIndexQuicklyAsNativeValue(i));
+ default:
+ // typed array views are commonly expected to be little endian views of the underlying data
+ return Adaptor::toJSValue(nullptr, flipBytes(getIndexQuicklyAsNativeValue(i)));
+ }
+#else
return Adaptor::toJSValue(nullptr, getIndexQuicklyAsNativeValue(i));
+#endif
}
void setIndexQuicklyToNativeValue(size_t i, typename Adaptor::Type value)
@@ -159,7 +171,20 @@ public:
void setIndexQuickly(size_t i, JSValue value)
{
ASSERT(!value.isObject());
+#if CPU(BIG_ENDIAN)
+ switch (Adaptor::typeValue) {
+ case TypeFloat32:
+ case TypeFloat64:
+ setIndexQuicklyToNativeValue(i, toNativeFromValue<Adaptor>(value));
+ break;
+ default:
+ // typed array views are commonly expected to be little endian views of the underlying data
+ setIndexQuicklyToNativeValue(i, flipBytes(toNativeFromValue<Adaptor>(value)));
+ break;
+ }
+#else
setIndexQuicklyToNativeValue(i, toNativeFromValue<Adaptor>(value));
+#endif
}
bool setIndex(JSGlobalObject* globalObject, size_t i, JSValue jsValue)
@@ -173,18 +198,55 @@ public:
if (isDetached() || i >= m_length)
return false;
+#if CPU(BIG_ENDIAN)
+ switch (Adaptor::typeValue) {
+ case TypeFloat32:
+ case TypeFloat64:
+ setIndexQuicklyToNativeValue(i, value);
+ break;
+ default:
+ // typed array views are commonly expected to be little endian views of the underlying data
+ setIndexQuicklyToNativeValue(i, flipBytes(value));
+ break;
+ }
+#else
setIndexQuicklyToNativeValue(i, value);
+#endif
return true;
}
static ElementType toAdaptorNativeFromValue(JSGlobalObject* globalObject, JSValue jsValue)
{
+#if CPU(BIG_ENDIAN)
+ switch (Adaptor::typeValue) {
+ case TypeFloat32:
+ case TypeFloat64:
+ return toNativeFromValue<Adaptor>(globalObject, jsValue);
+ default:
+ // typed array views are commonly expected to be little endian views of the underlying data
+ return flipBytes(toNativeFromValue<Adaptor>(globalObject, jsValue));
+ }
+#else
return toNativeFromValue<Adaptor>(globalObject, jsValue);
+#endif
}
static std::optional<ElementType> toAdaptorNativeFromValueWithoutCoercion(JSValue jsValue)
{
- return toNativeFromValueWithoutCoercion<Adaptor>(jsValue);
+ auto opt = toNativeFromValueWithoutCoercion<Adaptor>(jsValue);
+#if CPU(BIG_ENDIAN)
+ switch (Adaptor::typeValue) {
+ case TypeFloat32:
+ case TypeFloat64:
+ break;
+ default:
+ // typed array views are commonly expected to be little endian views of the underlying data
+ if (!opt)
+ break;
+ return std::optional<ElementType>{flipBytes(*opt)};
+ }
+#endif
+ return opt;
}
void sort()
diff --git a/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h b/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h
index df0435f6..3017563c 100644
--- a/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h
+++ b/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h
@@ -385,9 +385,36 @@ ALWAYS_INLINE EncodedJSValue genericType
size_t searchLength = std::min<size_t>(length, updatedLength);
if constexpr (ViewClass::Adaptor::isFloat) {
- if (std::isnan(static_cast<double>(*targetOption))) {
+ double targetOptionLittleEndianAsDouble;
+#if CPU(BIG_ENDIAN)
+ switch (ViewClass::TypedArrayStorageType) {
+ case TypeFloat32:
+ case TypeFloat64:
+ targetOptionLittleEndianAsDouble = static_cast<double>(*targetOption);
+ default:
+ // typed array views are commonly expected to be little endian views of the underlying data
+ targetOptionLittleEndianAsDouble = static_cast<double>(flipBytes(*targetOption));
+ }
+#else
+ targetOptionLittleEndianAsDouble = static_cast<double>(*targetOption);
+#endif
+
+ if (std::isnan(targetOptionLittleEndianAsDouble)) {
for (; index < searchLength; ++index) {
- if (std::isnan(static_cast<double>(array[index])))
+ double arrayElementLittleEndianAsDouble;
+#if CPU(BIG_ENDIAN)
+ switch (ViewClass::TypedArrayStorageType) {
+ case TypeFloat32:
+ case TypeFloat64:
+ arrayElementLittleEndianAsDouble = static_cast<double>(array[index]);
+ default:
+ // typed array views are commonly expected to be little endian views of the underlying data
+ arrayElementLittleEndianAsDouble = static_cast<double>(flipBytes(array[index]));
+ }
+#else
+ arrayElementLittleEndianAsDouble = static_cast<double>(array[index]);
+#endif
+ if (std::isnan(arrayElementLittleEndianAsDouble))
return JSValue::encode(jsBoolean(true));
}
return JSValue::encode(jsBoolean(false));

View file

@ -0,0 +1,63 @@
From: Carlos Garcia Campos <cgarcia@igalia.com>
Subject: Disable DMABuf renderer for NVIDIA proprietary drivers
Bug: https://bugs.webkit.org/show_bug.cgi?id=262607
Bug-Debian: https://bugs.debian.org/1039720
Origin: https://github.com/WebKit/WebKit/pull/18614
Index: webkitgtk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp
===================================================================
--- webkitgtk.orig/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp
+++ webkitgtk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp
@@ -38,11 +38,13 @@
#include <WebCore/GLContext.h>
#include <WebCore/IntRect.h>
#include <WebCore/PlatformDisplay.h>
+#include <WebCore/PlatformDisplaySurfaceless.h>
#include <epoxy/egl.h>
#include <wtf/glib/GUniquePtr.h>
#if USE(GBM)
#include <WebCore/DMABufFormat.h>
+#include <WebCore/PlatformDisplayGBM.h>
#include <gbm.h>
static constexpr uint64_t s_dmabufInvalidModifier = uint64_t(WebCore::DMABufFormat::Modifier::Invalid);
#else
@@ -55,6 +57,29 @@ static constexpr uint64_t s_dmabufInvali
namespace WebKit {
+static bool isNVIDIA()
+{
+ const char* forceDMABuf = getenv("WEBKIT_FORCE_DMABUF_RENDERER");
+ if (forceDMABuf && strcmp(forceDMABuf, "0"))
+ return false;
+
+ std::unique_ptr<WebCore::PlatformDisplay> platformDisplay;
+#if USE(GBM)
+ const char* disableGBM = getenv("WEBKIT_DMABUF_RENDERER_DISABLE_GBM");
+ if (!disableGBM || !strcmp(disableGBM, "0")) {
+ if (auto* device = WebCore::PlatformDisplay::sharedDisplay().gbmDevice())
+ platformDisplay = WebCore::PlatformDisplayGBM::create(device);
+ }
+#endif
+ if (!platformDisplay)
+ platformDisplay = WebCore::PlatformDisplaySurfaceless::create();
+
+ WebCore::GLContext::ScopedGLContext glContext(WebCore::GLContext::createOffscreen(platformDisplay ? *platformDisplay : WebCore::PlatformDisplay::sharedDisplay()));
+ if (strstr(reinterpret_cast<const char*>(glGetString(GL_VENDOR)), "NVIDIA"))
+ return true;
+ return false;
+}
+
OptionSet<DMABufRendererBufferMode> AcceleratedBackingStoreDMABuf::rendererBufferMode()
{
static OptionSet<DMABufRendererBufferMode> mode;
@@ -70,6 +95,9 @@ OptionSet<DMABufRendererBufferMode> Acce
return;
}
+ if (isNVIDIA())
+ return;
+
mode.add(DMABufRendererBufferMode::SharedMemory);
const auto& eglExtensions = WebCore::PlatformDisplay::sharedDisplay().eglExtensions();

View file

@ -0,0 +1,16 @@
From: Alberto Garcia <berto@igalia.com>
Subject: Fix FTBFS in i386
Bug: https://bugs.webkit.org/show_bug.cgi?id=268739
Index: webkitgtk/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp
===================================================================
--- webkitgtk.orig/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp
+++ webkitgtk/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp
@@ -336,8 +336,6 @@ JSValue CLoop::execute(OpcodeID entryOpc
UNUSED_VARIABLE(t2);
UNUSED_VARIABLE(t3);
UNUSED_VARIABLE(t5);
- UNUSED_VARIABLE(t6);
- UNUSED_VARIABLE(t7);
struct StackPointerScope {
StackPointerScope(CLoopStack& stack)

View file

@ -1,28 +0,0 @@
diff --git a/Source/JavaScriptCore/offlineasm/riscv64.rb b/Source/JavaScriptCore/offlineasm/riscv64.rb
index 81f356d04ae1..4abb1761509d 100644
--- a/Source/JavaScriptCore/offlineasm/riscv64.rb
+++ b/Source/JavaScriptCore/offlineasm/riscv64.rb
@@ -1523,7 +1523,8 @@ def riscv64GenerateWASMPlaceholders(list)
if node.is_a? Instruction
case node.opcode
when "loadlinkacqb", "loadlinkacqh", "loadlinkacqi", "loadlinkacqq",
- "storecondrelb", "storecondrelh", "storecondreli", "storecondrelq"
+ "storecondrelb", "storecondrelh", "storecondreli", "storecondrelq",
+ "loadv", "storev"
newList << Instruction.new(node.codeOrigin, "rv_ebreak", [], "WebAssembly placeholder for opcode #{node.opcode}")
else
newList << node
diff --git a/Source/WTF/wtf/PlatformEnable.h b/Source/WTF/wtf/PlatformEnable.h
index e30a3d8ce077..937fdd447f92 100644
--- a/Source/WTF/wtf/PlatformEnable.h
+++ b/Source/WTF/wtf/PlatformEnable.h
@@ -616,7 +616,7 @@
#undef ENABLE_WEBASSEMBLY
#define ENABLE_WEBASSEMBLY 1
#undef ENABLE_WEBASSEMBLY_B3JIT
-#define ENABLE_WEBASSEMBLY_B3JIT 0
+#define ENABLE_WEBASSEMBLY_B3JIT 1
#undef ENABLE_WEBASSEMBLY_BBQJIT
#define ENABLE_WEBASSEMBLY_BBQJIT 0
#endif

View file

@ -1,23 +0,0 @@
Source: https://bugs.webkit.org/show_bug.cgi?id=254286
Usage initial-exec TLS is incompatible with dlopen() on musl.
See also: https://gitlab.freedesktop.org/mesa/mesa/-/commit/8570a2a280587a1e43ac11ad46ad62dfdd6c7b39
.../platform/graphics/gbm/GraphicsContextGLANGLELinux.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/Source/WebCore/platform/graphics/gbm/GraphicsContextGLANGLELinux.cpp
+++ a/Source/WebCore/platform/graphics/gbm/GraphicsContextGLANGLELinux.cpp
@@ -108,7 +108,11 @@ RefPtr<PixelBuffer> GraphicsContextGLANGLE::readCompositedResults()
bool GraphicsContextGLANGLE::makeContextCurrent()
{
- static thread_local TLS_MODEL_INITIAL_EXEC GraphicsContextGLANGLE* s_currentContext { nullptr };
+ #ifdef __GLIBC__
+ static thread_local TLS_MODEL_INITIAL_EXEC GraphicsContextGLANGLE* s_currentContext { nullptr };
+ #else
+ static thread_local GraphicsContextGLANGLE* s_currentContext { nullptr };
+ #endif
if (s_currentContext == this)
return true;
--

View file

@ -1,26 +0,0 @@
From ef8f9a0b61509401e64c717c7cc6f025f1b49300 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Mon, 4 Jan 2021 19:12:25 +0100
Subject: [PATCH] portable little endian check
---
Source/ThirdParty/xdgmime/src/xdgmimemagic.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git Source/ThirdParty/xdgmime/src/xdgmimemagic.c Source/ThirdParty/xdgmime/src/xdgmimemagic.c
index 3a62b9d..9bd4e1d 100644
--- a/Source/ThirdParty/xdgmime/src/xdgmimemagic.c
+++ b/Source/ThirdParty/xdgmime/src/xdgmimemagic.c
@@ -485,8 +485,7 @@ _xdg_mime_magic_parse_magic_line (FILE *magic_file,
_xdg_mime_magic_matchlet_free (matchlet);
return XDG_MIME_MAGIC_ERROR;
}
- /* FIXME: need to get this defined in a <config.h> style file */
-#if LITTLE_ENDIAN
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
for (i = 0; i < matchlet->value_length; i = i + matchlet->word_size)
{
if (matchlet->word_size == 2)
--
2.30.0

View file

@ -0,0 +1,28 @@
From: Alberto Garcia <berto@igalia.com>
Description: Enable THREADS_PREFER_PTHREAD_FLAG
This fixes a FTBFS in riscv64
Bug: https://bugs.webkit.org/show_bug.cgi?id=182622
Bug-Debian: https://bugs.debian.org/895969
Origin: https://trac.webkit.org/changeset/231843
Index: webkitgtk/Source/cmake/OptionsGTK.cmake
===================================================================
--- webkitgtk.orig/Source/cmake/OptionsGTK.cmake
+++ webkitgtk/Source/cmake/OptionsGTK.cmake
@@ -13,6 +13,8 @@ endif ()
set(USER_AGENT_BRANDING "" CACHE STRING "Branding to add to user agent string")
+set(THREADS_PREFER_PTHREAD_FLAG ON)
+
find_package(Cairo 1.16.0 REQUIRED)
find_package(Fontconfig 2.13.0 REQUIRED)
find_package(Freetype 2.9.0 REQUIRED)
Index: webkitgtk/Source/cmake/OptionsJSCOnly.cmake
===================================================================
--- webkitgtk.orig/Source/cmake/OptionsJSCOnly.cmake
+++ webkitgtk/Source/cmake/OptionsJSCOnly.cmake
@@ -1,3 +1,4 @@
+set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
if (MSVC)

View file

@ -5,7 +5,7 @@ Date: Wed Jan 5 17:50:07 2022 +0100
reproducible build
diff --git a/Source/WebCore/bindings/scripts/CodeGenerator.pm b/Source/WebCore/bindings/scripts/CodeGenerator.pm
index a604bfd3..c267b402 100644
index 1e95784b..eb642a52 100644
--- a/Source/WebCore/bindings/scripts/CodeGenerator.pm
+++ b/Source/WebCore/bindings/scripts/CodeGenerator.pm
@@ -324,7 +324,7 @@ sub MergeExtendedAttributesFromSupplemental
@ -18,7 +18,7 @@ index a604bfd3..c267b402 100644
for my $contextAllowed (@{$idlAttributes->{$extendedAttributeName}->{"contextsAllowed"}}) {
if ($contextAllowed eq $context) {
diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
index be5a5d51..becb2b2f 100644
index 275fce91..8c1534be 100644
--- a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
+++ b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
@@ -3217,7 +3217,7 @@ sub GenerateHeader
@ -30,7 +30,7 @@ index be5a5d51..becb2b2f 100644
push(@headerContent, " | " . $structureFlag);
}
push(@headerContent, ";\n");
@@ -7433,7 +7433,7 @@ sub WriteData
@@ -7515,7 +7515,7 @@ sub WriteData
my @includes = ();
my %implIncludeConditions = ();
@ -39,7 +39,7 @@ index be5a5d51..becb2b2f 100644
next if $headerIncludes{$include};
next if $headerTrailingIncludes{$include};
@@ -7473,7 +7473,7 @@ sub WriteData
@@ -7555,7 +7555,7 @@ sub WriteData
$contents = join "", @headerContentHeader;
@includes = ();
@ -48,7 +48,7 @@ index be5a5d51..becb2b2f 100644
$include = "\"$include\"" unless $include =~ /^["<]/; # "
$include = SubstituteHeader($include);
push @includes, $include;
@@ -7487,7 +7487,7 @@ sub WriteData
@@ -7569,7 +7569,7 @@ sub WriteData
$contents .= join "", @headerContent;
@includes = ();
@ -57,7 +57,7 @@ index be5a5d51..becb2b2f 100644
$include = "\"$include\"" unless $include =~ /^["<]/; # "
push @includes, $include;
}
@@ -7560,7 +7560,7 @@ sub GeneratePrototypeDeclaration
@@ -7642,7 +7642,7 @@ sub GeneratePrototypeDeclaration
if (%structureFlags) {
push(@$outputArray, "public:\n");
push(@$outputArray, " static constexpr unsigned StructureFlags = Base::StructureFlags");
@ -66,16 +66,3 @@ index be5a5d51..becb2b2f 100644
push(@$outputArray, " | " . $structureFlag);
}
push(@$outputArray, ";\n");
diff --git a/Source/cmake/tools/scripts/version-stamp.pl b/Source/cmake/tools/scripts/version-stamp.pl
index 888a4502..57ab9b16 100644
--- a/Source/cmake/tools/scripts/version-stamp.pl
+++ b/Source/cmake/tools/scripts/version-stamp.pl
@@ -75,7 +75,7 @@ my $VERSION_FILE = File::Spec->catfile(File::Spec->canonpath($intdir), 'include'
open(VERSION_INFO, '<', $VERSION_FILE) or die "Unable to open $VERSION_FILE: $!\n";
while (my $line = <VERSION_INFO>) {
- foreach my $componentKey (keys %components) {
+ foreach my $componentKey (sort keys %components) {
if ($line !~ m/$componentKey/) {
next;
}

View file

@ -1,10 +1,10 @@
# Template file for 'webkit2gtk'
pkgname=webkit2gtk
version=2.40.0
revision=4
version=2.42.5
revision=1
build_style=cmake
build_helper="gir"
configure_args="-DPORT=GTK -DUSE_LD_GOLD=OFF
configure_args="-DPORT=GTK
-DCMAKE_LINKER=${XBPS_CROSS_TRIPLET}-gcc -DCMAKE_SKIP_RPATH=ON
-DENABLE_JOURNALD_LOG=OFF -DUSE_WOFF2=ON -DUSE_WPE_RENDERER=ON
-DENABLE_MINIBROWSER=$(vopt_if minibrowser ON OFF)
@ -15,7 +15,8 @@ configure_args="-DPORT=GTK -DUSE_LD_GOLD=OFF
-DENABLE_WAYLAND_TARGET=$(vopt_if wayland ON OFF)
-DENABLE_X11_TARGET=$(vopt_if x11 ON OFF)
-DENABLE_SAMPLING_PROFILER=$(vopt_if sampling_profiler ON OFF)
-DENABLE_BUBBLEWRAP_SANDBOX=$(vopt_if bubblewrap ON OFF)"
-DENABLE_BUBBLEWRAP_SANDBOX=$(vopt_if bubblewrap ON OFF)
-DUSE_JPEGXL=OFF"
# Don't remove which from hostmakedepends
# Otherwise, they invoke /usr/bin/ccache /usr/lib/ccache/bin/$CC
hostmakedepends="perl python3 pkg-config gperf flex ruby gettext glib-devel
@ -36,7 +37,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
license="LGPL-2.1-or-later, BSD-2-Clause"
homepage="https://webkitgtk.org/"
distfiles="https://webkitgtk.org/releases/webkitgtk-${version}.tar.xz"
checksum=a4607ea1bf89669e89b1cb2c63faaec513f93de09b6ae60cc71d6a8aab7ab393
checksum=b64278c1f20b8cfdbfb5ff573c37d871aba74a1db26d9b39f74e8953fe61e749
make_check=no # TODO
replaces="webkit2gtk-common>0"
@ -69,6 +70,8 @@ if [ "$build_option_bubblewrap" ]; then
hostmakedepends+=" bubblewrap xdg-dbus-proxy"
makedepends+=" libseccomp-devel"
depends+=" bubblewrap xdg-dbus-proxy"
configure_args+=" -DBWRAP_EXECUTABLE=/usr/bin/bwrap
-DDBUS_PROXY_EXECUTABLE=/usr/bin/xdg-dbus-proxy"
fi
if [ "$build_option_lto" -a -z "$build_option_clang" ]; then
@ -122,6 +125,8 @@ if [ "$build_option_sampling_profiler" -a -z "$build_option_jit" ]; then
broken="sampling_profiler requires JIT"
fi
_depends="${depends}"
pre_configure() {
if [ "$build_option_clang" ]; then
export CC=clang
@ -147,7 +152,7 @@ pre_configure() {
}
post_configure() {
mkdir -p webkit2gtk-40 webkit2gtk-50
mkdir -p webkit2gtk-40 webkit2gtk-60
(
cd webkit2gtk-40
configure_args="${configure_args} -DUSE_SOUP2=ON -DENABLE_WEBDRIVER=OFF" \
@ -155,7 +160,7 @@ post_configure() {
)
(
cd webkit2gtk-50
cd webkit2gtk-60
configure_args="${configure_args} -DUSE_GTK4=ON -DENABLE_WEBDRIVER=OFF" \
do_configure
)
@ -163,12 +168,12 @@ post_configure() {
post_build() {
(cd webkit2gtk-40 && NINJA_STATUS="[2/3][%f/%t] " do_build)
(cd webkit2gtk-50 && NINJA_STATUS="[3/3][%f/%t] " do_build)
(cd webkit2gtk-60 && NINJA_STATUS="[3/3][%f/%t] " do_build)
}
post_install() {
(cd webkit2gtk-40 && do_install)
(cd webkit2gtk-50 && do_install)
(cd webkit2gtk-60 && do_install)
vlicense Source/WebCore/LICENSE-APPLE
vlicense Source/WebCore/LICENSE-LGPL-2.1
@ -192,7 +197,7 @@ webkit2gtk-devel_package() {
}
libwebkit2gtk41_package() {
depends="${depends}"
depends="${_depends}"
short_desc="GTK+3 port of the WebKit browser engine (soup3)"
pkg_install() {
vmove usr/bin/WebKitWebDriver
@ -228,7 +233,7 @@ libwebkit2gtk41-devel_package() {
}
libwebkitgtk60_package() {
depends="${depends}"
depends="${_depends}"
short_desc="GTK4 port of the WebKit browser engine"
pkg_install() {
vmove usr/libexec/webkitgtk-6.0