Title: [287951] trunk/Source/WebKitLegacy/mac
Revision
287951
Author
commit-qu...@webkit.org
Date
2022-01-12 14:37:24 -0800 (Wed, 12 Jan 2022)

Log Message

_paintBehaviorForDestinationContext should consider kCGContextTypeDisplayList type contexts as potentially being snapshots
https://bugs.webkit.org/show_bug.cgi?id=234626
<rdar://83501315>

Patch by Matt Woodrow <mattwood...@apple.com> on 2022-01-12
Reviewed by Simon Fraser.

_paintBehaviorForDestinationContext currently always returns `Normal` for contexts that aren't a bitmap context.
AppKit now provides a context that is of type kCGContextTypeDisplayList, and we want to still potentially consider it a
snapshot paint (if the other conditions below are met). This ensure images are sync decoded for consumers that just
want a single paint.

* WebView/WebFrame.mm:
(-[WebFrame _paintBehaviorForDestinationContext:]):

Modified Paths

Diff

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (287950 => 287951)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2022-01-12 21:54:39 UTC (rev 287950)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2022-01-12 22:37:24 UTC (rev 287951)
@@ -1,3 +1,19 @@
+2022-01-12  Matt Woodrow  <mattwood...@apple.com>
+
+        _paintBehaviorForDestinationContext should consider kCGContextTypeDisplayList type contexts as potentially being snapshots
+        https://bugs.webkit.org/show_bug.cgi?id=234626
+        <rdar://83501315>
+
+        Reviewed by Simon Fraser.
+
+        _paintBehaviorForDestinationContext currently always returns `Normal` for contexts that aren't a bitmap context.
+        AppKit now provides a context that is of type kCGContextTypeDisplayList, and we want to still potentially consider it a
+        snapshot paint (if the other conditions below are met). This ensure images are sync decoded for consumers that just
+        want a single paint.
+
+        * WebView/WebFrame.mm:
+        (-[WebFrame _paintBehaviorForDestinationContext:]):
+
 2022-01-11  Michael Saboff  <msab...@apple.com>
 
         Fixed installhdr build failures in WebCore and WebKitLegacy

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebFrame.mm (287950 => 287951)


--- trunk/Source/WebKitLegacy/mac/WebView/WebFrame.mm	2022-01-12 21:54:39 UTC (rev 287950)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebFrame.mm	2022-01-12 22:37:24 UTC (rev 287951)
@@ -585,7 +585,7 @@
         return OptionSet<WebCore::PaintBehavior>(WebCore::PaintBehavior::FlattenCompositingLayers) | WebCore::PaintBehavior::Snapshotting;
 #endif
 
-    if (CGContextGetType(context) != kCGContextTypeBitmap)
+    if (CGContextGetType(context) != kCGContextTypeBitmap && CGContextGetType(context) != kCGContextTypeDisplayList)
         return WebCore::PaintBehavior::Normal;
 
     // If we're drawing into a bitmap, we could be snapshotting or drawing into a layer-backed view.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to