Skip to content

Commit cef349e

Browse files
committed
wpewebkit: Add a patch to fix LBSE blurriness
1 parent 84523e3 commit cef349e

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
Fix blurry image when LBSE is on
2+
3+
Upstream-Status: Inappropriate [meta-wpe-image specific]
4+
5+
diff --git a/Source/WebCore/platform/graphics/GraphicsLayer.h b/Source/WebCore/platform/graphics/GraphicsLayer.h
6+
index bd13b594389b..55a82d13e218 100644
7+
--- a/Source/WebCore/platform/graphics/GraphicsLayer.h
8+
+++ b/Source/WebCore/platform/graphics/GraphicsLayer.h
9+
@@ -623,6 +623,7 @@ public:
10+
11+
virtual void deviceOrPageScaleFactorChanged() { }
12+
virtual void setShouldUpdateRootRelativeScaleFactor(bool) { }
13+
+ virtual void setShouldDoubleScaleFactor(bool) { }
14+
15+
WEBCORE_EXPORT void noteDeviceOrPageScaleFactorChangedIncludingDescendants();
16+
17+
diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
18+
index a1e13176ee67..c9a2f2abbb16 100644
19+
--- a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
20+
+++ b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
21+
@@ -1088,7 +1088,10 @@ void CoordinatedGraphicsLayer::deviceOrPageScaleFactorChanged()
22+
23+
float CoordinatedGraphicsLayer::effectiveContentsScale()
24+
{
25+
- return selfOrAncestorHaveNonAffineTransforms() ? 1 : deviceScaleFactor() * pageScaleFactor();
26+
+ float contentsScale = selfOrAncestorHaveNonAffineTransforms() ? 1 : deviceScaleFactor() * pageScaleFactor();
27+
+ if (m_shouldDoubleScaleFactor)
28+
+ return contentsScale * 2;
29+
+ return contentsScale;
30+
}
31+
32+
IntRect CoordinatedGraphicsLayer::transformedVisibleRect()
33+
diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h
34+
index 8d8fdb71d6eb..6a36bd8beb46 100644
35+
--- a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h
36+
+++ b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h
37+
@@ -110,6 +110,7 @@ public:
38+
void setNeedsDisplayInRect(const FloatRect&, ShouldClipToLayer = ClipToLayer) override;
39+
void setContentsNeedsDisplay() override;
40+
void deviceOrPageScaleFactorChanged() override;
41+
+ void setShouldDoubleScaleFactor(bool shouldDoubleScaleFactor) override { m_shouldDoubleScaleFactor = shouldDoubleScaleFactor; }
42+
void flushCompositingState(const FloatRect&) override;
43+
void flushCompositingStateForThisLayerOnly() override;
44+
bool setFilters(const FilterOperations&) override;
45+
@@ -224,6 +225,7 @@ private:
46+
bool m_pendingContentsScaleAdjustment : 1;
47+
bool m_pendingVisibleRectAdjustment : 1;
48+
bool m_shouldUpdatePlatformLayer : 1;
49+
+ bool m_shouldDoubleScaleFactor : 1 { false };
50+
51+
CoordinatedGraphicsLayerClient* m_coordinator;
52+
53+
diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp
54+
index 054f14b16dcd..d3fd48368048 100644
55+
--- a/Source/WebCore/rendering/RenderLayerBacking.cpp
56+
+++ b/Source/WebCore/rendering/RenderLayerBacking.cpp
57+
@@ -364,6 +364,11 @@ Ref<GraphicsLayer> RenderLayerBacking::createGraphicsLayer(const String& name, G
58+
if (renderer().isSVGLayerAwareRenderer() && renderer().document().settings().layerBasedSVGEngineEnabled())
59+
graphicsLayer->setShouldUpdateRootRelativeScaleFactor(true);
60+
#endif
61+
+
62+
+#if ENABLE(LAYER_BASED_SVG_ENGINE)
63+
+ if (renderer().isSVGLayerAwareRenderer() && renderer().document().settings().layerBasedSVGEngineEnabled())
64+
+ graphicsLayer->setShouldDoubleScaleFactor(true);
65+
+#endif
66+
67+
return graphicsLayer;
68+
}

recipes-browser/wpewebkit/wpewebkit_2.42.%.bbappend

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
22

33
SRC_URI += "file://0001-Add-LAYER_BASED_SVG_ENGINE-envvar_v2.42.patch \
44
file://0001-LBSE-Correct-animation-boundaries-avoiding-excessive.patch \
5+
file://Fix-LBSE-blurriness.patch \
56
"
67

78
SRC_URI:class-devupstream = "git://github.com/WebKit/webkit.git;protocol=https;branch=main"

0 commit comments

Comments
 (0)