|
| 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 | + } |
0 commit comments