Title: [276866] trunk/Source/WebCore
Revision
276866
Author
[email protected]
Date
2021-04-30 17:43:06 -0700 (Fri, 30 Apr 2021)

Log Message

Avoid a crash in PlatformCALayer::drawLayerContents when called with a display list recording GraphicsContext.
https://bugs.webkit.org/show_bug.cgi?id=225224
<rdar://76359027>

Reviewed by Simon Fraser.

setIsCALayerContext and setIsAcceleratedContext both assume (and assert)
that the GraphicsContext has a platform context directly in m_data,
but m_data is null when the GraphicsContext a display list recording
context (which is the case when GPUP DOM rendering is enabled).  These
calls are unnecessary when not working with a CG-backed GraphicsContext,
so just skip them in this case.

* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayer::drawLayerContents):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (276865 => 276866)


--- trunk/Source/WebCore/ChangeLog	2021-05-01 00:05:36 UTC (rev 276865)
+++ trunk/Source/WebCore/ChangeLog	2021-05-01 00:43:06 UTC (rev 276866)
@@ -1,3 +1,21 @@
+2021-04-30  Cameron McCormack  <[email protected]>
+
+        Avoid a crash in PlatformCALayer::drawLayerContents when called with a display list recording GraphicsContext.
+        https://bugs.webkit.org/show_bug.cgi?id=225224
+        <rdar://76359027>
+
+        Reviewed by Simon Fraser.
+
+        setIsCALayerContext and setIsAcceleratedContext both assume (and assert)
+        that the GraphicsContext has a platform context directly in m_data,
+        but m_data is null when the GraphicsContext a display list recording
+        context (which is the case when GPUP DOM rendering is enabled).  These
+        calls are unnecessary when not working with a CG-backed GraphicsContext,
+        so just skip them in this case.
+
+        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
+        (WebCore::PlatformCALayer::drawLayerContents):
+
 2021-04-30  Wenson Hsieh  <[email protected]>
 
         [iOS] Add a heuristic to determine whether a synthetic click triggered any meaningful changes

Modified: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm (276865 => 276866)


--- trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm	2021-05-01 00:05:36 UTC (rev 276865)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm	2021-05-01 00:43:06 UTC (rev 276866)
@@ -1205,12 +1205,11 @@
             fontAntialiasingState.emplace(context, !![platformCALayer->platformLayer() isOpaque]);
             fontAntialiasingState->setup([WAKWindow hasLandscapeOrientation]);
 #endif
-        }
-        
-        {
             graphicsContext.setIsCALayerContext(true);
             graphicsContext.setIsAcceleratedContext(platformCALayer->acceleratesDrawing());
+        }
 
+        {
             if (!layerContents->platformCALayerContentsOpaque() && !platformCALayer->supportsSubpixelAntialiasedText() && FontCascade::isSubpixelAntialiasingAvailable()) {
                 // Turn off font smoothing to improve the appearance of text rendered onto a transparent background.
                 graphicsContext.setShouldSmoothFonts(false);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to