<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[277210] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/277210">277210</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2021-05-07 16:46:04 -0700 (Fri, 07 May 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add an experimental alternative display-list-based RemoteLayerBackingStore implementation
https://bugs.webkit.org/show_bug.cgi?id=225508

Reviewed by Sam Weinig.

Source/WebKit:

* Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.cpp: Added.
(WebKit::CGDisplayListImageBufferBackend::calculateMemoryCost):
(WebKit::CGDisplayListImageBufferBackend::create):
(WebKit::CGDisplayListImageBufferBackend::CGDisplayListImageBufferBackend):
(WebKit::CGDisplayListImageBufferBackend::createImageBufferBackendHandle const):
(WebKit::CGDisplayListImageBufferBackend::context const):
(WebKit::CGDisplayListImageBufferBackend::backendSize const):
(WebKit::CGDisplayListImageBufferBackend::bytesPerRow const):
(WebKit::CGDisplayListImageBufferBackend::copyNativeImage const):
(WebKit::CGDisplayListImageBufferBackend::toBGRAData const):
(WebKit::CGDisplayListImageBufferBackend::getImageData const):
(WebKit::CGDisplayListImageBufferBackend::putImageData):
* Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.h: Added.
Add an ImageBuffer backend backed by a CG display list.

* Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
Add a new RemoteLayerBackingStore type that uses CGDisplayListImageBufferBackend.

* Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::encode const):
(WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
(WebKit::RemoteLayerBackingStore::supportsPartialRepaint):
Disable partial repaint if using display-list-based backing store,
because we don't currently have any way to mutate display lists.

(WebKit::RemoteLayerBackingStore::display):
(WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
When applying a display-list-based backing store to a layer, we just
pass the encodede data directly to the layer, and tell it to use the
display list to render.

* SourcesCocoa.txt:
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
(WebKit::RemoteLayerTreeNode::createWithPlainLayer):
(-[WKPlainRemoteLayer description]): Deleted.
Move WKPlainRemoteLayer to RemoteLayerTreeLayers, and rename it to WKCompositingLayer.
It will now back all WKCompositingViews.

* UIProcess/RemoteLayerTree/cocoa/RemoteLayerTreeLayers.h: Added.
* UIProcess/RemoteLayerTree/cocoa/RemoteLayerTreeLayers.mm: Added.
(-[WKCompositingLayer description]):
(-[WKCompositingLayer _setWKContentsDisplayList:]):
(-[WKCompositingLayer _wkContentsDisplayList]):
(-[WKCompositingLayer drawInContext:]):
Make WKCompositingLayer replay the given display list in drawRect
(just because we're currently missing API to actually directly pass
the encoded display list data to CA).

* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(+[WKCompositingView layerClass]):
Use WKCompositingLayer as the layer class for all WKCompositingViews.

* WebKit.xcodeproj/project.pbxproj:
* WebProcess/GPU/graphics/ImageBufferBackendHandle.h:
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::updateBackingStore):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
(WebKit::RemoteLayerTreeContext::useCGDisplayListsForDOMRendering const):
(WebKit::RemoteLayerTreeContext::setUseCGDisplayListsForDOMRendering):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::updatePreferences):
Plumb the internal feature flag from WebPreferences to RemoteLayerTreeContext
to PlatformCALayerRemote to RemoteLayerBackingStore; if the preference is
on and the feature is available, we'll always prefer display-list backed
surfaces over either of the bitmap types.

Source/WTF:

