Title: [264099] releases/WebKitGTK/webkit-2.28/Source/WebCore
Revision
264099
Author
[email protected]
Date
2020-07-08 07:16:52 -0700 (Wed, 08 Jul 2020)

Log Message

Merge r262194 - [WPE] REGRESSION(r253675) Crash when using threaded rendering
https://bugs.webkit.org/show_bug.cgi?id=212404

Reviewed by Carlos Garcia Campos.

Check whether the GraphicsContext has a PlatformGraphicsContext before trying to paint with
it. If there's no PlatformGraphicsContext, paint using the GraphicsContext methods instead.

* platform/graphics/cairo/ImageBufferCairoBackend.cpp:
(WebCore::ImageBufferCairoBackend::draw):
(WebCore::ImageBufferCairoBackend::drawPattern):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.28/Source/WebCore/ChangeLog (264098 => 264099)


--- releases/WebKitGTK/webkit-2.28/Source/WebCore/ChangeLog	2020-07-08 12:38:59 UTC (rev 264098)
+++ releases/WebKitGTK/webkit-2.28/Source/WebCore/ChangeLog	2020-07-08 14:16:52 UTC (rev 264099)
@@ -1,3 +1,17 @@
+2020-05-27  Miguel Gomez  <[email protected]>
+
+        [WPE] REGRESSION(r253675) Crash when using threaded rendering
+        https://bugs.webkit.org/show_bug.cgi?id=212404
+
+        Reviewed by Carlos Garcia Campos.
+
+        Check whether the GraphicsContext has a PlatformGraphicsContext before trying to paint with
+        it. If there's no PlatformGraphicsContext, paint using the GraphicsContext methods instead.
+
+        * platform/graphics/cairo/ImageBufferCairoBackend.cpp:
+        (WebCore::ImageBufferCairoBackend::draw):
+        (WebCore::ImageBufferCairoBackend::drawPattern):
+
 2020-03-27  Simon Fraser  <[email protected]>
 
         Hovering over countries at https://covidinc.io/ shows bizarre rendering artifacts

Modified: releases/WebKitGTK/webkit-2.28/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp (264098 => 264099)


--- releases/WebKitGTK/webkit-2.28/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp	2020-07-08 12:38:59 UTC (rev 264098)
+++ releases/WebKitGTK/webkit-2.28/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp	2020-07-08 14:16:52 UTC (rev 264099)
@@ -362,6 +362,14 @@
     if (destinationContext.paintingDisabled())
         return;
 
+    if (!destinationContext.hasPlatformContext()) {
+        // If there's no platformContext, we're using threaded rendering, and all the operations must be done
+        // through the GraphicsContext.
+        auto image = copyImage(&destinationContext == &context() ? CopyBackingStore : DontCopyBackingStore);
+        destinationContext.drawImage(*image, destRect, srcRect, options);
+        return;
+    }
+
     if (auto surface = nativeImage()) {
         if (&destinationContext == &context())
             surface = cairoSurfaceCopy(surface.get());
@@ -373,11 +381,19 @@
 }
 
 void ImageBuffer::drawPattern(GraphicsContext& context, const FloatRect& destRect, const FloatRect& srcRect, const AffineTransform& patternTransform,
-    const FloatPoint& phase, const FloatSize&, const ImagePaintingOptions& options)
+    const FloatPoint& phase, const FloatSize& spacing, const ImagePaintingOptions& options)
 {
     if (context.paintingDisabled())
         return;
 
+    if (!context.hasPlatformContext()) {
+        // If there's no platformContext, we're using threaded rendering, and all the operations must be done
+        // through the GraphicsContext.
+        auto image = copyImage(DontCopyBackingStore);
+        image->drawPattern(context, destRect, srcRect, patternTransform, phase, spacing, options);
+        return;
+    }
+
     if (auto surface = nativeImage())
         Cairo::drawPattern(*context.platformContext(), surface.get(), m_size, destRect, srcRect, patternTransform, phase, options);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to