Title: [279462] trunk/Source/WebCore
Revision
279462
Author
carlo...@webkit.org
Date
2021-07-01 04:20:43 -0700 (Thu, 01 Jul 2021)

Log Message

REGRESSION(r278062): [Nicosia] Threaded rendering is broken since r278062
https://bugs.webkit.org/show_bug.cgi?id=227578

Reviewed by Žan Doberšek.

Since r278062 NicosiaCairoOperationRecorder is a GraphicsContext class, so we need to bring back things
previously done by the base class and chain up to base class save/restore and being/end transparency.

* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
(Nicosia::CairoOperationRecorder::fillPath):
(Nicosia::CairoOperationRecorder::strokePath):
(Nicosia::CairoOperationRecorder::drawLine):
(Nicosia::CairoOperationRecorder::drawLinesForText):
(Nicosia::CairoOperationRecorder::drawFocusRing):
(Nicosia::CairoOperationRecorder::save):
(Nicosia::CairoOperationRecorder::restore):
(Nicosia::CairoOperationRecorder::beginTransparencyLayer):
(Nicosia::CairoOperationRecorder::endTransparencyLayer):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (279461 => 279462)


--- trunk/Source/WebCore/ChangeLog	2021-07-01 10:37:39 UTC (rev 279461)
+++ trunk/Source/WebCore/ChangeLog	2021-07-01 11:20:43 UTC (rev 279462)
@@ -1,3 +1,24 @@
+2021-07-01  Carlos Garcia Campos  <cgar...@igalia.com>
+
+        REGRESSION(r278062): [Nicosia] Threaded rendering is broken since r278062
+        https://bugs.webkit.org/show_bug.cgi?id=227578
+
+        Reviewed by Žan Doberšek.
+
+        Since r278062 NicosiaCairoOperationRecorder is a GraphicsContext class, so we need to bring back things
+        previously done by the base class and chain up to base class save/restore and being/end transparency.
+
+        * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
+        (Nicosia::CairoOperationRecorder::fillPath):
+        (Nicosia::CairoOperationRecorder::strokePath):
+        (Nicosia::CairoOperationRecorder::drawLine):
+        (Nicosia::CairoOperationRecorder::drawLinesForText):
+        (Nicosia::CairoOperationRecorder::drawFocusRing):
+        (Nicosia::CairoOperationRecorder::save):
+        (Nicosia::CairoOperationRecorder::restore):
+        (Nicosia::CairoOperationRecorder::beginTransparencyLayer):
+        (Nicosia::CairoOperationRecorder::endTransparencyLayer):
+
 2021-07-01  Youenn Fablet  <you...@apple.com>
 
         [Cocoa] Migrate WebRTC UDP socket handling to NW API

Modified: trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp (279461 => 279462)


--- trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp	2021-07-01 10:37:39 UTC (rev 279461)
+++ trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp	2021-07-01 11:20:43 UTC (rev 279462)
@@ -37,6 +37,10 @@
 #include <type_traits>
 #include <wtf/text/TextStream.h>
 
+#if PLATFORM(WPE) || PLATFORM(GTK)
+#include "ThemeAdwaita.h"
+#endif
+
 namespace Nicosia {
 using namespace WebCore;
 
@@ -381,6 +385,9 @@
         }
     };
 
+    if (path.isEmpty())
+        return;
+
     auto& state = this->state();
     append(createCommand<FillPath>(path, Cairo::FillSource(state), Cairo::ShadowState(state)));
 }
@@ -443,6 +450,9 @@
         }
     };
 
+    if (path.isEmpty())
+        return;
+
     auto& state = this->state();
     append(createCommand<StrokePath>(path, Cairo::StrokeSource(state), Cairo::ShadowState(state)));
 }
@@ -608,6 +618,9 @@
         }
     };
 
+    if (strokeStyle() == NoStroke)
+        return;
+
     auto& state = this->state();
     append(createCommand<DrawLine>(point1, point2, state.strokeStyle, state.strokeColor, state.strokeThickness, state.shouldAntialias));
 }
@@ -628,6 +641,9 @@
         }
     };
 
+    if (widths.isEmpty())
+        return;
+
     auto& state = this->state();
     append(createCommand<DrawLinesForText>(point, thickness, widths, printing, doubleUnderlines, state.strokeColor));
 }
@@ -673,6 +689,10 @@
 
 void CairoOperationRecorder::drawFocusRing(const Path& path, float width, float offset, const Color& color)
 {
+#if PLATFORM(WPE) || PLATFORM(GTK)
+    ThemeAdwaita::paintFocus(*this, path, color);
+    UNUSED_PARAM(width);
+#else
     struct DrawFocusRing final : PaintingOperation, OperationData<Path, float, Color> {
         virtual ~DrawFocusRing() = default;
 
@@ -687,12 +707,17 @@
         }
     };
 
+    append(createCommand<DrawFocusRing>(path, width, color));
+#endif
     UNUSED_PARAM(offset);
-    append(createCommand<DrawFocusRing>(path, width, color));
 }
 
 void CairoOperationRecorder::drawFocusRing(const Vector<FloatRect>& rects, float width, float offset, const Color& color)
 {
+#if PLATFORM(WPE) || PLATFORM(GTK)
+    ThemeAdwaita::paintFocus(*this, rects, color);
+    UNUSED_PARAM(width);
+#else
     struct DrawFocusRing final : PaintingOperation, OperationData<Vector<FloatRect>, float, Color> {
         virtual ~DrawFocusRing() = default;
 
@@ -707,8 +732,9 @@
         }
     };
 
+    append(createCommand<DrawFocusRing>(rects, width, color));
+#endif
     UNUSED_PARAM(offset);
-    append(createCommand<DrawFocusRing>(rects, width, color));
 }
 
 void CairoOperationRecorder::save()
@@ -727,6 +753,8 @@
         }
     };
 
+    GraphicsContext::save();
+
     append(createCommand<Save>());
 
     m_stateStack.append(m_stateStack.last());
@@ -734,9 +762,6 @@
 
 void CairoOperationRecorder::restore()
 {
-    if (m_stateStack.isEmpty())
-        return;
-
     struct Restore final : PaintingOperation, OperationData<> {
         virtual ~Restore() = default;
 
@@ -751,6 +776,14 @@
         }
     };
 
+    if (!stackSize())
+        return;
+
+    GraphicsContext::restore();
+
+    if (m_stateStack.isEmpty())
+        return;
+
     append(createCommand<Restore>());
 
     m_stateStack.removeLast();
@@ -917,6 +950,8 @@
         }
     };
 
+    GraphicsContext::beginTransparencyLayer(opacity);
+
     append(createCommand<BeginTransparencyLayer>(opacity));
 }
 
@@ -936,6 +971,8 @@
         }
     };
 
+    GraphicsContext::endTransparencyLayer();
+
     append(createCommand<EndTransparencyLayer>());
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to