* Scripts/Preferences/WebPreferencesInternal.yaml:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFScriptsPreferencesWebPreferencesInternalyaml">trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitSharedRemoteLayerTreeRemoteLayerBackingStoreh">trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h</a></li>
<li><a href="#trunkSourceWebKitSharedRemoteLayerTreeRemoteLayerBackingStoremm">trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm</a></li>
<li><a href="#trunkSourceWebKitSourcesCocoatxt">trunk/Source/WebKit/SourcesCocoa.txt</a></li>
<li><a href="#trunkSourceWebKitUIProcessRemoteLayerTreeRemoteLayerTreeNodemm">trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessRemoteLayerTreeiosRemoteLayerTreeViewsmm">trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm</a></li>
<li><a href="#trunkSourceWebKitWebKitxcodeprojprojectpbxproj">trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKitWebProcessGPUgraphicsImageBufferBackendHandleh">trunk/Source/WebKit/WebProcess/GPU/graphics/ImageBufferBackendHandle.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageRemoteLayerTreePlatformCALayerRemotecpp">trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageRemoteLayerTreeRemoteLayerTreeContexth">trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageRemoteLayerTreeRemoteLayerTreeDrawingAreamm">trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitSharedRemoteLayerTreeCGDisplayListImageBufferBackendcpp">trunk/Source/WebKit/Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.cpp</a></li>
<li><a href="#trunkSourceWebKitSharedRemoteLayerTreeCGDisplayListImageBufferBackendh">trunk/Source/WebKit/Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.h</a></li>
<li>trunk/Source/WebKit/UIProcess/RemoteLayerTree/cocoa/</li>
<li><a href="#trunkSourceWebKitUIProcessRemoteLayerTreecocoaRemoteLayerTreeLayersh">trunk/Source/WebKit/UIProcess/RemoteLayerTree/cocoa/RemoteLayerTreeLayers.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessRemoteLayerTreecocoaRemoteLayerTreeLayersmm">trunk/Source/WebKit/UIProcess/RemoteLayerTree/cocoa/RemoteLayerTreeLayers.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (277209 => 277210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog       2021-05-07 23:03:43 UTC (rev 277209)
+++ trunk/Source/WTF/ChangeLog  2021-05-07 23:46:04 UTC (rev 277210)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2021-05-07  Tim Horton  <timothy_horton@apple.com>
+
+        Add an experimental alternative display-list-based RemoteLayerBackingStore implementation
+        https://bugs.webkit.org/show_bug.cgi?id=225508
+
+        Reviewed by Sam Weinig.
+
+        * Scripts/Preferences/WebPreferencesInternal.yaml:
+
</ins><span class="cx"> 2021-05-07  Philippe Normand  <pnormand@igalia.com>
</span><span class="cx"> 
</span><span class="cx">         [GTK] Warnings about unused filesystem functions
</span></span></pre></div>
<a id="trunkSourceWTFScriptsPreferencesWebPreferencesInternalyaml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml (277209 => 277210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml 2021-05-07 23:03:43 UTC (rev 277209)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml    2021-05-07 23:46:04 UTC (rev 277210)
</span><span class="lines">@@ -738,6 +738,17 @@
</span><span class="cx">     WebKit:
</span><span class="cx">       default: true
</span><span class="cx"> 
</span><ins>+UseCGDisplayListsForDOMRendering:
+  type: bool
+  humanReadableName: "Use CG Display Lists for DOM rendering"
+  humanReadableDescription: "Use CG Display Lists for DOM rendering"
+  webcoreBinding: none
+  condition: ENABLE(CG_DISPLAY_LIST_BACKED_IMAGE_BUFFER)
+  exposed: [ WebKit ]
+  defaultValue:
+    WebKit:
+      default: false
+
</ins><span class="cx"> UseGPUProcessForDOMRenderingEnabled:
</span><span class="cx">   type: bool
</span><span class="cx">   humanReadableName: "GPU Process: DOM Rendering"
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (277209 => 277210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2021-05-07 23:03:43 UTC (rev 277209)
+++ trunk/Source/WebKit/ChangeLog       2021-05-07 23:46:04 UTC (rev 277210)
</span><span class="lines">@@ -1,3 +1,76 @@
</span><ins>+2021-05-07  Tim Horton  <timothy_horton@apple.com>
+
+        Add an experimental alternative display-list-based RemoteLayerBackingStore implementation
+        https://bugs.webkit.org/show_bug.cgi?id=225508
+
+        Reviewed by Sam Weinig.
+
+        * Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.cpp: Added.
+        (WebKit::CGDisplayListImageBufferBackend::calculateMemoryCost):
+        (WebKit::CGDisplayListImageBufferBackend::create):
+        (WebKit::CGDisplayListImageBufferBackend::CGDisplayListImageBufferBackend):
+        (WebKit::CGDisplayListImageBufferBackend::createImageBufferBackendHandle const):
+        (WebKit::CGDisplayListImageBufferBackend::context const):
+        (WebKit::CGDisplayListImageBufferBackend::backendSize const):
+        (WebKit::CGDisplayListImageBufferBackend::bytesPerRow const):
+        (WebKit::CGDisplayListImageBufferBackend::copyNativeImage const):
+        (WebKit::CGDisplayListImageBufferBackend::toBGRAData const):
+        (WebKit::CGDisplayListImageBufferBackend::getImageData const):
+        (WebKit::CGDisplayListImageBufferBackend::putImageData):
+        * Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.h: Added.
+        Add an ImageBuffer backend backed by a CG display list.
+
+        * Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
+        Add a new RemoteLayerBackingStore type that uses CGDisplayListImageBufferBackend.
+
+        * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
+        (WebKit::RemoteLayerBackingStore::encode const):
+        (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
+        (WebKit::RemoteLayerBackingStore::supportsPartialRepaint):
+        Disable partial repaint if using display-list-based backing store,
+        because we don't currently have any way to mutate display lists.
+
+        (WebKit::RemoteLayerBackingStore::display):
+        (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
+        When applying a display-list-based backing store to a layer, we just
+        pass the encodede data directly to the layer, and tell it to use the
+        display list to render.
+
+        * SourcesCocoa.txt:
+        * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
+        (WebKit::RemoteLayerTreeNode::createWithPlainLayer):
+        (-[WKPlainRemoteLayer description]): Deleted.
+        Move WKPlainRemoteLayer to RemoteLayerTreeLayers, and rename it to WKCompositingLayer.
+        It will now back all WKCompositingViews.
+
+        * UIProcess/RemoteLayerTree/cocoa/RemoteLayerTreeLayers.h: Added.
+        * UIProcess/RemoteLayerTree/cocoa/RemoteLayerTreeLayers.mm: Added.
+        (-[WKCompositingLayer description]):
+        (-[WKCompositingLayer _setWKContentsDisplayList:]):
+        (-[WKCompositingLayer _wkContentsDisplayList]):
+        (-[WKCompositingLayer drawInContext:]):
+        Make WKCompositingLayer replay the given display list in drawRect
+        (just because we're currently missing API to actually directly pass
+        the encoded display list data to CA).
+
+        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
+        (+[WKCompositingView layerClass]):
+        Use WKCompositingLayer as the layer class for all WKCompositingViews.
+
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebProcess/GPU/graphics/ImageBufferBackendHandle.h:
+        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
+        (WebKit::PlatformCALayerRemote::updateBackingStore):
+        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
+        (WebKit::RemoteLayerTreeContext::useCGDisplayListsForDOMRendering const):
+        (WebKit::RemoteLayerTreeContext::setUseCGDisplayListsForDOMRendering):
+        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
+        (WebKit::RemoteLayerTreeDrawingArea::updatePreferences):
+        Plumb the internal feature flag from WebPreferences to RemoteLayerTreeContext
+        to PlatformCALayerRemote to RemoteLayerBackingStore; if the preference is
+        on and the feature is available, we'll always prefer display-list backed
+        surfaces over either of the bitmap types.
+
</ins><span class="cx"> 2021-05-07  Brent Fulgham  <bfulgham@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [iOS] Make AccessibilityReduceMotion test case work on iOS
</span></span></pre></div>
<a id="trunkSourceWebKitSharedRemoteLayerTreeCGDisplayListImageBufferBackendcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit/Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.cpp (0 => 277210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.cpp                           (rev 0)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.cpp      2021-05-07 23:46:04 UTC (rev 277210)
</span><span class="lines">@@ -0,0 +1,121 @@
</span><ins>+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "CGDisplayListImageBufferBackend.h"
+
+#if ENABLE(CG_DISPLAY_LIST_BACKED_IMAGE_BUFFER)
+
+#include <WebCore/GraphicsContext.h>
+#include <WebCore/ImageData.h>
+#include <WebKitAdditions/CGDisplayListImageBufferAdditions.h>
+#include <wtf/IsoMallocInlines.h>
+
+namespace WebKit {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(CGDisplayListImageBufferBackend);
+
+size_t CGDisplayListImageBufferBackend::calculateMemoryCost(const Parameters& parameters)
+{
+    // FIXME: This is fairly meaningless, because we don't actually have a bitmap, and
+    // should really be based on the encoded data size.
+    auto backendSize = calculateBackendSize(parameters);
+    return WebCore::ImageBufferBackend::calculateMemoryCost(backendSize, calculateBytesPerRow(backendSize));
+}
+
+std::unique_ptr<CGDisplayListImageBufferBackend> CGDisplayListImageBufferBackend::create(const Parameters& parameters)
+{
+    auto backendSize = calculateBackendSize(parameters);
+    if (backendSize.isEmpty())
+        return nullptr;
+
+    auto cgContext = adoptCF(WKCGCommandsContextCreate(backendSize, nullptr));
+    if (!cgContext)
+        return nullptr;
+
+    auto context = makeUnique<WebCore::GraphicsContext>(cgContext.get());
+    return std::unique_ptr<CGDisplayListImageBufferBackend>(new CGDisplayListImageBufferBackend(parameters, WTFMove(context)));
+}
+
+std::unique_ptr<CGDisplayListImageBufferBackend> CGDisplayListImageBufferBackend::create(const Parameters& parameters, const WebCore::HostWindow*)
+{
+    return CGDisplayListImageBufferBackend::create(parameters);
+}
+
+CGDisplayListImageBufferBackend::CGDisplayListImageBufferBackend(const Parameters& parameters, std::unique_ptr<WebCore::GraphicsContext>&& context)
+    : ImageBufferCGBackend { parameters }
+    , m_context { WTFMove(context) }
+{
+}
+
+ImageBufferBackendHandle CGDisplayListImageBufferBackend::createImageBufferBackendHandle() const
+{
+    auto data = adoptCF(WKCGCommandsContextCopyEncodedData(m_context->platformContext()));
+    ASSERT(data);
+
+    return ImageBufferBackendHandle { IPC::SharedBufferCopy { WebCore::SharedBuffer::create(data.get()) } };
+}
+
+WebCore::GraphicsContext& CGDisplayListImageBufferBackend::context() const
+{
+    return *m_context;
+}
+
+WebCore::IntSize CGDisplayListImageBufferBackend::backendSize() const
+{
+    return calculateBackendSize(m_parameters);
+}
+
+unsigned CGDisplayListImageBufferBackend::bytesPerRow() const
+{
+    return calculateBytesPerRow(backendSize());
+}
+
+RefPtr<WebCore::NativeImage> CGDisplayListImageBufferBackend::copyNativeImage(WebCore::BackingStoreCopy) const
+{
+    ASSERT_NOT_REACHED();
+    return nullptr;
+}
+
+Vector<uint8_t> CGDisplayListImageBufferBackend::toBGRAData() const
+{
+    ASSERT_NOT_REACHED();
+    return { };
+}
+
+RefPtr<WebCore::ImageData> CGDisplayListImageBufferBackend::getImageData(WebCore::AlphaPremultiplication outputFormat, const WebCore::IntRect& srcRect) const
+{
+    ASSERT_NOT_REACHED();
+    return nullptr;
+}
+
+void CGDisplayListImageBufferBackend::putImageData(WebCore::AlphaPremultiplication inputFormat, const WebCore::ImageData& imageData, const WebCore::IntRect& srcRect, const WebCore::IntPoint& destPoint, WebCore::AlphaPremultiplication destFormat)
+{
+    ASSERT_NOT_REACHED();
+}
+
+}
+
+#endif // ENABLE(CG_DISPLAY_LIST_BACKED_IMAGE_BUFFER)
</ins></span></pre></div>
<a id="trunkSourceWebKitSharedRemoteLayerTreeCGDisplayListImageBufferBackendh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit/Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.h (0 => 277210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.h                             (rev 0)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.h        2021-05-07 23:46:04 UTC (rev 277210)
</span><span class="lines">@@ -0,0 +1,68 @@
</span><ins>+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(CG_DISPLAY_LIST_BACKED_IMAGE_BUFFER)
+
+#include "ImageBufferBackendHandle.h"
+#include <WebCore/ImageBufferCGBackend.h>
+#include <wtf/IsoMalloc.h>
+
+namespace WebKit {
+
+class CGDisplayListImageBufferBackend : public WebCore::ImageBufferCGBackend {
+    WTF_MAKE_ISO_ALLOCATED(CGDisplayListImageBufferBackend);
+    WTF_MAKE_NONCOPYABLE(CGDisplayListImageBufferBackend);
+public:
+    static size_t calculateMemoryCost(const Parameters&);
+
+    static std::unique_ptr<CGDisplayListImageBufferBackend> create(const Parameters&);
+    static std::unique_ptr<CGDisplayListImageBufferBackend> create(const Parameters&, const WebCore::HostWindow*);
+
+    ImageBufferBackendHandle createImageBufferBackendHandle() const;
+
+    WebCore::GraphicsContext& context() const override;
+    WebCore::IntSize backendSize() const override;
+
+    // NOTE: These all ASSERT_NOT_REACHED().
+    RefPtr<WebCore::NativeImage> copyNativeImage(WebCore::BackingStoreCopy = WebCore::CopyBackingStore) const override;
+    Vector<uint8_t> toBGRAData() const override;
+    RefPtr<WebCore::ImageData> getImageData(WebCore::AlphaPremultiplication outputFormat, const WebCore::IntRect&) const override;
+    void putImageData(WebCore::AlphaPremultiplication inputFormat, const WebCore::ImageData&, const WebCore::IntRect& srcRect, const WebCore::IntPoint& destPoint, WebCore::AlphaPremultiplication destFormat) override;
+
+    static constexpr bool isOriginAtUpperLeftCorner = true;
+
+protected:
+    CGDisplayListImageBufferBackend(const Parameters&, std::unique_ptr<WebCore::GraphicsContext>&&);
+
+    unsigned bytesPerRow() const override;
+
+    std::unique_ptr<WebCore::GraphicsContext> m_context;
+};
+
+}
+
+#endif // ENABLE(CG_DISPLAY_LIST_BACKED_IMAGE_BUFFER)
</ins></span></pre></div>
<a id="trunkSourceWebKitSharedRemoteLayerTreeRemoteLayerBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h (277209 => 277210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h     2021-05-07 23:03:43 UTC (rev 277209)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h        2021-05-07 23:46:04 UTC (rev 277210)
</span><span class="lines">@@ -55,6 +55,9 @@
</span><span class="cx">     enum class Type : uint8_t {
</span><span class="cx">         IOSurface,
</span><span class="cx">         Bitmap,
</span><ins>+#if ENABLE(CG_DISPLAY_LIST_BACKED_IMAGE_BUFFER)
+        CGDisplayList,
+#endif
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     void ensureBackingStore(Type, WebCore::FloatSize, float scale, bool deepColor, bool isOpaque);
</span><span class="lines">@@ -103,6 +106,8 @@
</span><span class="cx">     void clearBackingStore();
</span><span class="cx">     void swapToValidFrontBuffer();
</span><span class="cx"> 
</span><ins>+    bool supportsPartialRepaint();
+
</ins><span class="cx">     WebCore::PixelFormat pixelFormat() const;
</span><span class="cx"> 
</span><span class="cx">     PlatformCALayerRemote* m_layer;
</span><span class="lines">@@ -146,9 +151,12 @@
</span><span class="cx"> 
</span><span class="cx"> template<> struct EnumTraits<WebKit::RemoteLayerBackingStore::Type> {
</span><span class="cx">     using values = EnumValues<
</span><del>-        WebKit::RemoteLayerBackingStore::Type,
-        WebKit::RemoteLayerBackingStore::Type::IOSurface,
-        WebKit::RemoteLayerBackingStore::Type::Bitmap
</del><ins>+        WebKit::RemoteLayerBackingStore::Type
+        , WebKit::RemoteLayerBackingStore::Type::IOSurface
+        , WebKit::RemoteLayerBackingStore::Type::Bitmap
+#if ENABLE(CG_DISPLAY_LIST_BACKED_IMAGE_BUFFER)
+        , WebKit::RemoteLayerBackingStore::Type::CGDisplayList
+#endif
</ins><span class="cx">     >;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitSharedRemoteLayerTreeRemoteLayerBackingStoremm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm (277209 => 277210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm    2021-05-07 23:03:43 UTC (rev 277209)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm       2021-05-07 23:46:04 UTC (rev 277210)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx">  /*
</span><del>- * Copyright (C) 2013-2018 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -27,11 +27,13 @@
</span><span class="cx"> #import "RemoteLayerBackingStore.h"
</span><span class="cx"> 
</span><span class="cx"> #import "ArgumentCoders.h"
</span><ins>+#import "CGDisplayListImageBufferBackend.h"
</ins><span class="cx"> #import "MachPort.h"
</span><span class="cx"> #import "PlatformCALayerRemote.h"
</span><span class="cx"> #import "PlatformRemoteImageBufferProxy.h"
</span><span class="cx"> #import "RemoteLayerBackingStoreCollection.h"
</span><span class="cx"> #import "RemoteLayerTreeContext.h"
</span><ins>+#import "RemoteLayerTreeLayers.h"
</ins><span class="cx"> #import "ShareableBitmap.h"
</span><span class="cx"> #import "WebCoreArgumentCoders.h"
</span><span class="cx"> #import "WebProcess.h"
</span><span class="lines">@@ -45,6 +47,10 @@
</span><span class="cx"> #import <mach/mach_port.h>
</span><span class="cx"> #import <pal/spi/cocoa/QuartzCoreSPI.h>
</span><span class="cx"> 
</span><ins>+#if ENABLE(CG_DISPLAY_LIST_BACKED_IMAGE_BUFFER)
+#import <WebKitAdditions/CGDisplayListImageBufferAdditions.h>
+#endif
+
</ins><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> RemoteLayerBackingStore::RemoteLayerBackingStore(PlatformCALayerRemote* layer)
</span><span class="lines">@@ -115,6 +121,11 @@
</span><span class="cx">         case Type::Bitmap:
</span><span class="cx">             handle = static_cast<UnacceleratedImageBufferShareableBackend&>(*m_frontBuffer.imageBuffer->ensureBackendCreated()).createImageBufferBackendHandle();
</span><span class="cx">             break;
</span><ins>+#if ENABLE(CG_DISPLAY_LIST_BACKED_IMAGE_BUFFER)
+        case Type::CGDisplayList:
+            handle = static_cast<CGDisplayListImageBufferBackend&>(*m_frontBuffer.imageBuffer->ensureBackendCreated()).createImageBufferBackendHandle();
+            break;
+#endif
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -209,9 +220,29 @@
</span><span class="cx">         else
</span><span class="cx">             m_frontBuffer.imageBuffer = WebCore::ConcreteImageBuffer<UnacceleratedImageBufferShareableBackend>::create(m_size, m_scale, WebCore::DestinationColorSpace::SRGB, pixelFormat(), nullptr);
</span><span class="cx">         break;
</span><ins>+#if ENABLE(CG_DISPLAY_LIST_BACKED_IMAGE_BUFFER)
+    case Type::CGDisplayList:
+        m_frontBuffer.imageBuffer = WebCore::ConcreteImageBuffer<CGDisplayListImageBufferBackend>::create(m_size, m_scale, WebCore::DestinationColorSpace::SRGB, pixelFormat(), nullptr);
+        break;
+#endif
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool RemoteLayerBackingStore::supportsPartialRepaint()
+{
+    switch (m_type) {
+    case Type::IOSurface:
+    case Type::Bitmap:
+        return true;
+#if ENABLE(CG_DISPLAY_LIST_BACKED_IMAGE_BUFFER)
+    case Type::CGDisplayList:
+        return false;
+#endif
+    }
+
+    return true;
+}
+
</ins><span class="cx"> bool RemoteLayerBackingStore::display()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!m_frontBufferFlusher);
</span><span class="lines">@@ -229,7 +260,7 @@
</span><span class="cx">         return needToEncodeBackingStore;
</span><span class="cx"> 
</span><span class="cx">     WebCore::IntRect layerBounds(WebCore::IntPoint(), WebCore::expandedIntSize(m_size));
</span><del>-    if (!hasFrontBuffer())
</del><ins>+    if (!hasFrontBuffer() || !supportsPartialRepaint())
</ins><span class="cx">         m_dirtyRegion.unite(layerBounds);
</span><span class="cx"> 
</span><span class="cx">     if (m_layer->owner()->platformCALayerShowRepaintCounter(m_layer)) {
</span><span class="lines">@@ -354,24 +385,37 @@
</span><span class="cx">     ASSERT(m_bufferHandle);
</span><span class="cx">     layer.contentsOpaque = m_isOpaque;
</span><span class="cx"> 
</span><del>-    switch (m_type) {
-    case Type::IOSurface:
-        switch (contentsType) {
-        case LayerContentsType::IOSurface: {
-            auto surface = WebCore::IOSurface::createFromSendRight(WTFMove(WTF::get<MachSendRight>(*m_bufferHandle)), WebCore::sRGBColorSpaceRef());
-            layer.contents = surface ? surface->asLayerContents() : nil;
-            break;
</del><ins>+    WTF::switchOn(*m_bufferHandle,
+        [&] (ShareableBitmap::Handle& handle) {
+            ASSERT(m_type == Type::Bitmap);
+            auto bitmap = ShareableBitmap::create(handle);
+            layer.contents = (__bridge id)bitmap->makeCGImageCopy().get();
+        },
+        [&] (MachSendRight& machSendRight) {
+            ASSERT(m_type == Type::IOSurface);
+            switch (contentsType) {
+            case LayerContentsType::IOSurface: {
+                auto surface = WebCore::IOSurface::createFromSendRight(WTFMove(machSendRight), WebCore::sRGBColorSpaceRef());
+                layer.contents = surface ? surface->asLayerContents() : nil;
+                break;
+            }
+            case LayerContentsType::CAMachPort:
+                layer.contents = (__bridge id)adoptCF(CAMachPortCreate(machSendRight.leakSendRight())).get();
+                break;
+            }
</ins><span class="cx">         }
</span><del>-        case LayerContentsType::CAMachPort:
-            layer.contents = (__bridge id)adoptCF(CAMachPortCreate(WTF::get<MachSendRight>(*m_bufferHandle).leakSendRight())).get();
-            break;
</del><ins>+#if ENABLE(CG_DISPLAY_LIST_BACKED_IMAGE_BUFFER)
+        , [&] (IPC::SharedBufferCopy& buffer) {
+            ASSERT(m_type == Type::CGDisplayList);
+            ASSERT([layer isKindOfClass:[WKCompositingLayer class]]);
+            if (![layer isKindOfClass:[WKCompositingLayer class]])
+                return;
+            [layer setValue:@1 forKeyPath:WKCGDisplayListEnabledKey];
+            auto data = buffer.buffer()->createCFData();
+            [(WKCompositingLayer *)layer _setWKContentsDisplayList:data.get()];
</ins><span class="cx">         }
</span><del>-        break;
-    case Type::Bitmap:
-        auto bitmap = ShareableBitmap::create(WTF::get<ShareableBitmap::Handle>(*m_bufferHandle));
-        layer.contents = (__bridge id)bitmap->makeCGImageCopy().get();
-        break;
-    }
</del><ins>+#endif
+    );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> std::unique_ptr<WebCore::ThreadSafeImageBufferFlusher> RemoteLayerBackingStore::takePendingFlusher()
</span></span></pre></div>
<a id="trunkSourceWebKitSourcesCocoatxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/SourcesCocoa.txt (277209 => 277210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/SourcesCocoa.txt     2021-05-07 23:03:43 UTC (rev 277209)
+++ trunk/Source/WebKit/SourcesCocoa.txt        2021-05-07 23:46:04 UTC (rev 277210)
</span><span class="lines">@@ -540,6 +540,8 @@
</span><span class="cx"> UIProcess/Plugins/mac/PluginProcessManagerMac.mm
</span><span class="cx"> UIProcess/Plugins/mac/PluginProcessProxyMac.mm
</span><span class="cx"> 
</span><ins>+UIProcess/RemoteLayerTree/cocoa/RemoteLayerTreeLayers.mm
+
</ins><span class="cx"> UIProcess/RemoteLayerTree/mac/ScrollerMac.mm
</span><span class="cx"> UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm
</span><span class="cx"> UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessRemoteLayerTreeRemoteLayerTreeNodemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm (277209 => 277210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm     2021-05-07 23:03:43 UTC (rev 277209)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm        2021-05-07 23:46:04 UTC (rev 277210)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #import "config.h"
</span><span class="cx"> #import "RemoteLayerTreeNode.h"
</span><span class="cx"> 
</span><ins>+#import "RemoteLayerTreeLayers.h"
</ins><span class="cx"> #import <QuartzCore/CALayer.h>
</span><span class="cx"> #import <WebCore/WebActionDisablingCALayerDelegate.h>
</span><span class="cx"> 
</span><span class="lines">@@ -33,16 +34,6 @@
</span><span class="cx"> #import <UIKit/UIView.h>
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-@interface WKPlainRemoteLayer : CALayer
-@end
-
-@implementation WKPlainRemoteLayer
-- (NSString *)description
-{
-    return WebKit::RemoteLayerTreeNode::appendLayerDescription(super.description, self);
-}
-@end
-
</del><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> static NSString *const WKRemoteLayerTreeNodePropertyKey = @"WKRemoteLayerTreeNode";
</span><span class="lines">@@ -72,7 +63,7 @@
</span><span class="cx"> 
</span><span class="cx"> std::unique_ptr<RemoteLayerTreeNode> RemoteLayerTreeNode::createWithPlainLayer(WebCore::GraphicsLayer::PlatformLayerID layerID)
</span><span class="cx"> {
</span><del>-    RetainPtr<CALayer> layer = adoptNS([[WKPlainRemoteLayer alloc] init]);
</del><ins>+    RetainPtr<CALayer> layer = adoptNS([[WKCompositingLayer alloc] init]);
</ins><span class="cx">     return makeUnique<RemoteLayerTreeNode>(layerID, WTFMove(layer));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessRemoteLayerTreecocoaRemoteLayerTreeLayershfromrev277209trunkSourceWebKitWebProcessGPUgraphicsImageBufferBackendHandleh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/UIProcess/RemoteLayerTree/cocoa/RemoteLayerTreeLayers.h (from rev 277209, trunk/Source/WebKit/WebProcess/GPU/graphics/ImageBufferBackendHandle.h) (0 => 277210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/cocoa/RemoteLayerTreeLayers.h                              (rev 0)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/cocoa/RemoteLayerTreeLayers.h 2021-05-07 23:46:04 UTC (rev 277210)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if PLATFORM(COCOA)
+
+#import <Foundation/Foundation.h>
+#import <QuartzCore/QuartzCore.h>
+
+@interface WKCompositingLayer : CALayer
+
+#if ENABLE(CG_DISPLAY_LIST_BACKED_IMAGE_BUFFER)
+@property (nonatomic, retain, setter=_setWKContentsDisplayList:) __attribute__((NSObject)) CFDataRef _wkContentsDisplayList;
+#endif
+
+@end
+
+#endif // PLATFORM(COCOA)
</ins></span></pre></div>
<a id="trunkSourceWebKitUIProcessRemoteLayerTreecocoaRemoteLayerTreeLayersmmfromrev277209trunkSourceWebKitWebProcessGPUgraphicsImageBufferBackendHandleh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/UIProcess/RemoteLayerTree/cocoa/RemoteLayerTreeLayers.mm (from rev 277209, trunk/Source/WebKit/WebProcess/GPU/graphics/ImageBufferBackendHandle.h) (0 => 277210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/cocoa/RemoteLayerTreeLayers.mm                             (rev 0)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/cocoa/RemoteLayerTreeLayers.mm        2021-05-07 23:46:04 UTC (rev 277210)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "RemoteLayerTreeLayers.h"
+
+#if PLATFORM(COCOA)
+
+#import "Logging.h"
+#import "RemoteLayerTreeNode.h"
+#import <pal/spi/cocoa/QuartzCoreSPI.h>
+
+#if ENABLE(CG_DISPLAY_LIST_BACKED_IMAGE_BUFFER)
+#import <WebKitAdditions/CGDisplayListImageBufferAdditions.h>
+#endif
+
+@implementation WKCompositingLayer {
+#if ENABLE(CG_DISPLAY_LIST_BACKED_IMAGE_BUFFER)
+    RetainPtr<CFDataRef> _contentsDisplayList;
+#endif
+}
+
+- (NSString *)description
+{
+    return WebKit::RemoteLayerTreeNode::appendLayerDescription(super.description, self);
+}
+
+#if ENABLE(CG_DISPLAY_LIST_BACKED_IMAGE_BUFFER)
+- (void)_setWKContentsDisplayList:(CFDataRef)data
+{
+    _contentsDisplayList = data;
+    [self setNeedsDisplay];
+}
+
+- (CFDataRef)_wkContentsDisplayList
+{
+    return _contentsDisplayList.get();
+}
+
+- (void)drawInContext:(CGContextRef)context
+{
+    if (!_contentsDisplayList)
+        return;
+    WKCGContextDrawCGCommandsEncodedData(context, _contentsDisplayList.get(), nullptr);
+}
+#endif // ENABLE(CG_DISPLAY_LIST_BACKED_IMAGE_BUFFER)
+
+@end
+
+#endif // PLATFORM(COCOA)
</ins></span></pre></div>
<a id="trunkSourceWebKitUIProcessRemoteLayerTreeiosRemoteLayerTreeViewsmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm (277209 => 277210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm        2021-05-07 23:03:43 UTC (rev 277209)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm   2021-05-07 23:46:04 UTC (rev 277210)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> #import "Logging.h"
</span><span class="cx"> #import "RemoteLayerTreeHost.h"
</span><ins>+#import "RemoteLayerTreeLayers.h"
</ins><span class="cx"> #import "RemoteLayerTreeNode.h"
</span><span class="cx"> #import "UIKitSPI.h"
</span><span class="cx"> #import "WKDeferringGestureRecognizer.h"
</span><span class="lines">@@ -313,6 +314,11 @@
</span><span class="cx"> 
</span><span class="cx"> @implementation WKCompositingView
</span><span class="cx"> 
</span><ins>++ (Class)layerClass
+{
+    return [WKCompositingLayer class];
+}
+
</ins><span class="cx"> - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
</span><span class="cx"> {
</span><span class="cx">     return [self _web_findDescendantViewAtPoint:point withEvent:event];
</span></span></pre></div>
<a id="trunkSourceWebKitWebKitxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (277209 => 277210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj     2021-05-07 23:03:43 UTC (rev 277209)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2021-05-07 23:46:04 UTC (rev 277210)
</span><span class="lines">@@ -667,6 +667,7 @@
</span><span class="cx">          2D54C31A212F3B330049C174 /* UnifiedSource61-mm.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D54C306212F3B330049C174 /* UnifiedSource61-mm.mm */; };
</span><span class="cx">          2D54C31B212F4DA60049C174 /* ProcessLauncher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE117F511DBB30900981615 /* ProcessLauncher.cpp */; };
</span><span class="cx">          2D5C9D0619C81D8F00B3C5C1 /* WebPageOverlay.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D5C9D0419C81D8F00B3C5C1 /* WebPageOverlay.h */; };
</span><ins>+               2D64824B2644B1AB00030335 /* RemoteLayerTreeLayers.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D6482492644B1AB00030335 /* RemoteLayerTreeLayers.h */; };
</ins><span class="cx">           2D6AB541192B1C4A003A9FD1 /* WKPDFPageNumberIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D6AB53F192B1C4A003A9FD1 /* WKPDFPageNumberIndicator.h */; };
</span><span class="cx">          2D6B371B18A967AD0042AE80 /* _WKThumbnailView.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D6B371918A967AD0042AE80 /* _WKThumbnailView.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          2D6CD119189058A500E5A4A0 /* ViewSnapshotStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D6CD117189058A500E5A4A0 /* ViewSnapshotStore.h */; };
</span><span class="lines">@@ -1828,6 +1829,8 @@
</span><span class="cx">          BCE469541214E6CB000B98EB /* WebFormClient.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE469501214E6CB000B98EB /* WebFormClient.h */; };
</span><span class="cx">          BCE469561214E6CB000B98EB /* WebFormSubmissionListenerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE469521214E6CB000B98EB /* WebFormSubmissionListenerProxy.h */; };
</span><span class="cx">          BCE4695A1214EDF4000B98EB /* WKFormSubmissionListener.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE469581214EDF4000B98EB /* WKFormSubmissionListener.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+               BCE579A62634836700F5C5E9 /* CGDisplayListImageBufferBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE579A42634836700F5C5E9 /* CGDisplayListImageBufferBackend.h */; };
+               BCE579A72634836700F5C5E9 /* CGDisplayListImageBufferBackend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE579A52634836700F5C5E9 /* CGDisplayListImageBufferBackend.cpp */; };
</ins><span class="cx">           BCE81D8D1319F7EF00241910 /* FontInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE81D8B1319F7EF00241910 /* FontInfo.h */; };
</span><span class="cx">          BCEE7AD012817988009827DA /* WebProcessProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEE7ACC12817988009827DA /* WebProcessProxyMessageReceiver.cpp */; };
</span><span class="cx">          BCEE7AD112817988009827DA /* WebProcessProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEE7ACD12817988009827DA /* WebProcessProxyMessages.h */; };
</span><span class="lines">@@ -3227,6 +3230,8 @@
</span><span class="cx">          2D54C306212F3B330049C174 /* UnifiedSource61-mm.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "UnifiedSource61-mm.mm"; path = "DerivedSources/WebKit2/unified-sources/UnifiedSource61-mm.mm"; sourceTree = BUILT_PRODUCTS_DIR; };
</span><span class="cx">          2D5C9D0319C81D8F00B3C5C1 /* WebPageOverlay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPageOverlay.cpp; sourceTree = "<group>"; };
</span><span class="cx">          2D5C9D0419C81D8F00B3C5C1 /* WebPageOverlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPageOverlay.h; sourceTree = "<group>"; };
</span><ins>+               2D6482492644B1AB00030335 /* RemoteLayerTreeLayers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteLayerTreeLayers.h; sourceTree = "<group>"; };
+               2D64824A2644B1AB00030335 /* RemoteLayerTreeLayers.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteLayerTreeLayers.mm; sourceTree = "<group>"; };
</ins><span class="cx">           2D6AB53F192B1C4A003A9FD1 /* WKPDFPageNumberIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKPDFPageNumberIndicator.h; path = ios/WKPDFPageNumberIndicator.h; sourceTree = "<group>"; };
</span><span class="cx">          2D6AB540192B1C4A003A9FD1 /* WKPDFPageNumberIndicator.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKPDFPageNumberIndicator.mm; path = ios/WKPDFPageNumberIndicator.mm; sourceTree = "<group>"; };
</span><span class="cx">          2D6B371918A967AD0042AE80 /* _WKThumbnailView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKThumbnailView.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -5508,6 +5513,8 @@
</span><span class="cx">          BCE469521214E6CB000B98EB /* WebFormSubmissionListenerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFormSubmissionListenerProxy.h; sourceTree = "<group>"; };
</span><span class="cx">          BCE469571214EDF4000B98EB /* WKFormSubmissionListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKFormSubmissionListener.cpp; sourceTree = "<group>"; };
</span><span class="cx">          BCE469581214EDF4000B98EB /* WKFormSubmissionListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKFormSubmissionListener.h; sourceTree = "<group>"; };
</span><ins>+               BCE579A42634836700F5C5E9 /* CGDisplayListImageBufferBackend.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CGDisplayListImageBufferBackend.h; sourceTree = "<group>"; };
+               BCE579A52634836700F5C5E9 /* CGDisplayListImageBufferBackend.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CGDisplayListImageBufferBackend.cpp; sourceTree = "<group>"; };
</ins><span class="cx">           BCE81D8A1319F7EF00241910 /* FontInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontInfo.cpp; sourceTree = "<group>"; };
</span><span class="cx">          BCE81D8B1319F7EF00241910 /* FontInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontInfo.h; sourceTree = "<group>"; };
</span><span class="cx">          BCE9C0CF1485965D00E33D61 /* WebConnectionToUIProcess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebConnectionToUIProcess.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -7291,6 +7298,7 @@
</span><span class="cx">          2D1551A91F5A9B420006E3FE /* RemoteLayerTree */ = {
</span><span class="cx">                  isa = PBXGroup;
</span><span class="cx">                  children = (
</span><ins>+                               2D6482482644B1AB00030335 /* cocoa */,
</ins><span class="cx">                           2D1551AA1F5A9BA70006E3FE /* ios */,
</span><span class="cx">                          E404906F21DE65D70037F0DB /* mac */,
</span><span class="cx">                          1AB16AE01648656D00290D62 /* RemoteLayerTreeDrawingAreaProxy.h */,
</span><span class="lines">@@ -7358,6 +7366,8 @@
</span><span class="cx">          2D2E04761F5BEC4F00BB25ED /* RemoteLayerTree */ = {
</span><span class="cx">                  isa = PBXGroup;
</span><span class="cx">                  children = (
</span><ins>+                               BCE579A52634836700F5C5E9 /* CGDisplayListImageBufferBackend.cpp */,
+                               BCE579A42634836700F5C5E9 /* CGDisplayListImageBufferBackend.h */,
</ins><span class="cx">                           2D47B56B1810714E003A3AEE /* RemoteLayerBackingStore.h */,
</span><span class="cx">                          2D47B56A1810714E003A3AEE /* RemoteLayerBackingStore.mm */,
</span><span class="cx">                          2DDF731318E95060004F5A66 /* RemoteLayerBackingStoreCollection.h */,
</span><span class="lines">@@ -7375,6 +7385,15 @@
</span><span class="cx">                  path = RemoteLayerTree;
</span><span class="cx">                  sourceTree = "<group>";
</span><span class="cx">          };
</span><ins>+               2D6482482644B1AB00030335 /* cocoa */ = {
+                       isa = PBXGroup;
+                       children = (
+                               2D6482492644B1AB00030335 /* RemoteLayerTreeLayers.h */,
+                               2D64824A2644B1AB00030335 /* RemoteLayerTreeLayers.mm */,
+                       );
+                       path = cocoa;
+                       sourceTree = "<group>";
+               };
</ins><span class="cx">           2D7DEBE221269E4B00B9F73C /* unified-sources */ = {
</span><span class="cx">                  isa = PBXGroup;
</span><span class="cx">                  children = (
</span><span class="lines">@@ -11870,6 +11889,7 @@
</span><span class="cx">                          41897ED81F415D8A0016FA42 /* CacheStorageEngine.h in Headers */,
</span><span class="cx">                          41FABD2A1F4DE001006A6C97 /* CacheStorageEngineCache.h in Headers */,
</span><span class="cx">                          41897EDA1F415D8A0016FA42 /* CacheStorageEngineConnection.h in Headers */,
</span><ins>+                               BCE579A62634836700F5C5E9 /* CGDisplayListImageBufferBackend.h in Headers */,
</ins><span class="cx">                           57B4B46020B504AC00D4AD79 /* ClientCertificateAuthenticationXPCConstants.h in Headers */,
</span><span class="cx">                          F4FE0A3B24632B60002631E1 /* CocoaColor.h in Headers */,
</span><span class="cx">                          4482734724528F6000A95493 /* CocoaImage.h in Headers */,
</span><span class="lines">@@ -12207,6 +12227,7 @@
</span><span class="cx">                          1AB16AE21648656D00290D62 /* RemoteLayerTreeDrawingAreaProxy.h in Headers */,
</span><span class="cx">                          0FF24A2E1879E4BC003ABF0C /* RemoteLayerTreeDrawingAreaProxyMessages.h in Headers */,
</span><span class="cx">                          1AA3D75C1651B44F008713D0 /* RemoteLayerTreeHost.h in Headers */,
</span><ins>+                               2D64824B2644B1AB00030335 /* RemoteLayerTreeLayers.h in Headers */,
</ins><span class="cx">                           E4E57F6B21A83B1200345F3C /* RemoteLayerTreeNode.h in Headers */,
</span><span class="cx">                          2DDE0AFA18298CC900F97EAA /* RemoteLayerTreePropertyApplier.h in Headers */,
</span><span class="cx">                          0FF264A01A1FF9CC001FE759 /* RemoteLayerTreeScrollingPerformanceData.h in Headers */,
</span><span class="lines">@@ -14092,6 +14113,7 @@
</span><span class="cx">                          51FAEC3B1B0657680009C4E7 /* AuxiliaryProcessMessageReceiver.cpp in Sources */,
</span><span class="cx">                          2D92A785212B6AB100F493FD /* BlobDataFileReferenceWithSandboxExtension.cpp in Sources */,
</span><span class="cx">                          517CF0E3163A486C00C2950F /* CacheStorageEngineConnectionMessageReceiver.cpp in Sources */,
</span><ins>+                               BCE579A72634836700F5C5E9 /* CGDisplayListImageBufferBackend.cpp in Sources */,
</ins><span class="cx">                           2D92A77D212B6A7100F493FD /* Connection.cpp in Sources */,
</span><span class="cx">                          2D92A77F212B6A7100F493FD /* Decoder.cpp in Sources */,
</span><span class="cx">                          49DAA38C24CBA1A800793D75 /* DefaultWebBrowserChecks.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessGPUgraphicsImageBufferBackendHandleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/ImageBufferBackendHandle.h (277209 => 277210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/GPU/graphics/ImageBufferBackendHandle.h   2021-05-07 23:03:43 UTC (rev 277209)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/ImageBufferBackendHandle.h      2021-05-07 23:46:04 UTC (rev 277210)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> #if ENABLE(GPU_PROCESS)
</span><span class="cx"> 
</span><span class="cx"> #include "ShareableBitmap.h"
</span><ins>+#include "SharedBufferCopy.h"
</ins><span class="cx"> #include <wtf/MachSendRight.h>
</span><span class="cx"> #include <wtf/Variant.h>
</span><span class="cx"> 
</span><span class="lines">@@ -34,10 +35,13 @@
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> using ImageBufferBackendHandle = Variant<
</span><ins>+    ShareableBitmap::Handle
</ins><span class="cx"> #if PLATFORM(COCOA) // FIXME: This is really about IOSurface.
</span><del>-    MachSendRight,
</del><ins>+    , MachSendRight
</ins><span class="cx"> #endif
</span><del>-    ShareableBitmap::Handle
</del><ins>+#if ENABLE(CG_DISPLAY_LIST_BACKED_IMAGE_BUFFER)
+    , IPC::SharedBufferCopy
+#endif
</ins><span class="cx"> >;
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageRemoteLayerTreePlatformCALayerRemotecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp (277209 => 277210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp 2021-05-07 23:03:43 UTC (rev 277209)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp    2021-05-07 23:46:04 UTC (rev 277210)
</span><span class="lines">@@ -234,6 +234,10 @@
</span><span class="cx">     ASSERT(m_properties.backingStoreAttached);
</span><span class="cx"> 
</span><span class="cx">     auto type = m_acceleratesDrawing ? RemoteLayerBackingStore::Type::IOSurface : RemoteLayerBackingStore::Type::Bitmap;
</span><ins>+#if ENABLE(CG_DISPLAY_LIST_BACKED_IMAGE_BUFFER)
+    if (m_context->useCGDisplayListsForDOMRendering())
+        type = RemoteLayerBackingStore::Type::CGDisplayList;
+#endif
</ins><span class="cx">     m_properties.backingStore->ensureBackingStore(type, m_properties.bounds.size(), m_properties.contentsScale, m_wantsDeepColorBackingStore, m_properties.opaque);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageRemoteLayerTreeRemoteLayerTreeContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h (277209 => 277210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h  2021-05-07 23:03:43 UTC (rev 277209)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h     2021-05-07 23:46:04 UTC (rev 277210)
</span><span class="lines">@@ -80,6 +80,9 @@
</span><span class="cx">     void adoptLayersFromContext(RemoteLayerTreeContext&);
</span><span class="cx"> 
</span><span class="cx">     RemoteRenderingBackendProxy& ensureRemoteRenderingBackendProxy();
</span><ins>+
+    bool useCGDisplayListsForDOMRendering() const { return m_useCGDisplayListsForDOMRendering; }
+    void setUseCGDisplayListsForDOMRendering(bool useCGDisplayLists) { m_useCGDisplayListsForDOMRendering = useCGDisplayLists; }
</ins><span class="cx">     
</span><span class="cx"> #if PLATFORM(IOS_FAMILY)
</span><span class="cx">     bool canShowWhileLocked() const;
</span><span class="lines">@@ -106,6 +109,8 @@
</span><span class="cx">     WebCore::LayerPool m_layerPool;
</span><span class="cx">     
</span><span class="cx">     bool m_nextRenderingUpdateRequiresSynchronousImageDecoding { false };
</span><ins>+
+    bool m_useCGDisplayListsForDOMRendering { false };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageRemoteLayerTreeRemoteLayerTreeDrawingAreamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm (277209 => 277210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm     2021-05-07 23:03:43 UTC (rev 277209)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm        2021-05-07 23:46:04 UTC (rev 277210)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> #import "WebPage.h"
</span><span class="cx"> #import "WebPageCreationParameters.h"
</span><span class="cx"> #import "WebPageProxyMessages.h"
</span><ins>+#import "WebPreferencesKeys.h"
</ins><span class="cx"> #import "WebProcess.h"
</span><span class="cx"> #import <QuartzCore/QuartzCore.h>
</span><span class="cx"> #import <WebCore/DebugPageOverlays.h>
</span><span class="lines">@@ -161,7 +162,7 @@
</span><span class="cx">     return frameView.frame().isMainFrame() || m_webPage.corePage()->settings().asyncFrameScrollingEnabled();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RemoteLayerTreeDrawingArea::updatePreferences(const WebPreferencesStore&)
</del><ins>+void RemoteLayerTreeDrawingArea::updatePreferences(const WebPreferencesStore& preferences)
</ins><span class="cx"> {
</span><span class="cx">     Settings& settings = m_webPage.corePage()->settings();
</span><span class="cx"> 
</span><span class="lines">@@ -171,6 +172,8 @@
</span><span class="cx"> 
</span><span class="cx">     m_rootLayer->setShowDebugBorder(settings.showDebugBorders());
</span><span class="cx"> 
</span><ins>+    m_remoteLayerTreeContext->setUseCGDisplayListsForDOMRendering(preferences.getBoolValueForKey(WebPreferencesKey::useCGDisplayListsForDOMRenderingKey()));
+
</ins><span class="cx">     DebugPageOverlays::settingsChanged(*m_webPage.corePage());
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>