<!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>[243982] releases/WebKitGTK/webkit-2.24/Source/WebKit</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/243982">243982</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2019-04-08 03:15:06 -0700 (Mon, 08 Apr 2019)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/242346">r242346</a> - [CoordinatedGraphics] Unify DrawingArea classes
https://bugs.webkit.org/show_bug.cgi?id=195167
Reviewed by Žan Doberšek.
Add DrawingAreaProxyCoordinatedGraphics and DrawingAreaCoordinatedGraphics.
* PlatformGTK.cmake:
* PlatformWPE.cmake:
* PlatformWin.cmake:
* Shared/DrawingAreaInfo.h:
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::createDrawingAreaProxy):
(WebKit::PageClientImpl::viewSize):
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseRealize):
(webkitWebViewBaseUnrealize):
(webkitWebViewBaseDraw):
(webkitWebViewBaseSizeAllocate):
(webkitWebViewBaseDidRelaunchWebProcess):
(webkitWebViewBasePageClosed):
* UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::createDrawingAreaProxy):
* UIProcess/AcceleratedDrawingAreaProxy.cpp: Removed.
* UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp: Added.
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingAreaProxyCoordinatedGraphics):
(WebKit::DrawingAreaProxyCoordinatedGraphics::~DrawingAreaProxyCoordinatedGraphics):
(WebKit::DrawingAreaProxyCoordinatedGraphics::paint):
(WebKit::DrawingAreaProxyCoordinatedGraphics::sizeDidChange):
(WebKit::DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange):
(WebKit::DrawingAreaProxyCoordinatedGraphics::waitForBackingStoreUpdateOnNextPaint):
(WebKit::DrawingAreaProxyCoordinatedGraphics::setBackingStoreIsDiscardable):
(WebKit::DrawingAreaProxyCoordinatedGraphics::update):
(WebKit::DrawingAreaProxyCoordinatedGraphics::didUpdateBackingStoreState):
(WebKit::DrawingAreaProxyCoordinatedGraphics::enterAcceleratedCompositingMode):
(WebKit::DrawingAreaProxyCoordinatedGraphics::exitAcceleratedCompositingMode):
(WebKit::DrawingAreaProxyCoordinatedGraphics::updateAcceleratedCompositingMode):
(WebKit::DrawingAreaProxyCoordinatedGraphics::incorporateUpdate):
(WebKit::DrawingAreaProxyCoordinatedGraphics::alwaysUseCompositing const):
(WebKit::DrawingAreaProxyCoordinatedGraphics::backingStoreStateDidChange):
(WebKit::DrawingAreaProxyCoordinatedGraphics::sendUpdateBackingStoreState):
(WebKit::DrawingAreaProxyCoordinatedGraphics::waitForAndDispatchDidUpdateBackingStoreState):
(WebKit::DrawingAreaProxyCoordinatedGraphics::discardBackingStoreSoon):
(WebKit::DrawingAreaProxyCoordinatedGraphics::discardBackingStore):
(WebKit::DrawingAreaProxyCoordinatedGraphics::setNativeSurfaceHandleForCompositing):
(WebKit::DrawingAreaProxyCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing):
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::DrawingMonitor):
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::~DrawingMonitor):
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::webViewDrawCallback):
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::start):
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::stop):
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::didDraw):
(WebKit::DrawingAreaProxyCoordinatedGraphics::dispatchAfterEnsuringDrawing):
* UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h: Renamed from Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.h.
* UIProcess/DrawingAreaProxyImpl.cpp: Removed.
* UIProcess/DrawingAreaProxyImpl.h: Removed.
* UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
(WebKit::AcceleratedBackingStoreX11::update):
* UIProcess/win/PageClientImpl.cpp:
(WebKit::PageClientImpl::createDrawingAreaProxy):
* UIProcess/win/WebView.cpp:
(WebKit::WebView::paint):
* WebProcess/WebPage/AcceleratedDrawingArea.cpp: Removed.
* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: Added.
(WebKit::DrawingAreaCoordinatedGraphics::DrawingAreaCoordinatedGraphics):
(WebKit::DrawingAreaCoordinatedGraphics::~DrawingAreaCoordinatedGraphics):
(WebKit::DrawingAreaCoordinatedGraphics::setNeedsDisplay):
(WebKit::DrawingAreaCoordinatedGraphics::setNeedsDisplayInRect):
(WebKit::DrawingAreaCoordinatedGraphics::scroll):
(WebKit::DrawingAreaCoordinatedGraphics::forceRepaint):
(WebKit::DrawingAreaCoordinatedGraphics::forceRepaintAsync):
(WebKit::DrawingAreaCoordinatedGraphics::setLayerTreeStateIsFrozen):
(WebKit::DrawingAreaCoordinatedGraphics::updatePreferences):
(WebKit::DrawingAreaCoordinatedGraphics::mainFrameContentSizeChanged):
(WebKit::DrawingAreaCoordinatedGraphics::deviceOrPageScaleFactorChanged):
(WebKit::DrawingAreaCoordinatedGraphics::didChangeViewportAttributes):
(WebKit::DrawingAreaCoordinatedGraphics::graphicsLayerFactory):
(WebKit::DrawingAreaCoordinatedGraphics::setRootCompositingLayer):
(WebKit::DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush):
(WebKit::DrawingAreaCoordinatedGraphics::layerHostDidFlushLayers):
(WebKit::DrawingAreaCoordinatedGraphics::createDisplayRefreshMonitor):
(WebKit::DrawingAreaCoordinatedGraphics::setNativeSurfaceHandleForCompositing):
(WebKit::DrawingAreaCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing):
(WebKit::DrawingAreaCoordinatedGraphics::activityStateDidChange):
(WebKit::DrawingAreaCoordinatedGraphics::attachViewOverlayGraphicsLayer):
(WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState):
(WebKit::DrawingAreaCoordinatedGraphics::didUpdate):
(WebKit::DrawingAreaCoordinatedGraphics::sendDidUpdateBackingStoreState):
(WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingModeSoon):
(WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingModeNow):
(WebKit::DrawingAreaCoordinatedGraphics::discardPreviousLayerTreeHost):
(WebKit::DrawingAreaCoordinatedGraphics::suspendPainting):
(WebKit::DrawingAreaCoordinatedGraphics::resumePainting):
(WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode):
(WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingMode):
(WebKit::DrawingAreaCoordinatedGraphics::scheduleDisplay):
(WebKit::DrawingAreaCoordinatedGraphics::displayTimerFired):
(WebKit::DrawingAreaCoordinatedGraphics::display):
(WebKit::shouldPaintBoundsRect):
* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h: Renamed from Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.h.
* WebProcess/WebPage/DrawingArea.cpp:
(WebKit::DrawingArea::create):
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::layerFlushThrottlingIsActive const):
* WebProcess/WebPage/DrawingAreaImpl.cpp: Removed.
* WebProcess/WebPage/DrawingAreaImpl.h: Removed.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitChangeLog">releases/WebKitGTK/webkit-2.24/Source/WebKit/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitPlatformGTKcmake">releases/WebKitGTK/webkit-2.24/Source/WebKit/PlatformGTK.cmake</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitPlatformWPEcmake">releases/WebKitGTK/webkit-2.24/Source/WebKit/PlatformWPE.cmake</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitPlatformWincmake">releases/WebKitGTK/webkit-2.24/Source/WebKit/PlatformWin.cmake</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitSharedDrawingAreaInfoh">releases/WebKitGTK/webkit-2.24/Source/WebKit/Shared/DrawingAreaInfo.h</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitSourcesGTKtxt">releases/WebKitGTK/webkit-2.24/Source/WebKit/SourcesGTK.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitSourcesWPEtxt">releases/WebKitGTK/webkit-2.24/Source/WebKit/SourcesWPE.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitUIProcessAPIgtkPageClientImplcpp">releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitUIProcessAPIgtkWebKitWebViewBasecpp">releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitUIProcessAPIwpePageClientImplcpp">releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitUIProcessgtkAcceleratedBackingStoreX11cpp">releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitUIProcesswinPageClientImplcpp">releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/win/PageClientImpl.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitUIProcesswinWebViewcpp">releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/win/WebView.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitWebProcessWebPageDrawingAreacpp">releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/DrawingArea.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitWebProcessWebPageDrawingAreah">releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/DrawingArea.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li>releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/CoordinatedGraphics/</li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitUIProcessCoordinatedGraphicsDrawingAreaProxyCoordinatedGraphicscpp">releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitUIProcessCoordinatedGraphicsDrawingAreaProxyCoordinatedGraphicsh">releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitWebProcessWebPageCoordinatedGraphicsDrawingAreaCoordinatedGraphicscpp">releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitWebProcessWebPageCoordinatedGraphicsDrawingAreaCoordinatedGraphicsh">releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitUIProcessAcceleratedDrawingAreaProxycpp">releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitUIProcessAcceleratedDrawingAreaProxyh">releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.h</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitUIProcessDrawingAreaProxyImplcpp">releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/DrawingAreaProxyImpl.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitUIProcessDrawingAreaProxyImplh">releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/DrawingAreaProxyImpl.h</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitWebProcessWebPageAcceleratedDrawingAreacpp">releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitWebProcessWebPageAcceleratedDrawingAreah">releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.h</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitWebProcessWebPageDrawingAreaImplcpp">releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/DrawingAreaImpl.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitWebProcessWebPageDrawingAreaImplh">releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/DrawingAreaImpl.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit224SourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebKit/ChangeLog (243981 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/ChangeLog 2019-04-08 10:14:55 UTC (rev 243981)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/ChangeLog 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -1,3 +1,114 @@
</span><ins>+2019-03-04 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [CoordinatedGraphics] Unify DrawingArea classes
+ https://bugs.webkit.org/show_bug.cgi?id=195167
+
+ Reviewed by Žan Doberšek.
+
+ Add DrawingAreaProxyCoordinatedGraphics and DrawingAreaCoordinatedGraphics.
+
+ * PlatformGTK.cmake:
+ * PlatformWPE.cmake:
+ * PlatformWin.cmake:
+ * Shared/DrawingAreaInfo.h:
+ * SourcesGTK.txt:
+ * SourcesWPE.txt:
+ * UIProcess/API/gtk/PageClientImpl.cpp:
+ (WebKit::PageClientImpl::createDrawingAreaProxy):
+ (WebKit::PageClientImpl::viewSize):
+ * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+ (webkitWebViewBaseRealize):
+ (webkitWebViewBaseUnrealize):
+ (webkitWebViewBaseDraw):
+ (webkitWebViewBaseSizeAllocate):
+ (webkitWebViewBaseDidRelaunchWebProcess):
+ (webkitWebViewBasePageClosed):
+ * UIProcess/API/wpe/PageClientImpl.cpp:
+ (WebKit::PageClientImpl::createDrawingAreaProxy):
+ * UIProcess/AcceleratedDrawingAreaProxy.cpp: Removed.
+ * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp: Added.
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingAreaProxyCoordinatedGraphics):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::~DrawingAreaProxyCoordinatedGraphics):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::paint):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::sizeDidChange):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::waitForBackingStoreUpdateOnNextPaint):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::setBackingStoreIsDiscardable):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::update):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::didUpdateBackingStoreState):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::enterAcceleratedCompositingMode):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::exitAcceleratedCompositingMode):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::updateAcceleratedCompositingMode):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::incorporateUpdate):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::alwaysUseCompositing const):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::backingStoreStateDidChange):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::sendUpdateBackingStoreState):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::waitForAndDispatchDidUpdateBackingStoreState):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::discardBackingStoreSoon):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::discardBackingStore):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::setNativeSurfaceHandleForCompositing):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::DrawingMonitor):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::~DrawingMonitor):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::webViewDrawCallback):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::start):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::stop):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::didDraw):
+ (WebKit::DrawingAreaProxyCoordinatedGraphics::dispatchAfterEnsuringDrawing):
+ * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h: Renamed from Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.h.
+ * UIProcess/DrawingAreaProxyImpl.cpp: Removed.
+ * UIProcess/DrawingAreaProxyImpl.h: Removed.
+ * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
+ (WebKit::AcceleratedBackingStoreX11::update):
+ * UIProcess/win/PageClientImpl.cpp:
+ (WebKit::PageClientImpl::createDrawingAreaProxy):
+ * UIProcess/win/WebView.cpp:
+ (WebKit::WebView::paint):
+ * WebProcess/WebPage/AcceleratedDrawingArea.cpp: Removed.
+ * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: Added.
+ (WebKit::DrawingAreaCoordinatedGraphics::DrawingAreaCoordinatedGraphics):
+ (WebKit::DrawingAreaCoordinatedGraphics::~DrawingAreaCoordinatedGraphics):
+ (WebKit::DrawingAreaCoordinatedGraphics::setNeedsDisplay):
+ (WebKit::DrawingAreaCoordinatedGraphics::setNeedsDisplayInRect):
+ (WebKit::DrawingAreaCoordinatedGraphics::scroll):
+ (WebKit::DrawingAreaCoordinatedGraphics::forceRepaint):
+ (WebKit::DrawingAreaCoordinatedGraphics::forceRepaintAsync):
+ (WebKit::DrawingAreaCoordinatedGraphics::setLayerTreeStateIsFrozen):
+ (WebKit::DrawingAreaCoordinatedGraphics::updatePreferences):
+ (WebKit::DrawingAreaCoordinatedGraphics::mainFrameContentSizeChanged):
+ (WebKit::DrawingAreaCoordinatedGraphics::deviceOrPageScaleFactorChanged):
+ (WebKit::DrawingAreaCoordinatedGraphics::didChangeViewportAttributes):
+ (WebKit::DrawingAreaCoordinatedGraphics::graphicsLayerFactory):
+ (WebKit::DrawingAreaCoordinatedGraphics::setRootCompositingLayer):
+ (WebKit::DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush):
+ (WebKit::DrawingAreaCoordinatedGraphics::layerHostDidFlushLayers):
+ (WebKit::DrawingAreaCoordinatedGraphics::createDisplayRefreshMonitor):
+ (WebKit::DrawingAreaCoordinatedGraphics::setNativeSurfaceHandleForCompositing):
+ (WebKit::DrawingAreaCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing):
+ (WebKit::DrawingAreaCoordinatedGraphics::activityStateDidChange):
+ (WebKit::DrawingAreaCoordinatedGraphics::attachViewOverlayGraphicsLayer):
+ (WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState):
+ (WebKit::DrawingAreaCoordinatedGraphics::didUpdate):
+ (WebKit::DrawingAreaCoordinatedGraphics::sendDidUpdateBackingStoreState):
+ (WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingModeSoon):
+ (WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingModeNow):
+ (WebKit::DrawingAreaCoordinatedGraphics::discardPreviousLayerTreeHost):
+ (WebKit::DrawingAreaCoordinatedGraphics::suspendPainting):
+ (WebKit::DrawingAreaCoordinatedGraphics::resumePainting):
+ (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode):
+ (WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingMode):
+ (WebKit::DrawingAreaCoordinatedGraphics::scheduleDisplay):
+ (WebKit::DrawingAreaCoordinatedGraphics::displayTimerFired):
+ (WebKit::DrawingAreaCoordinatedGraphics::display):
+ (WebKit::shouldPaintBoundsRect):
+ * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h: Renamed from Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.h.
+ * WebProcess/WebPage/DrawingArea.cpp:
+ (WebKit::DrawingArea::create):
+ * WebProcess/WebPage/DrawingArea.h:
+ (WebKit::DrawingArea::layerFlushThrottlingIsActive const):
+ * WebProcess/WebPage/DrawingAreaImpl.cpp: Removed.
+ * WebProcess/WebPage/DrawingAreaImpl.h: Removed.
+
</ins><span class="cx"> 2019-02-28 Carlos Garcia Campos <cgarcia@igalia.com>
</span><span class="cx">
</span><span class="cx"> [CoordinatedGraphics] Remove COORDINATED_GRAPHICS_THREADED option
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitPlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebKit/PlatformGTK.cmake (243981 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/PlatformGTK.cmake 2019-04-08 10:14:55 UTC (rev 243981)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/PlatformGTK.cmake 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -393,6 +393,7 @@
</span><span class="cx"> "${WEBKIT_DIR}/UIProcess/API/C/gtk"
</span><span class="cx"> "${WEBKIT_DIR}/UIProcess/API/glib"
</span><span class="cx"> "${WEBKIT_DIR}/UIProcess/API/gtk"
</span><ins>+ "${WEBKIT_DIR}/UIProcess/CoordinatedGraphics"
</ins><span class="cx"> "${WEBKIT_DIR}/UIProcess/Network/CustomProtocols/soup"
</span><span class="cx"> "${WEBKIT_DIR}/UIProcess/Plugins/gtk"
</span><span class="cx"> "${WEBKIT_DIR}/UIProcess/glib"
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitPlatformWPEcmake"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebKit/PlatformWPE.cmake (243981 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/PlatformWPE.cmake 2019-04-08 10:14:55 UTC (rev 243981)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/PlatformWPE.cmake 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -253,6 +253,7 @@
</span><span class="cx"> "${WEBKIT_DIR}/UIProcess/API/C/wpe"
</span><span class="cx"> "${WEBKIT_DIR}/UIProcess/API/glib"
</span><span class="cx"> "${WEBKIT_DIR}/UIProcess/API/wpe"
</span><ins>+ "${WEBKIT_DIR}/UIProcess/CoordinatedGraphics"
</ins><span class="cx"> "${WEBKIT_DIR}/UIProcess/Network/CustomProtocols/soup"
</span><span class="cx"> "${WEBKIT_DIR}/UIProcess/gstreamer"
</span><span class="cx"> "${WEBKIT_DIR}/UIProcess/linux"
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitPlatformWincmake"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebKit/PlatformWin.cmake (243981 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/PlatformWin.cmake 2019-04-08 10:14:55 UTC (rev 243981)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/PlatformWin.cmake 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -33,10 +33,8 @@
</span><span class="cx"> Shared/win/NativeWebWheelEventWin.cpp
</span><span class="cx"> Shared/win/WebEventFactory.cpp
</span><span class="cx">
</span><del>- UIProcess/AcceleratedDrawingAreaProxy.cpp
</del><span class="cx"> UIProcess/BackingStore.cpp
</span><span class="cx"> UIProcess/DefaultUndoController.cpp
</span><del>- UIProcess/DrawingAreaProxyImpl.cpp
</del><span class="cx"> UIProcess/LegacySessionStateCodingNone.cpp
</span><span class="cx"> UIProcess/WebGrammarDetail.cpp
</span><span class="cx"> UIProcess/WebViewportAttributes.cpp
</span><span class="lines">@@ -50,6 +48,8 @@
</span><span class="cx">
</span><span class="cx"> UIProcess/API/win/APIWebsiteDataStoreWin.cpp
</span><span class="cx">
</span><ins>+ UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp
+
</ins><span class="cx"> UIProcess/Launcher/win/ProcessLauncherWin.cpp
</span><span class="cx">
</span><span class="cx"> UIProcess/WebStorage/StorageManager.cpp
</span><span class="lines">@@ -78,11 +78,10 @@
</span><span class="cx"> WebProcess/WebCoreSupport/win/WebContextMenuClientWin.cpp
</span><span class="cx"> WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp
</span><span class="cx">
</span><del>- WebProcess/WebPage/AcceleratedDrawingArea.cpp
</del><span class="cx"> WebProcess/WebPage/AcceleratedSurface.cpp
</span><del>- WebProcess/WebPage/DrawingAreaImpl.cpp
</del><span class="cx">
</span><span class="cx"> WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp
</span><ins>+ WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp
</ins><span class="cx"> WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp
</span><span class="cx">
</span><span class="cx"> WebProcess/WebPage/win/WebInspectorUIWin.cpp
</span><span class="lines">@@ -115,6 +114,7 @@
</span><span class="cx"> "${WEBKIT_DIR}/UIProcess/API/C/win"
</span><span class="cx"> "${WEBKIT_DIR}/UIProcess/API/cpp/win"
</span><span class="cx"> "${WEBKIT_DIR}/UIProcess/API/win"
</span><ins>+ "${WEBKIT_DIR}/UIProcess/CoordinatedGraphics"
</ins><span class="cx"> "${WEBKIT_DIR}/UIProcess/Plugins/win"
</span><span class="cx"> "${WEBKIT_DIR}/UIProcess/win"
</span><span class="cx"> "${WEBKIT_DIR}/WebProcess/InjectedBundle/API/win"
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitSharedDrawingAreaInfoh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebKit/Shared/DrawingAreaInfo.h (243981 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/Shared/DrawingAreaInfo.h 2019-04-08 10:14:55 UTC (rev 243981)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/Shared/DrawingAreaInfo.h 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -33,8 +33,8 @@
</span><span class="cx"> DrawingAreaTypeTiledCoreAnimation,
</span><span class="cx"> #endif
</span><span class="cx"> DrawingAreaTypeRemoteLayerTree,
</span><del>-#else
- DrawingAreaTypeImpl
</del><ins>+#elif USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER)
+ DrawingAreaTypeCoordinatedGraphics
</ins><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitSourcesGTKtxt"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebKit/SourcesGTK.txt (243981 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/SourcesGTK.txt 2019-04-08 10:14:55 UTC (rev 243981)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/SourcesGTK.txt 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -107,10 +107,8 @@
</span><span class="cx">
</span><span class="cx"> Shared/unix/AuxiliaryProcessMain.cpp @no-unify
</span><span class="cx">
</span><del>-UIProcess/AcceleratedDrawingAreaProxy.cpp
</del><span class="cx"> UIProcess/BackingStore.cpp
</span><span class="cx"> UIProcess/DefaultUndoController.cpp
</span><del>-UIProcess/DrawingAreaProxyImpl.cpp
</del><span class="cx"> UIProcess/LegacySessionStateCodingNone.cpp
</span><span class="cx"> UIProcess/ViewGestureController.cpp
</span><span class="cx"> UIProcess/ViewSnapshotStore.cpp @no-unify
</span><span class="lines">@@ -209,6 +207,8 @@
</span><span class="cx">
</span><span class="cx"> UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp
</span><span class="cx">
</span><ins>+UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp
+
</ins><span class="cx"> UIProcess/Launcher/glib/ProcessLauncherGLib.cpp @no-unify
</span><span class="cx">
</span><span class="cx"> UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.cpp
</span><span class="lines">@@ -399,15 +399,13 @@
</span><span class="cx">
</span><span class="cx"> WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp
</span><span class="cx">
</span><del>-WebProcess/WebPage/AcceleratedDrawingArea.cpp
</del><span class="cx"> WebProcess/WebPage/AcceleratedSurface.cpp
</span><span class="cx"> WebProcess/WebPage/ViewGestureGeometryCollector.cpp
</span><span class="cx">
</span><span class="cx"> WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp
</span><ins>+WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp
</ins><span class="cx"> WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp
</span><span class="cx">
</span><del>-WebProcess/WebPage/DrawingAreaImpl.cpp
-
</del><span class="cx"> WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp
</span><span class="cx">
</span><span class="cx"> WebProcess/WebPage/gstreamer/WebPageGStreamer.cpp
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitSourcesWPEtxt"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebKit/SourcesWPE.txt (243981 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/SourcesWPE.txt 2019-04-08 10:14:55 UTC (rev 243981)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/SourcesWPE.txt 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -98,7 +98,6 @@
</span><span class="cx">
</span><span class="cx"> Shared/unix/AuxiliaryProcessMain.cpp
</span><span class="cx">
</span><del>-UIProcess/AcceleratedDrawingAreaProxy.cpp
</del><span class="cx"> UIProcess/DefaultUndoController.cpp
</span><span class="cx"> UIProcess/LegacySessionStateCodingNone.cpp
</span><span class="cx"> UIProcess/WebGrammarDetail.cpp
</span><span class="lines">@@ -182,6 +181,8 @@
</span><span class="cx">
</span><span class="cx"> UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp
</span><span class="cx">
</span><ins>+UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp
+
</ins><span class="cx"> UIProcess/glib/WebProcessPoolGLib.cpp
</span><span class="cx"> UIProcess/glib/WebProcessProxyGLib.cpp
</span><span class="cx">
</span><span class="lines">@@ -239,10 +240,10 @@
</span><span class="cx"> WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp
</span><span class="cx"> WebProcess/WebCoreSupport/wpe/WebPopupMenuWPE.cpp
</span><span class="cx">
</span><del>-WebProcess/WebPage/AcceleratedDrawingArea.cpp
</del><span class="cx"> WebProcess/WebPage/AcceleratedSurface.cpp
</span><span class="cx">
</span><span class="cx"> WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp
</span><ins>+WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp
</ins><span class="cx"> WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp
</span><span class="cx">
</span><span class="cx"> WebProcess/WebPage/gstreamer/WebPageGStreamer.cpp
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitUIProcessAPIgtkPageClientImplcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp (243981 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp 2019-04-08 10:14:55 UTC (rev 243981)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "PageClientImpl.h"
</span><span class="cx">
</span><del>-#include "DrawingAreaProxyImpl.h"
</del><ins>+#include "DrawingAreaProxyCoordinatedGraphics.h"
</ins><span class="cx"> #include "NativeWebKeyboardEvent.h"
</span><span class="cx"> #include "NativeWebMouseEvent.h"
</span><span class="cx"> #include "NativeWebWheelEvent.h"
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx"> // PageClient's pure virtual functions
</span><span class="cx"> std::unique_ptr<DrawingAreaProxy> PageClientImpl::createDrawingAreaProxy(WebProcessProxy& process)
</span><span class="cx"> {
</span><del>- return std::make_unique<DrawingAreaProxyImpl>(*webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(m_viewWidget)), process);
</del><ins>+ return std::make_unique<DrawingAreaProxyCoordinatedGraphics>(*webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(m_viewWidget)), process);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void PageClientImpl::setViewNeedsDisplay(const WebCore::Region& region)
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx">
</span><span class="cx"> WebCore::IntSize PageClientImpl::viewSize()
</span><span class="cx"> {
</span><del>- auto* drawingArea = static_cast<DrawingAreaProxyImpl*>(webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(m_viewWidget))->drawingArea());
</del><ins>+ auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(m_viewWidget))->drawingArea());
</ins><span class="cx"> return drawingArea ? drawingArea->size() : IntSize();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitUIProcessAPIgtkWebKitWebViewBasecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp (243981 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp 2019-04-08 10:14:55 UTC (rev 243981)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx">
</span><span class="cx"> #include "APIPageConfiguration.h"
</span><span class="cx"> #include "AcceleratedBackingStore.h"
</span><del>-#include "DrawingAreaProxyImpl.h"
</del><ins>+#include "DrawingAreaProxyCoordinatedGraphics.h"
</ins><span class="cx"> #include "InputMethodFilter.h"
</span><span class="cx"> #include "KeyBindingTranslator.h"
</span><span class="cx"> #include "NativeWebKeyboardEvent.h"
</span><span class="lines">@@ -378,7 +378,7 @@
</span><span class="cx">
</span><span class="cx"> #if USE(TEXTURE_MAPPER_GL) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
</span><span class="cx"> if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::X11) {
</span><del>- if (DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(priv->pageProxy->drawingArea()))
</del><ins>+ if (auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(priv->pageProxy->drawingArea()))
</ins><span class="cx"> drawingArea->setNativeSurfaceHandleForCompositing(GDK_WINDOW_XID(window));
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="lines">@@ -393,7 +393,7 @@
</span><span class="cx"> WebKitWebViewBase* webView = WEBKIT_WEB_VIEW_BASE(widget);
</span><span class="cx"> #if USE(TEXTURE_MAPPER_GL) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
</span><span class="cx"> if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::X11) {
</span><del>- if (DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(webView->priv->pageProxy->drawingArea()))
</del><ins>+ if (auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(webView->priv->pageProxy->drawingArea()))
</ins><span class="cx"> drawingArea->destroyNativeSurfaceHandleForCompositing();
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="lines">@@ -530,7 +530,7 @@
</span><span class="cx"> static gboolean webkitWebViewBaseDraw(GtkWidget* widget, cairo_t* cr)
</span><span class="cx"> {
</span><span class="cx"> WebKitWebViewBase* webViewBase = WEBKIT_WEB_VIEW_BASE(widget);
</span><del>- DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(webViewBase->priv->pageProxy->drawingArea());
</del><ins>+ auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(webViewBase->priv->pageProxy->drawingArea());
</ins><span class="cx"> if (!drawingArea)
</span><span class="cx"> return FALSE;
</span><span class="cx">
</span><span class="lines">@@ -616,7 +616,7 @@
</span><span class="cx"> gtk_widget_size_allocate(priv->dialog, &childAllocation);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(priv->pageProxy->drawingArea()))
</del><ins>+ if (auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(priv->pageProxy->drawingArea()))
</ins><span class="cx"> drawingArea->setSize(viewRect.size());
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1633,7 +1633,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> WebKitWebViewBasePrivate* priv = webkitWebViewBase->priv;
</span><del>- DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(priv->pageProxy->drawingArea());
</del><ins>+ auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(priv->pageProxy->drawingArea());
</ins><span class="cx"> ASSERT(drawingArea);
</span><span class="cx">
</span><span class="cx"> if (!gtk_widget_get_realized(GTK_WIDGET(webkitWebViewBase)))
</span><span class="lines">@@ -1658,7 +1658,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> WebKitWebViewBasePrivate* priv = webkitWebViewBase->priv;
</span><del>- DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(priv->pageProxy->drawingArea());
</del><ins>+ auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(priv->pageProxy->drawingArea());
</ins><span class="cx"> ASSERT(drawingArea);
</span><span class="cx"> drawingArea->destroyNativeSurfaceHandleForCompositing();
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitUIProcessAPIwpePageClientImplcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp (243981 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp 2019-04-08 10:14:55 UTC (rev 243981)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "PageClientImpl.h"
</span><span class="cx">
</span><del>-#include "AcceleratedDrawingAreaProxy.h"
</del><ins>+#include "DrawingAreaProxyCoordinatedGraphics.h"
</ins><span class="cx"> #include "NativeWebMouseEvent.h"
</span><span class="cx"> #include "NativeWebWheelEvent.h"
</span><span class="cx"> #include "ScrollGestureController.h"
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<DrawingAreaProxy> PageClientImpl::createDrawingAreaProxy(WebProcessProxy& process)
</span><span class="cx"> {
</span><del>- return std::make_unique<AcceleratedDrawingAreaProxy>(m_view.page(), process);
</del><ins>+ return std::make_unique<DrawingAreaProxyCoordinatedGraphics>(m_view.page(), process);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void PageClientImpl::setViewNeedsDisplay(const WebCore::Region&)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitUIProcessAcceleratedDrawingAreaProxycpp"></a>
<div class="delfile"><h4>Deleted: releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.cpp (243981 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.cpp 2019-04-08 10:14:55 UTC (rev 243981)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.cpp 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -1,273 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
- * Copyright (C) 2016 Igalia S.L.
- *
- * 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 "AcceleratedDrawingAreaProxy.h"
-
-#include "DrawingAreaMessages.h"
-#include "DrawingAreaProxyMessages.h"
-#include "LayerTreeContext.h"
-#include "UpdateInfo.h"
-#include "WebPageProxy.h"
-#include "WebPreferences.h"
-#include "WebProcessProxy.h"
-#include <WebCore/Region.h>
-
-#if PLATFORM(WAYLAND)
-#include "WaylandCompositor.h"
-#include <WebCore/PlatformDisplay.h>
-#endif
-
-namespace WebKit {
-using namespace WebCore;
-
-AcceleratedDrawingAreaProxy::AcceleratedDrawingAreaProxy(WebPageProxy& webPageProxy, WebProcessProxy& process)
- : DrawingAreaProxy(DrawingAreaTypeImpl, webPageProxy, process)
-{
-}
-
-AcceleratedDrawingAreaProxy::~AcceleratedDrawingAreaProxy()
-{
- // Make sure to exit accelerated compositing mode.
- if (isInAcceleratedCompositingMode())
- exitAcceleratedCompositingMode();
-}
-
-bool AcceleratedDrawingAreaProxy::alwaysUseCompositing() const
-{
- return m_webPageProxy.preferences().acceleratedCompositingEnabled() && m_webPageProxy.preferences().forceCompositingMode();
-}
-
-void AcceleratedDrawingAreaProxy::dispatchAfterEnsuringDrawing(WTF::Function<void(CallbackBase::Error)>&& callbackFunction)
-{
- if (!m_webPageProxy.isValid()) {
- callbackFunction(CallbackBase::Error::OwnerWasInvalidated);
- return;
- }
-
- RunLoop::main().dispatch([callbackFunction = WTFMove(callbackFunction)] {
- callbackFunction(CallbackBase::Error::None);
- });
-}
-
-void AcceleratedDrawingAreaProxy::sizeDidChange()
-{
- backingStoreStateDidChange(RespondImmediately);
-}
-
-void AcceleratedDrawingAreaProxy::deviceScaleFactorDidChange()
-{
- backingStoreStateDidChange(RespondImmediately);
-}
-
-void AcceleratedDrawingAreaProxy::visibilityDidChange()
-{
- // If we don't have a backing store, go ahead and mark the backing store as being changed so
- // that when paint we'll actually wait for something to paint and not flash white.
- if (m_layerTreeContext.isEmpty())
- backingStoreStateDidChange(DoNotRespondImmediately);
-}
-
-void AcceleratedDrawingAreaProxy::waitForBackingStoreUpdateOnNextPaint()
-{
- m_hasReceivedFirstUpdate = true;
-}
-
-void AcceleratedDrawingAreaProxy::didUpdateBackingStoreState(uint64_t backingStoreStateID, const UpdateInfo& updateInfo, const LayerTreeContext& layerTreeContext)
-{
- ASSERT_ARG(backingStoreStateID, backingStoreStateID <= m_nextBackingStoreStateID);
- ASSERT_ARG(backingStoreStateID, backingStoreStateID > m_currentBackingStoreStateID);
- m_currentBackingStoreStateID = backingStoreStateID;
-
- m_isWaitingForDidUpdateBackingStoreState = false;
-
- // Stop the responsiveness timer that was started in sendUpdateBackingStoreState.
- process().responsivenessTimer().stop();
-
- if (layerTreeContext != m_layerTreeContext) {
- if (layerTreeContext.isEmpty() && !m_layerTreeContext.isEmpty()) {
- exitAcceleratedCompositingMode();
- ASSERT(m_layerTreeContext.isEmpty());
- } else if (!layerTreeContext.isEmpty() && m_layerTreeContext.isEmpty()) {
- enterAcceleratedCompositingMode(layerTreeContext);
- ASSERT(layerTreeContext == m_layerTreeContext);
- } else {
- updateAcceleratedCompositingMode(layerTreeContext);
- ASSERT(layerTreeContext == m_layerTreeContext);
- }
- }
-
- if (m_nextBackingStoreStateID != m_currentBackingStoreStateID)
- sendUpdateBackingStoreState(RespondImmediately);
- else {
- m_hasReceivedFirstUpdate = true;
-
-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
- if (m_pendingNativeSurfaceHandleForCompositing) {
- setNativeSurfaceHandleForCompositing(m_pendingNativeSurfaceHandleForCompositing);
- m_pendingNativeSurfaceHandleForCompositing = 0;
- }
-#endif
- }
-}
-
-void AcceleratedDrawingAreaProxy::enterAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext& layerTreeContext)
-{
- ASSERT_ARG(backingStoreStateID, backingStoreStateID <= m_currentBackingStoreStateID);
- if (backingStoreStateID < m_currentBackingStoreStateID)
- return;
-
- enterAcceleratedCompositingMode(layerTreeContext);
-}
-
-void AcceleratedDrawingAreaProxy::exitAcceleratedCompositingMode(uint64_t backingStoreStateID, const UpdateInfo& updateInfo)
-{
- ASSERT_ARG(backingStoreStateID, backingStoreStateID <= m_currentBackingStoreStateID);
- if (backingStoreStateID < m_currentBackingStoreStateID)
- return;
-
- exitAcceleratedCompositingMode();
-}
-
-void AcceleratedDrawingAreaProxy::updateAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext& layerTreeContext)
-{
- ASSERT_ARG(backingStoreStateID, backingStoreStateID <= m_currentBackingStoreStateID);
- if (backingStoreStateID < m_currentBackingStoreStateID)
- return;
-
- updateAcceleratedCompositingMode(layerTreeContext);
-}
-
-void AcceleratedDrawingAreaProxy::backingStoreStateDidChange(RespondImmediatelyOrNot respondImmediatelyOrNot)
-{
- ++m_nextBackingStoreStateID;
- sendUpdateBackingStoreState(respondImmediatelyOrNot);
-}
-
-void AcceleratedDrawingAreaProxy::sendUpdateBackingStoreState(RespondImmediatelyOrNot respondImmediatelyOrNot)
-{
- ASSERT(m_currentBackingStoreStateID < m_nextBackingStoreStateID);
-
- if (!m_webPageProxy.isValid())
- return;
-
- if (m_isWaitingForDidUpdateBackingStoreState)
- return;
-
- if (m_webPageProxy.viewSize().isEmpty() && !m_webPageProxy.useFixedLayout())
- return;
-
- m_isWaitingForDidUpdateBackingStoreState = respondImmediatelyOrNot == RespondImmediately;
-
- process().send(Messages::DrawingArea::UpdateBackingStoreState(m_nextBackingStoreStateID, respondImmediatelyOrNot == RespondImmediately, m_webPageProxy.deviceScaleFactor(), m_size, m_scrollOffset), m_webPageProxy.pageID());
- m_scrollOffset = IntSize();
-
- if (m_isWaitingForDidUpdateBackingStoreState) {
- // Start the responsiveness timer. We will stop it when we hear back from the WebProcess
- // in didUpdateBackingStoreState.
- process().responsivenessTimer().start();
- }
-
- if (m_isWaitingForDidUpdateBackingStoreState && !m_layerTreeContext.isEmpty()) {
- // Wait for the DidUpdateBackingStoreState message. Normally we do this in AcceleratedDrawingAreaProxy::paint, but that
- // function is never called when in accelerated compositing mode.
- waitForAndDispatchDidUpdateBackingStoreState();
- }
-}
-
-void AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState()
-{
- ASSERT(m_isWaitingForDidUpdateBackingStoreState);
-
- if (!m_webPageProxy.isValid())
- return;
- if (process().state() == WebProcessProxy::State::Launching)
- return;
- if (!m_webPageProxy.isViewVisible())
- return;
-#if PLATFORM(WAYLAND) && USE(EGL)
- // Never block the UI process in Wayland when waiting for DidUpdateBackingStoreState after a resize,
- // because the nested compositor needs to handle the web process requests that happens while resizing.
- if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::Wayland && isInAcceleratedCompositingMode())
- return;
-#endif
-
- // FIXME: waitForAndDispatchImmediately will always return the oldest DidUpdateBackingStoreState message that
- // hasn't yet been processed. But it might be better to skip ahead to some other DidUpdateBackingStoreState
- // message, if multiple DidUpdateBackingStoreState messages are waiting to be processed. For instance, we could
- // choose the most recent one, or the one that is closest to our current size.
-
- // The timeout, in seconds, we use when waiting for a DidUpdateBackingStoreState message when we're asked to paint.
- process().connection()->waitForAndDispatchImmediately<Messages::DrawingAreaProxy::DidUpdateBackingStoreState>(m_webPageProxy.pageID(), Seconds::fromMilliseconds(500));
-}
-
-void AcceleratedDrawingAreaProxy::enterAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext)
-{
- ASSERT(alwaysUseCompositing() || !isInAcceleratedCompositingMode());
-
- m_layerTreeContext = layerTreeContext;
- m_webPageProxy.enterAcceleratedCompositingMode(layerTreeContext);
-}
-
-void AcceleratedDrawingAreaProxy::exitAcceleratedCompositingMode()
-{
- ASSERT(isInAcceleratedCompositingMode());
-
- m_layerTreeContext = LayerTreeContext();
- m_webPageProxy.exitAcceleratedCompositingMode();
-}
-
-void AcceleratedDrawingAreaProxy::updateAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext)
-{
- ASSERT(isInAcceleratedCompositingMode());
-
- m_layerTreeContext = layerTreeContext;
- m_webPageProxy.updateAcceleratedCompositingMode(layerTreeContext);
-}
-
-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
-void AcceleratedDrawingAreaProxy::setNativeSurfaceHandleForCompositing(uint64_t handle)
-{
- if (!m_hasReceivedFirstUpdate) {
- m_pendingNativeSurfaceHandleForCompositing = handle;
- return;
- }
- process().send(Messages::DrawingArea::SetNativeSurfaceHandleForCompositing(handle), m_webPageProxy.pageID(), IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
-}
-
-void AcceleratedDrawingAreaProxy::destroyNativeSurfaceHandleForCompositing()
-{
- if (m_pendingNativeSurfaceHandleForCompositing) {
- m_pendingNativeSurfaceHandleForCompositing = 0;
- return;
- }
- bool handled;
- process().sendSync(Messages::DrawingArea::DestroyNativeSurfaceHandleForCompositing(), Messages::DrawingArea::DestroyNativeSurfaceHandleForCompositing::Reply(handled), m_webPageProxy.pageID());
-}
-#endif
-
-} // namespace WebKit
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitUIProcessAcceleratedDrawingAreaProxyh"></a>
<div class="delfile"><h4>Deleted: releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.h (243981 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.h 2019-04-08 10:14:55 UTC (rev 243981)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.h 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -1,98 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
- * Copyright (C) 2016 Igalia S.L.
- *
- * 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
-
-#include "DrawingAreaProxy.h"
-#include "LayerTreeContext.h"
-
-namespace WebKit {
-
-class AcceleratedDrawingAreaProxy : public DrawingAreaProxy {
-public:
- AcceleratedDrawingAreaProxy(WebPageProxy&, WebProcessProxy&);
- virtual ~AcceleratedDrawingAreaProxy();
-
- bool isInAcceleratedCompositingMode() const { return alwaysUseCompositing() || !m_layerTreeContext.isEmpty(); }
- void visibilityDidChange();
-
-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
- void setNativeSurfaceHandleForCompositing(uint64_t);
- void destroyNativeSurfaceHandleForCompositing();
-#endif
-
- void dispatchAfterEnsuringDrawing(WTF::Function<void(CallbackBase::Error)>&&) override;
-
-protected:
- // DrawingAreaProxy
- void sizeDidChange() override;
- void deviceScaleFactorDidChange() override;
- void waitForBackingStoreUpdateOnNextPaint() override;
-
- // IPC message handlers
- void didUpdateBackingStoreState(uint64_t backingStoreStateID, const UpdateInfo&, const LayerTreeContext&) override;
- void enterAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&) override;
- void exitAcceleratedCompositingMode(uint64_t backingStoreStateID, const UpdateInfo&) override;
- void updateAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&) override;
-
- enum RespondImmediatelyOrNot { DoNotRespondImmediately, RespondImmediately };
- void backingStoreStateDidChange(RespondImmediatelyOrNot);
- void sendUpdateBackingStoreState(RespondImmediatelyOrNot);
- void waitForAndDispatchDidUpdateBackingStoreState();
-
- virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
- void exitAcceleratedCompositingMode();
- void updateAcceleratedCompositingMode(const LayerTreeContext&);
-
- bool alwaysUseCompositing() const;
-
- // The state ID corresponding to our current backing store. Updated whenever we allocate
- // a new backing store. Any messages received that correspond to an earlier state are ignored,
- // as they don't apply to our current backing store.
- uint64_t m_currentBackingStoreStateID { 0 };
-
- // The next backing store state ID we will request the web process update to. Incremented
- // whenever our state changes in a way that will require a new backing store to be allocated.
- uint64_t m_nextBackingStoreStateID { 0 };
-
- // The current layer tree context.
- LayerTreeContext m_layerTreeContext;
-
- // Whether we've sent a UpdateBackingStoreState message and are now waiting for a DidUpdateBackingStoreState message.
- // Used to throttle UpdateBackingStoreState messages so we don't send them faster than the Web process can handle.
- bool m_isWaitingForDidUpdateBackingStoreState { false };
-
- // For a new Drawing Area don't draw anything until the WebProcess has sent over the first content.
- bool m_hasReceivedFirstUpdate { false };
-
-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
- uint64_t m_pendingNativeSurfaceHandleForCompositing { 0 };
-#endif
-};
-
-} // namespace WebKit
-
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitUIProcessCoordinatedGraphicsDrawingAreaProxyCoordinatedGraphicscpp"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp (0 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp (rev 0)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -0,0 +1,479 @@
</span><ins>+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ * Copyright (C) 2016-2019 Igalia S.L.
+ *
+ * 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 "DrawingAreaProxyCoordinatedGraphics.h"
+
+#include "DrawingAreaMessages.h"
+#include "DrawingAreaProxyMessages.h"
+#include "LayerTreeContext.h"
+#include "UpdateInfo.h"
+#include "WebPageProxy.h"
+#include "WebPreferences.h"
+#include "WebProcessProxy.h"
+#include <WebCore/Region.h>
+
+#if PLATFORM(GTK)
+#include <gtk/gtk.h>
+#endif
+
+#if PLATFORM(WAYLAND)
+#include "WaylandCompositor.h"
+#include <WebCore/PlatformDisplay.h>
+#endif
+
+#if USE(GLIB_EVENT_LOOP)
+#include <wtf/glib/RunLoopSourcePriority.h>
+#endif
+
+namespace WebKit {
+using namespace WebCore;
+
+DrawingAreaProxyCoordinatedGraphics::DrawingAreaProxyCoordinatedGraphics(WebPageProxy& webPageProxy, WebProcessProxy& process)
+ : DrawingAreaProxy(DrawingAreaTypeCoordinatedGraphics, webPageProxy, process)
+#if !PLATFORM(WPE)
+ , m_discardBackingStoreTimer(RunLoop::current(), this, &DrawingAreaProxyCoordinatedGraphics::discardBackingStore)
+#endif
+{
+#if USE(GLIB_EVENT_LOOP) && !PLATFORM(WPE)
+ m_discardBackingStoreTimer.setPriority(RunLoopSourcePriority::ReleaseUnusedResourcesTimer);
+#endif
+}
+
+DrawingAreaProxyCoordinatedGraphics::~DrawingAreaProxyCoordinatedGraphics()
+{
+ // Make sure to exit accelerated compositing mode.
+ if (isInAcceleratedCompositingMode() && !alwaysUseCompositing())
+ exitAcceleratedCompositingMode();
+}
+
+#if !PLATFORM(WPE)
+void DrawingAreaProxyCoordinatedGraphics::paint(BackingStore::PlatformGraphicsContext context, const IntRect& rect, Region& unpaintedRegion)
+{
+ unpaintedRegion = rect;
+
+ if (isInAcceleratedCompositingMode())
+ return;
+
+ ASSERT(m_currentBackingStoreStateID <= m_nextBackingStoreStateID);
+ if (m_currentBackingStoreStateID < m_nextBackingStoreStateID) {
+ // Tell the web process to do a full backing store update now, in case we previously told
+ // it about our next state but didn't request an immediate update.
+ sendUpdateBackingStoreState(RespondImmediately);
+
+ // If we haven't yet received our first bits from the WebProcess then don't paint anything.
+ if (!m_hasReceivedFirstUpdate)
+ return;
+
+ if (m_isWaitingForDidUpdateBackingStoreState) {
+ // Wait for a DidUpdateBackingStoreState message that contains the new bits before we paint
+ // what's currently in the backing store.
+ waitForAndDispatchDidUpdateBackingStoreState();
+ }
+
+ // Dispatching DidUpdateBackingStoreState (either beneath sendUpdateBackingStoreState or
+ // beneath waitForAndDispatchDidUpdateBackingStoreState) could destroy our backing store or
+ // change the compositing mode.
+ if (!m_backingStore || isInAcceleratedCompositingMode())
+ return;
+ } else {
+ ASSERT(!m_isWaitingForDidUpdateBackingStoreState);
+ if (!m_backingStore) {
+ // The view has asked us to paint before the web process has painted anything. There's
+ // nothing we can do.
+ return;
+ }
+ }
+
+ m_backingStore->paint(context, rect);
+ unpaintedRegion.subtract(IntRect(IntPoint(), m_backingStore->size()));
+
+ discardBackingStoreSoon();
+}
+#endif
+
+void DrawingAreaProxyCoordinatedGraphics::sizeDidChange()
+{
+ backingStoreStateDidChange(RespondImmediately);
+}
+
+void DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange()
+{
+ backingStoreStateDidChange(RespondImmediately);
+}
+
+void DrawingAreaProxyCoordinatedGraphics::waitForBackingStoreUpdateOnNextPaint()
+{
+ m_hasReceivedFirstUpdate = true;
+}
+
+void DrawingAreaProxyCoordinatedGraphics::setBackingStoreIsDiscardable(bool isBackingStoreDiscardable)
+{
+#if !PLATFORM(WPE)
+ if (m_isBackingStoreDiscardable == isBackingStoreDiscardable)
+ return;
+
+ m_isBackingStoreDiscardable = isBackingStoreDiscardable;
+ if (m_isBackingStoreDiscardable)
+ discardBackingStoreSoon();
+ else
+ m_discardBackingStoreTimer.stop();
+#endif
+}
+
+void DrawingAreaProxyCoordinatedGraphics::update(uint64_t backingStoreStateID, const UpdateInfo& updateInfo)
+{
+ ASSERT_ARG(backingStoreStateID, backingStoreStateID <= m_currentBackingStoreStateID);
+ if (backingStoreStateID < m_currentBackingStoreStateID)
+ return;
+
+ // FIXME: Handle the case where the view is hidden.
+
+#if !PLATFORM(WPE)
+ incorporateUpdate(updateInfo);
+#endif
+ process().send(Messages::DrawingArea::DidUpdate(), m_webPageProxy.pageID());
+}
+
+void DrawingAreaProxyCoordinatedGraphics::didUpdateBackingStoreState(uint64_t backingStoreStateID, const UpdateInfo& updateInfo, const LayerTreeContext& layerTreeContext)
+{
+ ASSERT_ARG(backingStoreStateID, backingStoreStateID <= m_nextBackingStoreStateID);
+ ASSERT_ARG(backingStoreStateID, backingStoreStateID > m_currentBackingStoreStateID);
+ m_currentBackingStoreStateID = backingStoreStateID;
+
+ m_isWaitingForDidUpdateBackingStoreState = false;
+
+ // Stop the responsiveness timer that was started in sendUpdateBackingStoreState.
+ process().responsivenessTimer().stop();
+
+ if (layerTreeContext != m_layerTreeContext) {
+ if (layerTreeContext.isEmpty() && !m_layerTreeContext.isEmpty()) {
+ exitAcceleratedCompositingMode();
+ ASSERT(m_layerTreeContext.isEmpty());
+ } else if (!layerTreeContext.isEmpty() && m_layerTreeContext.isEmpty()) {
+ enterAcceleratedCompositingMode(layerTreeContext);
+ ASSERT(layerTreeContext == m_layerTreeContext);
+ } else {
+ updateAcceleratedCompositingMode(layerTreeContext);
+ ASSERT(layerTreeContext == m_layerTreeContext);
+ }
+ }
+
+ if (m_nextBackingStoreStateID != m_currentBackingStoreStateID)
+ sendUpdateBackingStoreState(RespondImmediately);
+ else {
+ m_hasReceivedFirstUpdate = true;
+
+#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
+ if (m_pendingNativeSurfaceHandleForCompositing) {
+ setNativeSurfaceHandleForCompositing(m_pendingNativeSurfaceHandleForCompositing);
+ m_pendingNativeSurfaceHandleForCompositing = 0;
+ }
+#endif
+ }
+
+#if !PLATFORM(WPE)
+ if (isInAcceleratedCompositingMode()) {
+ ASSERT(!m_backingStore);
+ return;
+ }
+
+ // If we have a backing store the right size, reuse it.
+ if (m_backingStore && (m_backingStore->size() != updateInfo.viewSize || m_backingStore->deviceScaleFactor() != updateInfo.deviceScaleFactor))
+ m_backingStore = nullptr;
+ incorporateUpdate(updateInfo);
+#endif
+}
+
+void DrawingAreaProxyCoordinatedGraphics::enterAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext& layerTreeContext)
+{
+ ASSERT_ARG(backingStoreStateID, backingStoreStateID <= m_currentBackingStoreStateID);
+ if (backingStoreStateID < m_currentBackingStoreStateID)
+ return;
+
+ enterAcceleratedCompositingMode(layerTreeContext);
+}
+
+void DrawingAreaProxyCoordinatedGraphics::exitAcceleratedCompositingMode(uint64_t backingStoreStateID, const UpdateInfo& updateInfo)
+{
+ ASSERT_ARG(backingStoreStateID, backingStoreStateID <= m_currentBackingStoreStateID);
+ if (backingStoreStateID < m_currentBackingStoreStateID)
+ return;
+
+ exitAcceleratedCompositingMode();
+#if !PLATFORM(WPE)
+ incorporateUpdate(updateInfo);
+#endif
+}
+
+void DrawingAreaProxyCoordinatedGraphics::updateAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext& layerTreeContext)
+{
+ ASSERT_ARG(backingStoreStateID, backingStoreStateID <= m_currentBackingStoreStateID);
+ if (backingStoreStateID < m_currentBackingStoreStateID)
+ return;
+
+ updateAcceleratedCompositingMode(layerTreeContext);
+}
+
+#if !PLATFORM(WPE)
+void DrawingAreaProxyCoordinatedGraphics::incorporateUpdate(const UpdateInfo& updateInfo)
+{
+ ASSERT(!isInAcceleratedCompositingMode());
+
+ if (updateInfo.updateRectBounds.isEmpty())
+ return;
+
+ if (!m_backingStore)
+ m_backingStore = std::make_unique<BackingStore>(updateInfo.viewSize, updateInfo.deviceScaleFactor, m_webPageProxy);
+
+ m_backingStore->incorporateUpdate(updateInfo);
+
+ Region damageRegion;
+ if (updateInfo.scrollRect.isEmpty()) {
+ for (const auto& rect : updateInfo.updateRects)
+ damageRegion.unite(rect);
+ } else
+ damageRegion = IntRect(IntPoint(), m_webPageProxy.viewSize());
+ m_webPageProxy.setViewNeedsDisplay(damageRegion);
+}
+#endif
+
+bool DrawingAreaProxyCoordinatedGraphics::alwaysUseCompositing() const
+{
+ return m_webPageProxy.preferences().acceleratedCompositingEnabled() && m_webPageProxy.preferences().forceCompositingMode();
+}
+
+void DrawingAreaProxyCoordinatedGraphics::enterAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext)
+{
+ ASSERT(alwaysUseCompositing() || !isInAcceleratedCompositingMode());
+#if !PLATFORM(WPE)
+ m_backingStore = nullptr;
+#endif
+ m_layerTreeContext = layerTreeContext;
+ m_webPageProxy.enterAcceleratedCompositingMode(layerTreeContext);
+}
+
+void DrawingAreaProxyCoordinatedGraphics::exitAcceleratedCompositingMode()
+{
+ ASSERT(isInAcceleratedCompositingMode());
+
+ m_layerTreeContext = { };
+ m_webPageProxy.exitAcceleratedCompositingMode();
+}
+
+void DrawingAreaProxyCoordinatedGraphics::updateAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext)
+{
+ ASSERT(isInAcceleratedCompositingMode());
+
+ m_layerTreeContext = layerTreeContext;
+ m_webPageProxy.updateAcceleratedCompositingMode(layerTreeContext);
+}
+
+void DrawingAreaProxyCoordinatedGraphics::backingStoreStateDidChange(RespondImmediatelyOrNot respondImmediatelyOrNot)
+{
+ ++m_nextBackingStoreStateID;
+ sendUpdateBackingStoreState(respondImmediatelyOrNot);
+}
+
+void DrawingAreaProxyCoordinatedGraphics::sendUpdateBackingStoreState(RespondImmediatelyOrNot respondImmediatelyOrNot)
+{
+ ASSERT(m_currentBackingStoreStateID < m_nextBackingStoreStateID);
+
+ if (!m_webPageProxy.isValid())
+ return;
+
+ if (m_isWaitingForDidUpdateBackingStoreState)
+ return;
+
+ if (m_webPageProxy.viewSize().isEmpty() && !m_webPageProxy.useFixedLayout())
+ return;
+
+ m_isWaitingForDidUpdateBackingStoreState = respondImmediatelyOrNot == RespondImmediately;
+
+ process().send(Messages::DrawingArea::UpdateBackingStoreState(m_nextBackingStoreStateID, respondImmediatelyOrNot == RespondImmediately, m_webPageProxy.deviceScaleFactor(), m_size, m_scrollOffset), m_webPageProxy.pageID());
+
+ m_scrollOffset = IntSize();
+
+ if (m_isWaitingForDidUpdateBackingStoreState) {
+ // Start the responsiveness timer. We will stop it when we hear back from the WebProcess
+ // in didUpdateBackingStoreState.
+ process().responsivenessTimer().start();
+ }
+
+ if (m_isWaitingForDidUpdateBackingStoreState && !m_layerTreeContext.isEmpty()) {
+ // Wait for the DidUpdateBackingStoreState message. Normally we do this in DrawingAreaProxyCoordinatedGraphics::paint, but that
+ // function is never called when in accelerated compositing mode.
+ waitForAndDispatchDidUpdateBackingStoreState();
+ }
+}
+
+void DrawingAreaProxyCoordinatedGraphics::waitForAndDispatchDidUpdateBackingStoreState()
+{
+ ASSERT(m_isWaitingForDidUpdateBackingStoreState);
+
+ if (!m_webPageProxy.isValid())
+ return;
+ if (process().state() == WebProcessProxy::State::Launching)
+ return;
+ if (!m_webPageProxy.isViewVisible())
+ return;
+#if PLATFORM(WAYLAND) && USE(EGL)
+ // Never block the UI process in Wayland when waiting for DidUpdateBackingStoreState after a resize,
+ // because the nested compositor needs to handle the web process requests that happens while resizing.
+ if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::Wayland && isInAcceleratedCompositingMode())
+ return;
+#endif
+
+ // FIXME: waitForAndDispatchImmediately will always return the oldest DidUpdateBackingStoreState message that
+ // hasn't yet been processed. But it might be better to skip ahead to some other DidUpdateBackingStoreState
+ // message, if multiple DidUpdateBackingStoreState messages are waiting to be processed. For instance, we could
+ // choose the most recent one, or the one that is closest to our current size.
+
+ // The timeout, in seconds, we use when waiting for a DidUpdateBackingStoreState message when we're asked to paint.
+ process().connection()->waitForAndDispatchImmediately<Messages::DrawingAreaProxy::DidUpdateBackingStoreState>(m_webPageProxy.pageID(), Seconds::fromMilliseconds(500));
+}
+
+#if !PLATFORM(WPE)
+void DrawingAreaProxyCoordinatedGraphics::discardBackingStoreSoon()
+{
+ if (!m_backingStore || !m_isBackingStoreDiscardable || m_discardBackingStoreTimer.isActive())
+ return;
+
+ // We'll wait this many seconds after the last paint before throwing away our backing store to save memory.
+ // FIXME: It would be smarter to make this delay based on how expensive painting is. See <http://webkit.org/b/55733>.
+ static const Seconds discardBackingStoreDelay = 2_s;
+
+ m_discardBackingStoreTimer.startOneShot(discardBackingStoreDelay);
+}
+
+void DrawingAreaProxyCoordinatedGraphics::discardBackingStore()
+{
+ if (!m_backingStore)
+ return;
+ m_backingStore = nullptr;
+ backingStoreStateDidChange(DoNotRespondImmediately);
+}
+#endif
+
+#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
+void DrawingAreaProxyCoordinatedGraphics::setNativeSurfaceHandleForCompositing(uint64_t handle)
+{
+ if (!m_hasReceivedFirstUpdate) {
+ m_pendingNativeSurfaceHandleForCompositing = handle;
+ return;
+ }
+ process().send(Messages::DrawingArea::SetNativeSurfaceHandleForCompositing(handle), m_webPageProxy.pageID(), IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
+}
+
+void DrawingAreaProxyCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing()
+{
+ if (m_pendingNativeSurfaceHandleForCompositing) {
+ m_pendingNativeSurfaceHandleForCompositing = 0;
+ return;
+ }
+ bool handled;
+ process().sendSync(Messages::DrawingArea::DestroyNativeSurfaceHandleForCompositing(), Messages::DrawingArea::DestroyNativeSurfaceHandleForCompositing::Reply(handled), m_webPageProxy.pageID());
+}
+#endif
+
+DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::DrawingMonitor(WebPageProxy& webPage)
+ : m_timer(RunLoop::main(), this, &DrawingMonitor::stop)
+#if PLATFORM(GTK)
+ , m_webPage(webPage)
+#endif
+{
+#if USE(GLIB_EVENT_LOOP)
+#if PLATFORM(GTK)
+ // Give redraws more priority.
+ m_timer.setPriority(GDK_PRIORITY_REDRAW - 10);
+#else
+ m_timer.setPriority(RunLoopSourcePriority::RunLoopDispatcher);
+#endif
+#endif
+}
+
+DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::~DrawingMonitor()
+{
+ m_callback = nullptr;
+ stop();
+}
+
+int DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::webViewDrawCallback(DrawingAreaProxyCoordinatedGraphics::DrawingMonitor* monitor)
+{
+ monitor->didDraw();
+ return FALSE;
+}
+
+void DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::start(WTF::Function<void(CallbackBase::Error)>&& callback)
+{
+ m_startTime = MonotonicTime::now();
+ m_callback = WTFMove(callback);
+#if PLATFORM(GTK)
+ g_signal_connect_swapped(m_webPage.viewWidget(), "draw", reinterpret_cast<GCallback>(webViewDrawCallback), this);
+ m_timer.startOneShot(1_s);
+#else
+ m_timer.startOneShot(0_s);
+#endif
+}
+
+void DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::stop()
+{
+ m_timer.stop();
+#if PLATFORM(GTK)
+ g_signal_handlers_disconnect_by_func(m_webPage.viewWidget(), reinterpret_cast<gpointer>(webViewDrawCallback), this);
+#endif
+ m_startTime = MonotonicTime();
+ if (m_callback) {
+ m_callback(CallbackBase::Error::None);
+ m_callback = nullptr;
+ }
+}
+
+void DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::didDraw()
+{
+ // We wait up to 1 second for draw events. If there are several draw events queued quickly,
+ // we want to wait until all of them have been processed, so after receiving a draw, we wait
+ // up to 100ms for the next one or stop.
+ if (MonotonicTime::now() - m_startTime > 1_s)
+ stop();
+ else
+ m_timer.startOneShot(100_ms);
+}
+
+void DrawingAreaProxyCoordinatedGraphics::dispatchAfterEnsuringDrawing(WTF::Function<void(CallbackBase::Error)>&& callbackFunction)
+{
+ if (!m_webPageProxy.isValid()) {
+ callbackFunction(CallbackBase::Error::OwnerWasInvalidated);
+ return;
+ }
+
+ if (!m_drawingMonitor)
+ m_drawingMonitor = std::make_unique<DrawingAreaProxyCoordinatedGraphics::DrawingMonitor>(m_webPageProxy);
+ m_drawingMonitor->start(WTFMove(callbackFunction));
+}
+
+} // namespace WebKit
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitUIProcessCoordinatedGraphicsDrawingAreaProxyCoordinatedGraphicshfromrev243981releasesWebKitGTKwebkit224SourceWebKitUIProcessAcceleratedDrawingAreaProxyh"></a>
<div class="copfile"><h4>Copied: releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h (from rev 243981, releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.h) (0 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h (rev 0)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -0,0 +1,145 @@
</span><ins>+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ * Copyright (C) 2016-2019 Igalia S.L.
+ *
+ * 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
+
+#include "BackingStore.h"
+#include "DrawingAreaProxy.h"
+#include "LayerTreeContext.h"
+#include <wtf/RunLoop.h>
+
+namespace WebCore {
+class Region;
+}
+
+namespace WebKit {
+
+class DrawingAreaProxyCoordinatedGraphics final : public DrawingAreaProxy {
+public:
+ DrawingAreaProxyCoordinatedGraphics(WebPageProxy&, WebProcessProxy&);
+ virtual ~DrawingAreaProxyCoordinatedGraphics();
+
+#if !PLATFORM(WPE)
+ void paint(BackingStore::PlatformGraphicsContext, const WebCore::IntRect&, WebCore::Region& unpaintedRegion);
+#endif
+
+ bool isInAcceleratedCompositingMode() const { return alwaysUseCompositing() || !m_layerTreeContext.isEmpty(); }
+
+#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
+ void setNativeSurfaceHandleForCompositing(uint64_t);
+ void destroyNativeSurfaceHandleForCompositing();
+#endif
+
+private:
+ // DrawingAreaProxy
+ void sizeDidChange() override;
+ void deviceScaleFactorDidChange() override;
+ void waitForBackingStoreUpdateOnNextPaint() override;
+ void setBackingStoreIsDiscardable(bool) override;
+
+ // IPC message handlers
+ void update(uint64_t backingStoreStateID, const UpdateInfo&) override;
+ void didUpdateBackingStoreState(uint64_t backingStoreStateID, const UpdateInfo&, const LayerTreeContext&) override;
+ void enterAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&) override;
+ void exitAcceleratedCompositingMode(uint64_t backingStoreStateID, const UpdateInfo&) override;
+ void updateAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&) override;
+
+#if !PLATFORM(WPE)
+ void incorporateUpdate(const UpdateInfo&);
+#endif
+
+ bool alwaysUseCompositing() const;
+ void enterAcceleratedCompositingMode(const LayerTreeContext&);
+ void exitAcceleratedCompositingMode();
+ void updateAcceleratedCompositingMode(const LayerTreeContext&);
+
+ enum RespondImmediatelyOrNot { DoNotRespondImmediately, RespondImmediately };
+ void backingStoreStateDidChange(RespondImmediatelyOrNot);
+ void sendUpdateBackingStoreState(RespondImmediatelyOrNot);
+ void waitForAndDispatchDidUpdateBackingStoreState();
+
+#if !PLATFORM(WPE)
+ void discardBackingStoreSoon();
+ void discardBackingStore();
+#endif
+
+ void dispatchAfterEnsuringDrawing(WTF::Function<void(CallbackBase::Error)>&&) override;
+
+ class DrawingMonitor {
+ WTF_MAKE_NONCOPYABLE(DrawingMonitor); WTF_MAKE_FAST_ALLOCATED;
+ public:
+ DrawingMonitor(WebPageProxy&);
+ ~DrawingMonitor();
+
+ void start(WTF::Function<void(CallbackBase::Error)>&&);
+
+ private:
+ static int webViewDrawCallback(DrawingMonitor*);
+
+ void stop();
+ void didDraw();
+
+ MonotonicTime m_startTime;
+ WTF::Function<void(CallbackBase::Error)> m_callback;
+ RunLoop::Timer<DrawingMonitor> m_timer;
+#if PLATFORM(GTK)
+ WebPageProxy& m_webPage;
+#endif
+ };
+
+ // The state ID corresponding to our current backing store. Updated whenever we allocate
+ // a new backing store. Any messages received that correspond to an earlier state are ignored,
+ // as they don't apply to our current backing store.
+ uint64_t m_currentBackingStoreStateID { 0 };
+
+ // The next backing store state ID we will request the web process update to. Incremented
+ // whenever our state changes in a way that will require a new backing store to be allocated.
+ uint64_t m_nextBackingStoreStateID { 0 };
+
+ // The current layer tree context.
+ LayerTreeContext m_layerTreeContext;
+
+ // Whether we've sent a UpdateBackingStoreState message and are now waiting for a DidUpdateBackingStoreState message.
+ // Used to throttle UpdateBackingStoreState messages so we don't send them faster than the Web process can handle.
+ bool m_isWaitingForDidUpdateBackingStoreState { false };
+
+ // For a new Drawing Area don't draw anything until the WebProcess has sent over the first content.
+ bool m_hasReceivedFirstUpdate { false };
+
+#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
+ uint64_t m_pendingNativeSurfaceHandleForCompositing { 0 };
+#endif
+
+#if !PLATFORM(WPE)
+ bool m_isBackingStoreDiscardable { true };
+ std::unique_ptr<BackingStore> m_backingStore;
+ RunLoop::Timer<DrawingAreaProxyCoordinatedGraphics> m_discardBackingStoreTimer;
+#endif
+ std::unique_ptr<DrawingMonitor> m_drawingMonitor;
+};
+
+} // namespace WebKit
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitUIProcessDrawingAreaProxyImplcpp"></a>
<div class="delfile"><h4>Deleted: releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/DrawingAreaProxyImpl.cpp (243981 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/DrawingAreaProxyImpl.cpp 2019-04-08 10:14:55 UTC (rev 243981)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/DrawingAreaProxyImpl.cpp 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -1,274 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 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 "DrawingAreaProxyImpl.h"
-
-#include "DrawingAreaMessages.h"
-#include "DrawingAreaProxyMessages.h"
-#include "LayerTreeContext.h"
-#include "UpdateInfo.h"
-#include "WebPageGroup.h"
-#include "WebPageProxy.h"
-#include "WebPreferences.h"
-#include "WebProcessProxy.h"
-#include <WebCore/Region.h>
-
-#if PLATFORM(GTK)
-#include <gtk/gtk.h>
-#endif
-
-#if USE(GLIB_EVENT_LOOP)
-#include <wtf/glib/RunLoopSourcePriority.h>
-#endif
-
-namespace WebKit {
-using namespace WebCore;
-
-DrawingAreaProxyImpl::DrawingAreaProxyImpl(WebPageProxy& webPageProxy, WebProcessProxy& process)
- : AcceleratedDrawingAreaProxy(webPageProxy, process)
- , m_discardBackingStoreTimer(RunLoop::current(), this, &DrawingAreaProxyImpl::discardBackingStore)
-{
-#if USE(GLIB_EVENT_LOOP)
- m_discardBackingStoreTimer.setPriority(RunLoopSourcePriority::ReleaseUnusedResourcesTimer);
-#endif
-}
-
-DrawingAreaProxyImpl::~DrawingAreaProxyImpl()
-{
-}
-
-void DrawingAreaProxyImpl::paint(BackingStore::PlatformGraphicsContext context, const IntRect& rect, Region& unpaintedRegion)
-{
- unpaintedRegion = rect;
-
- if (isInAcceleratedCompositingMode())
- return;
-
- ASSERT(m_currentBackingStoreStateID <= m_nextBackingStoreStateID);
- if (m_currentBackingStoreStateID < m_nextBackingStoreStateID) {
- // Tell the web process to do a full backing store update now, in case we previously told
- // it about our next state but didn't request an immediate update.
- sendUpdateBackingStoreState(RespondImmediately);
-
- // If we haven't yet received our first bits from the WebProcess then don't paint anything.
- if (!m_hasReceivedFirstUpdate)
- return;
-
- if (m_isWaitingForDidUpdateBackingStoreState) {
- // Wait for a DidUpdateBackingStoreState message that contains the new bits before we paint
- // what's currently in the backing store.
- waitForAndDispatchDidUpdateBackingStoreState();
- }
-
- // Dispatching DidUpdateBackingStoreState (either beneath sendUpdateBackingStoreState or
- // beneath waitForAndDispatchDidUpdateBackingStoreState) could destroy our backing store or
- // change the compositing mode.
- if (!m_backingStore || isInAcceleratedCompositingMode())
- return;
- } else {
- ASSERT(!m_isWaitingForDidUpdateBackingStoreState);
- if (!m_backingStore) {
- // The view has asked us to paint before the web process has painted anything. There's
- // nothing we can do.
- return;
- }
- }
-
- m_backingStore->paint(context, rect);
- unpaintedRegion.subtract(IntRect(IntPoint(), m_backingStore->size()));
-
- discardBackingStoreSoon();
-}
-
-void DrawingAreaProxyImpl::setBackingStoreIsDiscardable(bool isBackingStoreDiscardable)
-{
- if (m_isBackingStoreDiscardable == isBackingStoreDiscardable)
- return;
-
- m_isBackingStoreDiscardable = isBackingStoreDiscardable;
- if (m_isBackingStoreDiscardable)
- discardBackingStoreSoon();
- else
- m_discardBackingStoreTimer.stop();
-}
-
-void DrawingAreaProxyImpl::update(uint64_t backingStoreStateID, const UpdateInfo& updateInfo)
-{
- ASSERT_ARG(backingStoreStateID, backingStoreStateID <= m_currentBackingStoreStateID);
- if (backingStoreStateID < m_currentBackingStoreStateID)
- return;
-
- // FIXME: Handle the case where the view is hidden.
-
- incorporateUpdate(updateInfo);
- process().send(Messages::DrawingArea::DidUpdate(), m_webPageProxy.pageID());
-}
-
-void DrawingAreaProxyImpl::didUpdateBackingStoreState(uint64_t backingStoreStateID, const UpdateInfo& updateInfo, const LayerTreeContext& layerTreeContext)
-{
- AcceleratedDrawingAreaProxy::didUpdateBackingStoreState(backingStoreStateID, updateInfo, layerTreeContext);
- if (isInAcceleratedCompositingMode()) {
- ASSERT(!m_backingStore);
- return;
- }
-
- // If we have a backing store the right size, reuse it.
- if (m_backingStore && (m_backingStore->size() != updateInfo.viewSize || m_backingStore->deviceScaleFactor() != updateInfo.deviceScaleFactor))
- m_backingStore = nullptr;
- incorporateUpdate(updateInfo);
-}
-
-void DrawingAreaProxyImpl::exitAcceleratedCompositingMode(uint64_t backingStoreStateID, const UpdateInfo& updateInfo)
-{
- ASSERT_ARG(backingStoreStateID, backingStoreStateID <= m_currentBackingStoreStateID);
- if (backingStoreStateID < m_currentBackingStoreStateID)
- return;
-
- AcceleratedDrawingAreaProxy::exitAcceleratedCompositingMode();
-
- incorporateUpdate(updateInfo);
-}
-
-void DrawingAreaProxyImpl::incorporateUpdate(const UpdateInfo& updateInfo)
-{
- ASSERT(!isInAcceleratedCompositingMode());
-
- if (updateInfo.updateRectBounds.isEmpty())
- return;
-
- if (!m_backingStore)
- m_backingStore = std::make_unique<BackingStore>(updateInfo.viewSize, updateInfo.deviceScaleFactor, m_webPageProxy);
-
- m_backingStore->incorporateUpdate(updateInfo);
-
- Region damageRegion;
- if (updateInfo.scrollRect.isEmpty()) {
- for (const auto& rect : updateInfo.updateRects)
- damageRegion.unite(rect);
- } else
- damageRegion = IntRect(IntPoint(), m_webPageProxy.viewSize());
- m_webPageProxy.setViewNeedsDisplay(damageRegion);
-}
-
-void DrawingAreaProxyImpl::enterAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext)
-{
- m_backingStore = nullptr;
- AcceleratedDrawingAreaProxy::enterAcceleratedCompositingMode(layerTreeContext);
-}
-
-void DrawingAreaProxyImpl::discardBackingStoreSoon()
-{
- if (!m_backingStore || !m_isBackingStoreDiscardable || m_discardBackingStoreTimer.isActive())
- return;
-
- // We'll wait this many seconds after the last paint before throwing away our backing store to save memory.
- // FIXME: It would be smarter to make this delay based on how expensive painting is. See <http://webkit.org/b/55733>.
- static const Seconds discardBackingStoreDelay = 2_s;
-
- m_discardBackingStoreTimer.startOneShot(discardBackingStoreDelay);
-}
-
-void DrawingAreaProxyImpl::discardBackingStore()
-{
- if (!m_backingStore)
- return;
- m_backingStore = nullptr;
- backingStoreStateDidChange(DoNotRespondImmediately);
-}
-
-DrawingAreaProxyImpl::DrawingMonitor::DrawingMonitor(WebPageProxy& webPage)
- : m_timer(RunLoop::main(), this, &DrawingMonitor::stop)
-#if PLATFORM(GTK)
- , m_webPage(webPage)
-#endif
-{
-#if USE(GLIB_EVENT_LOOP)
- // Give redraws more priority.
- m_timer.setPriority(GDK_PRIORITY_REDRAW - 10);
-#endif
-}
-
-DrawingAreaProxyImpl::DrawingMonitor::~DrawingMonitor()
-{
- m_callback = nullptr;
- stop();
-}
-
-int DrawingAreaProxyImpl::DrawingMonitor::webViewDrawCallback(DrawingAreaProxyImpl::DrawingMonitor* monitor)
-{
- monitor->didDraw();
- return FALSE;
-}
-
-void DrawingAreaProxyImpl::DrawingMonitor::start(WTF::Function<void (CallbackBase::Error)>&& callback)
-{
- m_startTime = MonotonicTime::now();
- m_callback = WTFMove(callback);
-#if PLATFORM(GTK)
- g_signal_connect_swapped(m_webPage.viewWidget(), "draw", reinterpret_cast<GCallback>(webViewDrawCallback), this);
- m_timer.startOneShot(1_s);
-#else
- m_timer.startOneShot(0_s);
-#endif
-}
-
-void DrawingAreaProxyImpl::DrawingMonitor::stop()
-{
- m_timer.stop();
-#if PLATFORM(GTK)
- g_signal_handlers_disconnect_by_func(m_webPage.viewWidget(), reinterpret_cast<gpointer>(webViewDrawCallback), this);
-#endif
- m_startTime = MonotonicTime();
- if (m_callback) {
- m_callback(CallbackBase::Error::None);
- m_callback = nullptr;
- }
-}
-
-void DrawingAreaProxyImpl::DrawingMonitor::didDraw()
-{
- // We wait up to 1 second for draw events. If there are several draw events queued quickly,
- // we want to wait until all of them have been processed, so after receiving a draw, we wait
- // up to 100ms for the next one or stop.
- if (MonotonicTime::now() - m_startTime > 1_s)
- stop();
- else
- m_timer.startOneShot(100_ms);
-}
-
-void DrawingAreaProxyImpl::dispatchAfterEnsuringDrawing(WTF::Function<void(CallbackBase::Error)>&& callbackFunction)
-{
- if (!m_webPageProxy.isValid()) {
- callbackFunction(CallbackBase::Error::OwnerWasInvalidated);
- return;
- }
-
- if (!m_drawingMonitor)
- m_drawingMonitor = std::make_unique<DrawingAreaProxyImpl::DrawingMonitor>(m_webPageProxy);
- m_drawingMonitor->start(WTFMove(callbackFunction));
-}
-
-} // namespace WebKit
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitUIProcessDrawingAreaProxyImplh"></a>
<div class="delfile"><h4>Deleted: releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/DrawingAreaProxyImpl.h (243981 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/DrawingAreaProxyImpl.h 2019-04-08 10:14:55 UTC (rev 243981)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/DrawingAreaProxyImpl.h 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -1,95 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 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.
- */
-
-#ifndef DrawingAreaProxyImpl_h
-#define DrawingAreaProxyImpl_h
-
-#include "AcceleratedDrawingAreaProxy.h"
-#include "BackingStore.h"
-#include "DrawingAreaProxy.h"
-#include <wtf/RunLoop.h>
-
-namespace WebCore {
-class Region;
-}
-
-namespace WebKit {
-
-class DrawingAreaProxyImpl final : public AcceleratedDrawingAreaProxy {
-public:
- DrawingAreaProxyImpl(WebPageProxy&, WebProcessProxy&);
- virtual ~DrawingAreaProxyImpl();
-
- void paint(BackingStore::PlatformGraphicsContext, const WebCore::IntRect&, WebCore::Region& unpaintedRegion);
-
-private:
- // DrawingAreaProxy
- void setBackingStoreIsDiscardable(bool) override;
-
- // IPC message handlers
- void update(uint64_t backingStoreStateID, const UpdateInfo&) override;
- void didUpdateBackingStoreState(uint64_t backingStoreStateID, const UpdateInfo&, const LayerTreeContext&) override;
- void exitAcceleratedCompositingMode(uint64_t backingStoreStateID, const UpdateInfo&) override;
-
- void incorporateUpdate(const UpdateInfo&);
-
- void enterAcceleratedCompositingMode(const LayerTreeContext&) override;
-
- void discardBackingStoreSoon();
- void discardBackingStore();
-
- void dispatchAfterEnsuringDrawing(WTF::Function<void(CallbackBase::Error)>&&) override;
-
- class DrawingMonitor {
- WTF_MAKE_NONCOPYABLE(DrawingMonitor); WTF_MAKE_FAST_ALLOCATED;
- public:
- DrawingMonitor(WebPageProxy&);
- ~DrawingMonitor();
-
- void start(WTF::Function<void (CallbackBase::Error)>&&);
-
- private:
- static int webViewDrawCallback(DrawingMonitor*);
-
- void stop();
- void didDraw();
-
- MonotonicTime m_startTime;
- WTF::Function<void (CallbackBase::Error)> m_callback;
- RunLoop::Timer<DrawingMonitor> m_timer;
-#if PLATFORM(GTK)
- WebPageProxy& m_webPage;
-#endif
- };
-
- bool m_isBackingStoreDiscardable { true };
- std::unique_ptr<BackingStore> m_backingStore;
- RunLoop::Timer<DrawingAreaProxyImpl> m_discardBackingStoreTimer;
- std::unique_ptr<DrawingMonitor> m_drawingMonitor;
-};
-
-} // namespace WebKit
-
-#endif // DrawingAreaProxyImpl_h
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitUIProcessgtkAcceleratedBackingStoreX11cpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.cpp (243981 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.cpp 2019-04-08 10:14:55 UTC (rev 243981)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.cpp 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx">
</span><span class="cx"> #if USE(REDIRECTED_XCOMPOSITE_WINDOW)
</span><span class="cx">
</span><del>-#include "DrawingAreaProxyImpl.h"
</del><ins>+#include "DrawingAreaProxyCoordinatedGraphics.h"
</ins><span class="cx"> #include "LayerTreeContext.h"
</span><span class="cx"> #include "WebPageProxy.h"
</span><span class="cx"> #include <WebCore/CairoUtilities.h>
</span><span class="lines">@@ -157,7 +157,7 @@
</span><span class="cx"> if (!pixmap)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(m_webPage.drawingArea());
</del><ins>+ auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(m_webPage.drawingArea());
</ins><span class="cx"> if (!drawingArea)
</span><span class="cx"> return;
</span><span class="cx">
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitUIProcesswinPageClientImplcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/win/PageClientImpl.cpp (243981 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/win/PageClientImpl.cpp 2019-04-08 10:14:55 UTC (rev 243981)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/win/PageClientImpl.cpp 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "PageClientImpl.h"
</span><span class="cx">
</span><del>-#include "DrawingAreaProxyImpl.h"
</del><ins>+#include "DrawingAreaProxyCoordinatedGraphics.h"
</ins><span class="cx"> #include "NotImplemented.h"
</span><span class="cx"> #include "WebContextMenuProxyWin.h"
</span><span class="cx"> #include "WebPageProxy.h"
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> // PageClient's pure virtual functions
</span><span class="cx"> std::unique_ptr<DrawingAreaProxy> PageClientImpl::createDrawingAreaProxy(WebProcessProxy& process)
</span><span class="cx"> {
</span><del>- return std::make_unique<DrawingAreaProxyImpl>(*m_view.page(), process);
</del><ins>+ return std::make_unique<DrawingAreaProxyCoordinatedGraphics>(*m_view.page(), process);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void PageClientImpl::setViewNeedsDisplay(const WebCore::Region& region)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitUIProcesswinWebViewcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/win/WebView.cpp (243981 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/win/WebView.cpp 2019-04-08 10:14:55 UTC (rev 243981)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/win/WebView.cpp 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> #include "WebView.h"
</span><span class="cx">
</span><span class="cx"> #include "APIPageConfiguration.h"
</span><del>-#include "DrawingAreaProxyImpl.h"
</del><ins>+#include "DrawingAreaProxyCoordinatedGraphics.h"
</ins><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "NativeWebKeyboardEvent.h"
</span><span class="cx"> #include "NativeWebMouseEvent.h"
</span><span class="lines">@@ -463,7 +463,7 @@
</span><span class="cx"> if (dirtyRect.isEmpty())
</span><span class="cx"> return;
</span><span class="cx"> m_page->endPrinting();
</span><del>- if (DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(m_page->drawingArea())) {
</del><ins>+ if (auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(m_page->drawingArea())) {
</ins><span class="cx"> // FIXME: We should port WebKit1's rect coalescing logic here.
</span><span class="cx"> Region unpaintedRegion;
</span><span class="cx"> cairo_surface_t* surface = cairo_win32_surface_create(hdc);
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitWebProcessWebPageAcceleratedDrawingAreacpp"></a>
<div class="delfile"><h4>Deleted: releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.cpp (243981 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.cpp 2019-04-08 10:14:55 UTC (rev 243981)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.cpp 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -1,451 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
- *
- * 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 "AcceleratedDrawingArea.h"
-
-#include "DrawingAreaProxyMessages.h"
-#include "LayerTreeHost.h"
-#include "UpdateInfo.h"
-#include "WebPage.h"
-#include "WebPageCreationParameters.h"
-#include "WebPreferencesKeys.h"
-#include <WebCore/Frame.h>
-#include <WebCore/Page.h>
-#include <WebCore/PageOverlayController.h>
-#include <WebCore/Settings.h>
-
-#if USE(GLIB_EVENT_LOOP)
-#include <wtf/glib/RunLoopSourcePriority.h>
-#endif
-
-namespace WebKit {
-using namespace WebCore;
-
-AcceleratedDrawingArea::~AcceleratedDrawingArea()
-{
- discardPreviousLayerTreeHost();
- if (m_layerTreeHost)
- m_layerTreeHost->invalidate();
-}
-
-AcceleratedDrawingArea::AcceleratedDrawingArea(WebPage& webPage, const WebPageCreationParameters& parameters)
- : DrawingArea(DrawingAreaTypeImpl, webPage)
- , m_exitCompositingTimer(RunLoop::main(), this, &AcceleratedDrawingArea::exitAcceleratedCompositingMode)
- , m_discardPreviousLayerTreeHostTimer(RunLoop::main(), this, &AcceleratedDrawingArea::discardPreviousLayerTreeHost)
-{
-#if USE(GLIB_EVENT_LOOP)
- m_discardPreviousLayerTreeHostTimer.setPriority(RunLoopSourcePriority::ReleaseUnusedResourcesTimer);
-#endif
- if (!m_webPage.isVisible())
- suspendPainting();
-
- m_webPage.corePage()->setDeviceScaleFactor(parameters.deviceScaleFactor);
-}
-
-void AcceleratedDrawingArea::scroll(const IntRect& scrollRect, const IntSize& scrollDelta)
-{
- if (!m_isPaintingEnabled)
- return;
-
- if (m_layerTreeHost)
- m_layerTreeHost->scrollNonCompositedContents(scrollRect);
-}
-
-void AcceleratedDrawingArea::setLayerTreeStateIsFrozen(bool isFrozen)
-{
- if (m_layerTreeStateIsFrozen == isFrozen)
- return;
-
- m_layerTreeStateIsFrozen = isFrozen;
-
- if (m_layerTreeHost)
- m_layerTreeHost->setLayerFlushSchedulingEnabled(!isFrozen);
-
- if (isFrozen)
- m_exitCompositingTimer.stop();
- else if (m_wantsToExitAcceleratedCompositingMode)
- exitAcceleratedCompositingModeSoon();
-}
-
-void AcceleratedDrawingArea::forceRepaint()
-{
- setNeedsDisplay();
-
- m_webPage.layoutIfNeeded();
-
- if (!m_layerTreeHost)
- return;
-
- // FIXME: We need to do the same work as the layerHostDidFlushLayers function here,
- // but clearly it doesn't make sense to call the function with that name.
- // Consider refactoring and renaming it.
- if (m_compositingAccordingToProxyMessages)
- m_layerTreeHost->forceRepaint();
- else {
- // Call setShouldNotifyAfterNextScheduledLayerFlush(false) here to
- // prevent layerHostDidFlushLayers() from being called a second time.
- m_layerTreeHost->setShouldNotifyAfterNextScheduledLayerFlush(false);
- layerHostDidFlushLayers();
- }
-}
-
-bool AcceleratedDrawingArea::forceRepaintAsync(CallbackID callbackID)
-{
- return m_layerTreeHost && m_layerTreeHost->forceRepaintAsync(callbackID);
-}
-
-void AcceleratedDrawingArea::setPaintingEnabled(bool paintingEnabled)
-{
- m_isPaintingEnabled = paintingEnabled;
-}
-
-void AcceleratedDrawingArea::updatePreferences(const WebPreferencesStore& store)
-{
- Settings& settings = m_webPage.corePage()->settings();
- bool forceCompositiongMode = store.getBoolValueForKey(WebPreferencesKey::forceCompositingModeKey());
- settings.setForceCompositingMode(forceCompositiongMode);
- settings.setAcceleratedCompositingForFixedPositionEnabled(forceCompositiongMode);
- if (!m_layerTreeHost)
- enterAcceleratedCompositingMode(nullptr);
-}
-
-void AcceleratedDrawingArea::mainFrameContentSizeChanged(const IntSize& size)
-{
-#if USE(COORDINATED_GRAPHICS)
- if (m_layerTreeHost)
- m_layerTreeHost->contentsSizeChanged(size);
- else if (m_previousLayerTreeHost)
- m_previousLayerTreeHost->contentsSizeChanged(size);
-#else
- UNUSED_PARAM(size);
-#endif
-}
-
-void AcceleratedDrawingArea::layerHostDidFlushLayers()
-{
- ASSERT(m_layerTreeHost);
- m_layerTreeHost->forceRepaint();
-
- if (m_shouldSendDidUpdateBackingStoreState && !exitAcceleratedCompositingModePending()) {
- sendDidUpdateBackingStoreState();
- return;
- }
-
- ASSERT(!m_compositingAccordingToProxyMessages);
- if (!exitAcceleratedCompositingModePending()) {
- m_webPage.send(Messages::DrawingAreaProxy::EnterAcceleratedCompositingMode(m_backingStoreStateID, m_layerTreeHost->layerTreeContext()));
- m_compositingAccordingToProxyMessages = true;
- }
-}
-
-GraphicsLayerFactory* AcceleratedDrawingArea::graphicsLayerFactory()
-{
- if (!m_layerTreeHost)
- enterAcceleratedCompositingMode(nullptr);
- return m_layerTreeHost ? m_layerTreeHost->graphicsLayerFactory() : nullptr;
-}
-
-void AcceleratedDrawingArea::setRootCompositingLayer(GraphicsLayer* graphicsLayer)
-{
- ASSERT(m_layerTreeHost);
-
- // FIXME: Instead of using nested if statements, we should keep a compositing state
- // enum in the AcceleratedDrawingArea object and have a changeAcceleratedCompositingState function
- // that takes the new state.
-
- if (graphicsLayer) {
- // We're already in accelerated compositing mode, but the root compositing layer changed.
-
- m_exitCompositingTimer.stop();
- m_wantsToExitAcceleratedCompositingMode = false;
-
- // If we haven't sent the EnterAcceleratedCompositingMode message, make sure that the
- // layer tree host calls us back after the next layer flush so we can send it then.
- if (!m_compositingAccordingToProxyMessages)
- m_layerTreeHost->setShouldNotifyAfterNextScheduledLayerFlush(true);
- }
- m_layerTreeHost->setRootCompositingLayer(graphicsLayer);
-}
-
-void AcceleratedDrawingArea::scheduleCompositingLayerFlush()
-{
- if (m_layerTreeHost)
- m_layerTreeHost->scheduleLayerFlush();
-}
-
-void AcceleratedDrawingArea::scheduleInitialDeferredPaint()
-{
-}
-
-void AcceleratedDrawingArea::scheduleCompositingLayerFlushImmediately()
-{
- scheduleCompositingLayerFlush();
-}
-
-#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
-RefPtr<WebCore::DisplayRefreshMonitor> AcceleratedDrawingArea::createDisplayRefreshMonitor(WebCore::PlatformDisplayID displayID)
-{
- if (!m_layerTreeHost || m_wantsToExitAcceleratedCompositingMode || exitAcceleratedCompositingModePending())
- return nullptr;
- return m_layerTreeHost->createDisplayRefreshMonitor(displayID);
-}
-#endif
-
-void AcceleratedDrawingArea::updateBackingStoreState(uint64_t stateID, bool respondImmediately, float deviceScaleFactor, const IntSize& size, const IntSize& scrollOffset)
-{
- ASSERT(!m_inUpdateBackingStoreState);
- m_inUpdateBackingStoreState = true;
-
- ASSERT_ARG(stateID, stateID >= m_backingStoreStateID);
- if (stateID != m_backingStoreStateID) {
- m_backingStoreStateID = stateID;
- m_shouldSendDidUpdateBackingStoreState = true;
-
- m_webPage.setDeviceScaleFactor(deviceScaleFactor);
- m_webPage.setSize(size);
- m_webPage.layoutIfNeeded();
- m_webPage.flushPendingEditorStateUpdate();
- m_webPage.scrollMainFrameIfNotAtMaxScrollPosition(scrollOffset);
- m_webPage.willDisplayPage();
-
- if (m_layerTreeHost)
- m_layerTreeHost->sizeDidChange(m_webPage.size());
- else if (m_previousLayerTreeHost)
- m_previousLayerTreeHost->sizeDidChange(m_webPage.size());
- } else {
- ASSERT(size == m_webPage.size());
- if (!m_shouldSendDidUpdateBackingStoreState) {
- // We've already sent a DidUpdateBackingStoreState message for this state. We have nothing more to do.
- m_inUpdateBackingStoreState = false;
- return;
- }
- }
-
- didUpdateBackingStoreState();
-
- if (respondImmediately) {
- // Make sure to resume painting if we're supposed to respond immediately, otherwise we'll just
- // send back an empty UpdateInfo struct.
- if (m_isPaintingSuspended)
- resumePainting();
-
- sendDidUpdateBackingStoreState();
- }
-
- m_inUpdateBackingStoreState = false;
-}
-
-void AcceleratedDrawingArea::sendDidUpdateBackingStoreState()
-{
- ASSERT(m_shouldSendDidUpdateBackingStoreState);
-
- m_shouldSendDidUpdateBackingStoreState = false;
-
- UpdateInfo updateInfo;
- updateInfo.viewSize = m_webPage.size();
- updateInfo.deviceScaleFactor = m_webPage.corePage()->deviceScaleFactor();
-
- LayerTreeContext layerTreeContext;
- if (m_layerTreeHost) {
- layerTreeContext = m_layerTreeHost->layerTreeContext();
-
- // We don't want the layer tree host to notify after the next scheduled
- // layer flush because that might end up sending an EnterAcceleratedCompositingMode
- // message back to the UI process, but the updated layer tree context
- // will be sent back in the DidUpdateBackingStoreState message.
- m_layerTreeHost->setShouldNotifyAfterNextScheduledLayerFlush(false);
- m_layerTreeHost->forceRepaint();
- }
-
- m_webPage.send(Messages::DrawingAreaProxy::DidUpdateBackingStoreState(m_backingStoreStateID, updateInfo, layerTreeContext));
- m_compositingAccordingToProxyMessages = !layerTreeContext.isEmpty();
-}
-
-void AcceleratedDrawingArea::suspendPainting()
-{
- ASSERT(!m_isPaintingSuspended);
-
- if (m_layerTreeHost)
- m_layerTreeHost->pauseRendering();
-
- m_isPaintingSuspended = true;
-
- m_webPage.corePage()->suspendScriptedAnimations();
-}
-
-void AcceleratedDrawingArea::resumePainting()
-{
- if (!m_isPaintingSuspended) {
- // FIXME: We can get a call to resumePainting when painting is not suspended.
- // This happens when sending a synchronous message to create a new page. See <rdar://problem/8976531>.
- return;
- }
-
- if (m_layerTreeHost)
- m_layerTreeHost->resumeRendering();
-
- m_isPaintingSuspended = false;
-
- // FIXME: We shouldn't always repaint everything here.
- setNeedsDisplay();
-
- m_webPage.corePage()->resumeScriptedAnimations();
-}
-
-void AcceleratedDrawingArea::enterAcceleratedCompositingMode(GraphicsLayer* graphicsLayer)
-{
- m_discardPreviousLayerTreeHostTimer.stop();
-
- m_exitCompositingTimer.stop();
- m_wantsToExitAcceleratedCompositingMode = false;
-
- ASSERT(!m_layerTreeHost);
- if (m_previousLayerTreeHost) {
- m_layerTreeHost = WTFMove(m_previousLayerTreeHost);
- m_layerTreeHost->setIsDiscardable(false);
- if (!m_isPaintingSuspended)
- m_layerTreeHost->resumeRendering();
- if (!m_layerTreeStateIsFrozen)
- m_layerTreeHost->setLayerFlushSchedulingEnabled(true);
- } else {
-#if USE(COORDINATED_GRAPHICS)
- m_layerTreeHost = std::make_unique<LayerTreeHost>(m_webPage);
-#else
- m_layerTreeHost = nullptr;
-#endif
-
- if (!m_layerTreeHost)
- return;
-
- if (m_isPaintingSuspended)
- m_layerTreeHost->pauseRendering();
- }
-
-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
- if (m_nativeSurfaceHandleForCompositing)
- m_layerTreeHost->setNativeSurfaceHandleForCompositing(m_nativeSurfaceHandleForCompositing);
-#endif
- if (!m_inUpdateBackingStoreState)
- m_layerTreeHost->setShouldNotifyAfterNextScheduledLayerFlush(true);
-
- m_layerTreeHost->setRootCompositingLayer(graphicsLayer);
-}
-
-void AcceleratedDrawingArea::exitAcceleratedCompositingModeSoon()
-{
- if (m_layerTreeStateIsFrozen) {
- m_wantsToExitAcceleratedCompositingMode = true;
- return;
- }
-
- if (exitAcceleratedCompositingModePending())
- return;
-
- m_exitCompositingTimer.startOneShot(0_s);
-}
-
-void AcceleratedDrawingArea::exitAcceleratedCompositingModeNow()
-{
- ASSERT(!m_layerTreeStateIsFrozen);
-
- m_exitCompositingTimer.stop();
- m_wantsToExitAcceleratedCompositingMode = false;
-
- ASSERT(m_layerTreeHost);
- m_previousLayerTreeHost = WTFMove(m_layerTreeHost);
- m_previousLayerTreeHost->setIsDiscardable(true);
- m_previousLayerTreeHost->pauseRendering();
- m_previousLayerTreeHost->setLayerFlushSchedulingEnabled(false);
- m_discardPreviousLayerTreeHostTimer.startOneShot(5_s);
-}
-
-void AcceleratedDrawingArea::discardPreviousLayerTreeHost()
-{
- m_discardPreviousLayerTreeHostTimer.stop();
- if (!m_previousLayerTreeHost)
- return;
-
- m_previousLayerTreeHost->invalidate();
- m_previousLayerTreeHost = nullptr;
-}
-
-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
-void AcceleratedDrawingArea::setNativeSurfaceHandleForCompositing(uint64_t handle)
-{
- m_nativeSurfaceHandleForCompositing = handle;
- if (m_layerTreeHost) {
- m_webPage.corePage()->settings().setAcceleratedCompositingEnabled(true);
- m_layerTreeHost->setNativeSurfaceHandleForCompositing(handle);
- }
-}
-
-void AcceleratedDrawingArea::destroyNativeSurfaceHandleForCompositing(bool& handled)
-{
- handled = true;
- setNativeSurfaceHandleForCompositing(0);
-}
-#endif
-
-#if USE(COORDINATED_GRAPHICS)
-void AcceleratedDrawingArea::didChangeViewportAttributes(ViewportAttributes&& attrs)
-{
- if (m_layerTreeHost)
- m_layerTreeHost->didChangeViewportAttributes(WTFMove(attrs));
- else if (m_previousLayerTreeHost)
- m_previousLayerTreeHost->didChangeViewportAttributes(WTFMove(attrs));
-}
-#endif
-
-#if USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER)
-void AcceleratedDrawingArea::deviceOrPageScaleFactorChanged()
-{
- if (m_layerTreeHost)
- m_layerTreeHost->deviceOrPageScaleFactorChanged();
- else if (m_previousLayerTreeHost)
- m_previousLayerTreeHost->deviceOrPageScaleFactorChanged();
-}
-#endif
-
-void AcceleratedDrawingArea::activityStateDidChange(OptionSet<ActivityState::Flag> changed, ActivityStateChangeID, const Vector<CallbackID>&)
-{
- if (changed & ActivityState::IsVisible) {
- if (m_webPage.isVisible())
- resumePainting();
- else
- suspendPainting();
- }
-}
-
-void AcceleratedDrawingArea::attachViewOverlayGraphicsLayer(GraphicsLayer* viewOverlayRootLayer)
-{
- if (m_layerTreeHost)
- m_layerTreeHost->setViewOverlayRootLayer(viewOverlayRootLayer);
- else if (m_previousLayerTreeHost)
- m_previousLayerTreeHost->setViewOverlayRootLayer(viewOverlayRootLayer);
-}
-
-} // namespace WebKit
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitWebProcessWebPageAcceleratedDrawingAreah"></a>
<div class="delfile"><h4>Deleted: releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.h (243981 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.h 2019-04-08 10:14:55 UTC (rev 243981)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.h 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -1,137 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
- *
- * 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
-
-#include "DrawingArea.h"
-#include <wtf/RunLoop.h>
-
-namespace WebKit {
-
-class LayerTreeHost;
-
-class AcceleratedDrawingArea : public DrawingArea {
-public:
- AcceleratedDrawingArea(WebPage&, const WebPageCreationParameters&);
- virtual ~AcceleratedDrawingArea();
-
-protected:
- // DrawingArea
- void setNeedsDisplay() override { };
- void setNeedsDisplayInRect(const WebCore::IntRect&) override { };
- void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollDelta) override;
- void setLayerTreeStateIsFrozen(bool) override;
- bool layerTreeStateIsFrozen() const override { return m_layerTreeStateIsFrozen; }
- LayerTreeHost* layerTreeHost() const override { return m_layerTreeHost.get(); }
- void forceRepaint() override;
- bool forceRepaintAsync(CallbackID) override;
-
- void setPaintingEnabled(bool) override;
- void updatePreferences(const WebPreferencesStore&) override;
- void mainFrameContentSizeChanged(const WebCore::IntSize&) override;
-
- WebCore::GraphicsLayerFactory* graphicsLayerFactory() override;
- void setRootCompositingLayer(WebCore::GraphicsLayer*) override;
- void scheduleInitialDeferredPaint() override;
- void scheduleCompositingLayerFlush() override;
- void scheduleCompositingLayerFlushImmediately() override;
-
-#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
- virtual RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(WebCore::PlatformDisplayID);
-#endif
-
-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
- void setNativeSurfaceHandleForCompositing(uint64_t) override;
- void destroyNativeSurfaceHandleForCompositing(bool&) override;
-#endif
-
- void activityStateDidChange(OptionSet<WebCore::ActivityState::Flag>, ActivityStateChangeID, const Vector<CallbackID>& /* callbackIDs */) override;
- void attachViewOverlayGraphicsLayer(WebCore::GraphicsLayer*) override;
-
- void layerHostDidFlushLayers() override;
-
-#if USE(COORDINATED_GRAPHICS)
- void didChangeViewportAttributes(WebCore::ViewportAttributes&&) override;
-#endif
-
-#if USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER)
- void deviceOrPageScaleFactorChanged() override;
-#endif
-
- // IPC message handlers.
- void updateBackingStoreState(uint64_t backingStoreStateID, bool respondImmediately, float deviceScaleFactor, const WebCore::IntSize&, const WebCore::IntSize& scrollOffset) override;
-
- void exitAcceleratedCompositingModeSoon();
- bool exitAcceleratedCompositingModePending() const { return m_exitCompositingTimer.isActive(); }
- void exitAcceleratedCompositingModeNow();
- void discardPreviousLayerTreeHost();
-
- virtual void suspendPainting();
- virtual void resumePainting();
-
- virtual void sendDidUpdateBackingStoreState();
- virtual void didUpdateBackingStoreState() { }
-
- virtual void enterAcceleratedCompositingMode(WebCore::GraphicsLayer*);
- virtual void exitAcceleratedCompositingMode() { }
-
- uint64_t m_backingStoreStateID { 0 };
-
- // Whether painting is enabled. If painting is disabled, any calls to setNeedsDisplay and scroll are ignored.
- bool m_isPaintingEnabled { true };
-
- // Whether we're currently processing an UpdateBackingStoreState message.
- bool m_inUpdateBackingStoreState { false };
-
- // When true, we should send an UpdateBackingStoreState message instead of any other messages
- // we normally send to the UI process.
- bool m_shouldSendDidUpdateBackingStoreState { false };
-
- // True between sending the 'enter compositing' messages, and the 'exit compositing' message.
- bool m_compositingAccordingToProxyMessages { false };
-
- // When true, we maintain the layer tree in its current state by not leaving accelerated compositing mode
- // and not scheduling layer flushes.
- bool m_layerTreeStateIsFrozen { false };
-
- // True when we were asked to exit accelerated compositing mode but couldn't because layer tree
- // state was frozen.
- bool m_wantsToExitAcceleratedCompositingMode { false };
-
- // Whether painting is suspended. We'll still keep track of the dirty region but we
- // won't paint until painting has resumed again.
- bool m_isPaintingSuspended { false };
-
- RunLoop::Timer<AcceleratedDrawingArea> m_exitCompositingTimer;
-
- // The layer tree host that handles accelerated compositing.
- std::unique_ptr<LayerTreeHost> m_layerTreeHost;
-
- std::unique_ptr<LayerTreeHost> m_previousLayerTreeHost;
- RunLoop::Timer<AcceleratedDrawingArea> m_discardPreviousLayerTreeHostTimer;
-};
-
-} // namespace WebKit
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitWebProcessWebPageCoordinatedGraphicsDrawingAreaCoordinatedGraphicscpp"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp (0 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp (rev 0)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -0,0 +1,755 @@
</span><ins>+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ * Copyright (C) 2019 Igalia S.L.
+ *
+ * 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 "DrawingAreaCoordinatedGraphics.h"
+
+#include "DrawingAreaProxyMessages.h"
+#include "LayerTreeHost.h"
+#include "ShareableBitmap.h"
+#include "UpdateInfo.h"
+#include "WebPage.h"
+#include "WebPageCreationParameters.h"
+#include "WebPreferencesKeys.h"
+#include <WebCore/Frame.h>
+#include <WebCore/GraphicsContext.h>
+#include <WebCore/Page.h>
+#include <WebCore/PageOverlayController.h>
+#include <WebCore/Settings.h>
+
+#if USE(GLIB_EVENT_LOOP)
+#include <wtf/glib/RunLoopSourcePriority.h>
+#endif
+
+namespace WebKit {
+using namespace WebCore;
+
+DrawingAreaCoordinatedGraphics::DrawingAreaCoordinatedGraphics(WebPage& webPage, const WebPageCreationParameters& parameters)
+ : DrawingArea(DrawingAreaTypeCoordinatedGraphics, webPage)
+ , m_exitCompositingTimer(RunLoop::main(), this, &DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingMode)
+ , m_discardPreviousLayerTreeHostTimer(RunLoop::main(), this, &DrawingAreaCoordinatedGraphics::discardPreviousLayerTreeHost)
+ , m_displayTimer(RunLoop::main(), this, &DrawingAreaCoordinatedGraphics::displayTimerFired)
+{
+#if USE(GLIB_EVENT_LOOP)
+ m_discardPreviousLayerTreeHostTimer.setPriority(RunLoopSourcePriority::ReleaseUnusedResourcesTimer);
+#if !PLATFORM(WPE)
+ m_displayTimer.setPriority(RunLoopSourcePriority::NonAcceleratedDrawingTimer);
+#endif
+#endif
+}
+
+DrawingAreaCoordinatedGraphics::~DrawingAreaCoordinatedGraphics()
+{
+ discardPreviousLayerTreeHost();
+ if (m_layerTreeHost)
+ m_layerTreeHost->invalidate();
+}
+
+void DrawingAreaCoordinatedGraphics::setNeedsDisplay()
+{
+ if (m_layerTreeHost) {
+ ASSERT(m_dirtyRegion.isEmpty());
+ return;
+ }
+
+ setNeedsDisplayInRect(m_webPage.bounds());
+}
+
+void DrawingAreaCoordinatedGraphics::setNeedsDisplayInRect(const IntRect& rect)
+{
+ if (m_layerTreeHost) {
+ ASSERT(m_dirtyRegion.isEmpty());
+ return;
+ }
+
+ if (!m_isPaintingEnabled)
+ return;
+
+ IntRect dirtyRect = rect;
+ dirtyRect.intersect(m_webPage.bounds());
+ if (dirtyRect.isEmpty())
+ return;
+
+ m_dirtyRegion.unite(dirtyRect);
+ scheduleDisplay();
+}
+
+void DrawingAreaCoordinatedGraphics::scroll(const IntRect& scrollRect, const IntSize& scrollDelta)
+{
+ if (!m_isPaintingEnabled)
+ return;
+
+ if (m_layerTreeHost) {
+ ASSERT(m_scrollRect.isEmpty());
+ ASSERT(m_scrollOffset.isEmpty());
+ ASSERT(m_dirtyRegion.isEmpty());
+ m_layerTreeHost->scrollNonCompositedContents(scrollRect);
+ return;
+ }
+
+ if (scrollRect.isEmpty())
+ return;
+
+ if (m_previousLayerTreeHost)
+ m_previousLayerTreeHost->scrollNonCompositedContents(scrollRect);
+
+ if (!m_scrollRect.isEmpty() && scrollRect != m_scrollRect) {
+ unsigned scrollArea = scrollRect.width() * scrollRect.height();
+ unsigned currentScrollArea = m_scrollRect.width() * m_scrollRect.height();
+
+ if (currentScrollArea >= scrollArea) {
+ // The rect being scrolled is at least as large as the rect we'd like to scroll.
+ // Go ahead and just invalidate the scroll rect.
+ setNeedsDisplayInRect(scrollRect);
+ return;
+ }
+
+ // Just repaint the entire current scroll rect, we'll scroll the new rect instead.
+ setNeedsDisplayInRect(m_scrollRect);
+ m_scrollRect = IntRect();
+ m_scrollOffset = IntSize();
+ }
+
+ // Get the part of the dirty region that is in the scroll rect.
+ Region dirtyRegionInScrollRect = intersect(scrollRect, m_dirtyRegion);
+ if (!dirtyRegionInScrollRect.isEmpty()) {
+ // There are parts of the dirty region that are inside the scroll rect.
+ // We need to subtract them from the region, move them and re-add them.
+ m_dirtyRegion.subtract(scrollRect);
+
+ // Move the dirty parts.
+ Region movedDirtyRegionInScrollRect = intersect(translate(dirtyRegionInScrollRect, scrollDelta), scrollRect);
+
+ // And add them back.
+ m_dirtyRegion.unite(movedDirtyRegionInScrollRect);
+ }
+
+ // Compute the scroll repaint region.
+ Region scrollRepaintRegion = subtract(scrollRect, translate(scrollRect, scrollDelta));
+
+ m_dirtyRegion.unite(scrollRepaintRegion);
+ scheduleDisplay();
+
+ m_scrollRect = scrollRect;
+ m_scrollOffset += scrollDelta;
+}
+
+void DrawingAreaCoordinatedGraphics::forceRepaint()
+{
+ if (m_inUpdateBackingStoreState) {
+ m_forceRepaintAfterBackingStoreStateUpdate = true;
+ return;
+ }
+ m_forceRepaintAfterBackingStoreStateUpdate = false;
+
+ if (!m_layerTreeHost) {
+ m_isWaitingForDidUpdate = false;
+ if (m_isPaintingEnabled) {
+ m_dirtyRegion = m_webPage.bounds();
+ display();
+ }
+ return;
+ }
+
+ setNeedsDisplay();
+ m_webPage.layoutIfNeeded();
+ if (!m_layerTreeHost)
+ return;
+
+ // FIXME: We need to do the same work as the layerHostDidFlushLayers function here,
+ // but clearly it doesn't make sense to call the function with that name.
+ // Consider refactoring and renaming it.
+ if (m_compositingAccordingToProxyMessages)
+ m_layerTreeHost->forceRepaint();
+ else {
+ // Call setShouldNotifyAfterNextScheduledLayerFlush(false) here to
+ // prevent layerHostDidFlushLayers() from being called a second time.
+ m_layerTreeHost->setShouldNotifyAfterNextScheduledLayerFlush(false);
+ layerHostDidFlushLayers();
+ }
+}
+
+bool DrawingAreaCoordinatedGraphics::forceRepaintAsync(CallbackID callbackID)
+{
+ return m_layerTreeHost && m_layerTreeHost->forceRepaintAsync(callbackID);
+}
+
+void DrawingAreaCoordinatedGraphics::setLayerTreeStateIsFrozen(bool isFrozen)
+{
+ if (m_layerTreeStateIsFrozen == isFrozen)
+ return;
+
+ m_layerTreeStateIsFrozen = isFrozen;
+
+ if (m_layerTreeHost)
+ m_layerTreeHost->setLayerFlushSchedulingEnabled(!isFrozen);
+
+ if (isFrozen)
+ m_exitCompositingTimer.stop();
+ else if (m_wantsToExitAcceleratedCompositingMode)
+ exitAcceleratedCompositingModeSoon();
+}
+
+void DrawingAreaCoordinatedGraphics::updatePreferences(const WebPreferencesStore& store)
+{
+ Settings& settings = m_webPage.corePage()->settings();
+ settings.setForceCompositingMode(store.getBoolValueForKey(WebPreferencesKey::forceCompositingModeKey()));
+ // Fixed position elements need to be composited and create stacking contexts
+ // in order to be scrolled by the ScrollingCoordinator.
+ settings.setAcceleratedCompositingForFixedPositionEnabled(settings.acceleratedCompositingEnabled());
+
+ m_alwaysUseCompositing = settings.acceleratedCompositingEnabled() && settings.forceCompositingMode();
+ if (m_alwaysUseCompositing && !m_layerTreeHost)
+ enterAcceleratedCompositingMode(nullptr);
+}
+
+void DrawingAreaCoordinatedGraphics::mainFrameContentSizeChanged(const IntSize& size)
+{
+ if (m_layerTreeHost)
+ m_layerTreeHost->contentsSizeChanged(size);
+ else if (m_previousLayerTreeHost)
+ m_previousLayerTreeHost->contentsSizeChanged(size);
+}
+
+void DrawingAreaCoordinatedGraphics::deviceOrPageScaleFactorChanged()
+{
+ if (m_layerTreeHost)
+ m_layerTreeHost->deviceOrPageScaleFactorChanged();
+ else if (m_previousLayerTreeHost)
+ m_previousLayerTreeHost->deviceOrPageScaleFactorChanged();
+}
+
+void DrawingAreaCoordinatedGraphics::didChangeViewportAttributes(ViewportAttributes&& attrs)
+{
+ if (m_layerTreeHost)
+ m_layerTreeHost->didChangeViewportAttributes(WTFMove(attrs));
+ else if (m_previousLayerTreeHost)
+ m_previousLayerTreeHost->didChangeViewportAttributes(WTFMove(attrs));
+}
+
+GraphicsLayerFactory* DrawingAreaCoordinatedGraphics::graphicsLayerFactory()
+{
+ if (!m_layerTreeHost)
+ enterAcceleratedCompositingMode(nullptr);
+ return m_layerTreeHost ? m_layerTreeHost->graphicsLayerFactory() : nullptr;
+}
+
+void DrawingAreaCoordinatedGraphics::setRootCompositingLayer(GraphicsLayer* graphicsLayer)
+{
+ if (m_layerTreeHost) {
+ if (graphicsLayer) {
+ // We're already in accelerated compositing mode, but the root compositing layer changed.
+ m_exitCompositingTimer.stop();
+ m_wantsToExitAcceleratedCompositingMode = false;
+
+ // If we haven't sent the EnterAcceleratedCompositingMode message, make sure that the
+ // layer tree host calls us back after the next layer flush so we can send it then.
+ if (!m_compositingAccordingToProxyMessages)
+ m_layerTreeHost->setShouldNotifyAfterNextScheduledLayerFlush(true);
+ }
+ m_layerTreeHost->setRootCompositingLayer(graphicsLayer);
+
+ if (!graphicsLayer && !m_alwaysUseCompositing) {
+ // We'll exit accelerated compositing mode on a timer, to avoid re-entering
+ // compositing code via display() and layout.
+ // If we're leaving compositing mode because of a setSize, it is safe to
+ // exit accelerated compositing mode right away.
+ if (m_inUpdateBackingStoreState)
+ exitAcceleratedCompositingMode();
+ else
+ exitAcceleratedCompositingModeSoon();
+ }
+ return;
+ }
+
+ if (!graphicsLayer)
+ return;
+
+ // We're actually entering accelerated compositing mode.
+ enterAcceleratedCompositingMode(graphicsLayer);
+}
+
+void DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush()
+{
+ if (m_layerTreeHost)
+ m_layerTreeHost->scheduleLayerFlush();
+}
+
+void DrawingAreaCoordinatedGraphics::layerHostDidFlushLayers()
+{
+ ASSERT(m_layerTreeHost);
+ m_layerTreeHost->forceRepaint();
+
+ if (m_shouldSendDidUpdateBackingStoreState && !exitAcceleratedCompositingModePending()) {
+ sendDidUpdateBackingStoreState();
+ return;
+ }
+
+ ASSERT(!m_compositingAccordingToProxyMessages);
+ if (!exitAcceleratedCompositingModePending()) {
+ m_webPage.send(Messages::DrawingAreaProxy::EnterAcceleratedCompositingMode(m_backingStoreStateID, m_layerTreeHost->layerTreeContext()));
+ m_compositingAccordingToProxyMessages = true;
+ }
+}
+
+#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
+RefPtr<DisplayRefreshMonitor> DrawingAreaCoordinatedGraphics::createDisplayRefreshMonitor(PlatformDisplayID displayID)
+{
+ if (!m_layerTreeHost || m_wantsToExitAcceleratedCompositingMode || exitAcceleratedCompositingModePending())
+ return nullptr;
+ return m_layerTreeHost->createDisplayRefreshMonitor(displayID);
+}
+#endif
+
+#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
+void DrawingAreaCoordinatedGraphics::setNativeSurfaceHandleForCompositing(uint64_t handle)
+{
+ m_nativeSurfaceHandleForCompositing = handle;
+ if (m_layerTreeHost) {
+ m_webPage.corePage()->settings().setAcceleratedCompositingEnabled(true);
+ m_layerTreeHost->setNativeSurfaceHandleForCompositing(handle);
+ }
+}
+
+void DrawingAreaCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing(bool& handled)
+{
+ handled = true;
+ setNativeSurfaceHandleForCompositing(0);
+}
+#endif
+
+void DrawingAreaCoordinatedGraphics::activityStateDidChange(OptionSet<ActivityState::Flag> changed, ActivityStateChangeID, const Vector<CallbackID>&)
+{
+ if (changed & ActivityState::IsVisible) {
+ if (m_webPage.isVisible())
+ resumePainting();
+ else
+ suspendPainting();
+ }
+}
+
+void DrawingAreaCoordinatedGraphics::attachViewOverlayGraphicsLayer(GraphicsLayer* viewOverlayRootLayer)
+{
+ if (m_layerTreeHost)
+ m_layerTreeHost->setViewOverlayRootLayer(viewOverlayRootLayer);
+ else if (m_previousLayerTreeHost)
+ m_previousLayerTreeHost->setViewOverlayRootLayer(viewOverlayRootLayer);
+}
+
+void DrawingAreaCoordinatedGraphics::updateBackingStoreState(uint64_t stateID, bool respondImmediately, float deviceScaleFactor, const IntSize& size, const IntSize& scrollOffset)
+{
+ if (stateID != m_backingStoreStateID && !m_layerTreeHost)
+ m_dirtyRegion = IntRect(IntPoint(), size);
+
+ ASSERT(!m_inUpdateBackingStoreState);
+ m_inUpdateBackingStoreState = true;
+
+ ASSERT_ARG(stateID, stateID >= m_backingStoreStateID);
+ if (stateID != m_backingStoreStateID) {
+ m_backingStoreStateID = stateID;
+ m_shouldSendDidUpdateBackingStoreState = true;
+
+ m_webPage.setDeviceScaleFactor(deviceScaleFactor);
+ m_webPage.setSize(size);
+ m_webPage.layoutIfNeeded();
+ m_webPage.flushPendingEditorStateUpdate();
+ m_webPage.scrollMainFrameIfNotAtMaxScrollPosition(scrollOffset);
+ m_webPage.willDisplayPage();
+
+ if (m_layerTreeHost)
+ m_layerTreeHost->sizeDidChange(m_webPage.size());
+ else if (m_previousLayerTreeHost)
+ m_previousLayerTreeHost->sizeDidChange(m_webPage.size());
+ } else {
+ ASSERT(size == m_webPage.size());
+ if (!m_shouldSendDidUpdateBackingStoreState) {
+ // We've already sent a DidUpdateBackingStoreState message for this state. We have nothing more to do.
+ m_inUpdateBackingStoreState = false;
+ if (m_forceRepaintAfterBackingStoreStateUpdate)
+ forceRepaint();
+ return;
+ }
+ }
+
+ // The UI process has updated to a new backing store state. Any Update messages we sent before
+ // this point will be ignored. We wait to set this to false until after updating the page's
+ // size so that any displays triggered by the relayout will be ignored. If we're supposed to
+ // respond to the UpdateBackingStoreState message immediately, we'll do a display anyway in
+ // sendDidUpdateBackingStoreState; otherwise we shouldn't do one right now.
+ m_isWaitingForDidUpdate = false;
+
+ if (respondImmediately) {
+ // Make sure to resume painting if we're supposed to respond immediately, otherwise we'll just
+ // send back an empty UpdateInfo struct.
+ if (m_isPaintingSuspended)
+ resumePainting();
+
+ sendDidUpdateBackingStoreState();
+ }
+
+ m_inUpdateBackingStoreState = false;
+
+ if (m_forceRepaintAfterBackingStoreStateUpdate)
+ forceRepaint();
+}
+
+void DrawingAreaCoordinatedGraphics::didUpdate()
+{
+ // We might get didUpdate messages from the UI process even after we've
+ // entered accelerated compositing mode. Ignore them.
+ if (m_layerTreeHost)
+ return;
+
+ m_isWaitingForDidUpdate = false;
+
+ // Display if needed. We call displayTimerFired here since it will throttle updates to 60fps.
+ displayTimerFired();
+}
+
+void DrawingAreaCoordinatedGraphics::sendDidUpdateBackingStoreState()
+{
+ ASSERT(!m_isWaitingForDidUpdate);
+ ASSERT(m_shouldSendDidUpdateBackingStoreState);
+
+ if (!m_isPaintingSuspended && !m_layerTreeHost) {
+ UpdateInfo updateInfo;
+ display(updateInfo);
+ if (!m_layerTreeHost) {
+ m_shouldSendDidUpdateBackingStoreState = false;
+
+ LayerTreeContext layerTreeContext;
+ m_webPage.send(Messages::DrawingAreaProxy::DidUpdateBackingStoreState(m_backingStoreStateID, updateInfo, layerTreeContext));
+ m_compositingAccordingToProxyMessages = false;
+ return;
+ }
+ }
+
+ ASSERT(m_shouldSendDidUpdateBackingStoreState);
+ m_shouldSendDidUpdateBackingStoreState = false;
+
+ UpdateInfo updateInfo;
+ updateInfo.viewSize = m_webPage.size();
+ updateInfo.deviceScaleFactor = m_webPage.corePage()->deviceScaleFactor();
+
+ LayerTreeContext layerTreeContext;
+ if (m_layerTreeHost) {
+ layerTreeContext = m_layerTreeHost->layerTreeContext();
+
+ // We don't want the layer tree host to notify after the next scheduled
+ // layer flush because that might end up sending an EnterAcceleratedCompositingMode
+ // message back to the UI process, but the updated layer tree context
+ // will be sent back in the DidUpdateBackingStoreState message.
+ m_layerTreeHost->setShouldNotifyAfterNextScheduledLayerFlush(false);
+ m_layerTreeHost->forceRepaint();
+ }
+
+ m_webPage.send(Messages::DrawingAreaProxy::DidUpdateBackingStoreState(m_backingStoreStateID, updateInfo, layerTreeContext));
+ m_compositingAccordingToProxyMessages = !layerTreeContext.isEmpty();
+}
+
+void DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingModeSoon()
+{
+ if (m_layerTreeStateIsFrozen) {
+ m_wantsToExitAcceleratedCompositingMode = true;
+ return;
+ }
+
+ if (exitAcceleratedCompositingModePending())
+ return;
+
+ m_exitCompositingTimer.startOneShot(0_s);
+}
+
+void DrawingAreaCoordinatedGraphics::discardPreviousLayerTreeHost()
+{
+ m_discardPreviousLayerTreeHostTimer.stop();
+ if (!m_previousLayerTreeHost)
+ return;
+
+ m_previousLayerTreeHost->invalidate();
+ m_previousLayerTreeHost = nullptr;
+}
+
+void DrawingAreaCoordinatedGraphics::suspendPainting()
+{
+ ASSERT(!m_isPaintingSuspended);
+
+ if (m_layerTreeHost)
+ m_layerTreeHost->pauseRendering();
+ else
+ m_displayTimer.stop();
+
+ m_isPaintingSuspended = true;
+
+ m_webPage.corePage()->suspendScriptedAnimations();
+}
+
+void DrawingAreaCoordinatedGraphics::resumePainting()
+{
+ if (!m_isPaintingSuspended) {
+ // FIXME: We can get a call to resumePainting when painting is not suspended.
+ // This happens when sending a synchronous message to create a new page. See <rdar://problem/8976531>.
+ return;
+ }
+
+ if (m_layerTreeHost)
+ m_layerTreeHost->resumeRendering();
+
+ m_isPaintingSuspended = false;
+
+ // FIXME: We shouldn't always repaint everything here.
+ setNeedsDisplay();
+
+ m_webPage.corePage()->resumeScriptedAnimations();
+}
+
+void DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode(GraphicsLayer* graphicsLayer)
+{
+ m_discardPreviousLayerTreeHostTimer.stop();
+
+ m_exitCompositingTimer.stop();
+ m_wantsToExitAcceleratedCompositingMode = false;
+
+ ASSERT(!m_layerTreeHost);
+ if (m_previousLayerTreeHost) {
+ m_layerTreeHost = WTFMove(m_previousLayerTreeHost);
+ m_layerTreeHost->setIsDiscardable(false);
+ if (!m_isPaintingSuspended)
+ m_layerTreeHost->resumeRendering();
+ if (!m_layerTreeStateIsFrozen)
+ m_layerTreeHost->setLayerFlushSchedulingEnabled(true);
+ } else {
+#if USE(COORDINATED_GRAPHICS)
+ m_layerTreeHost = std::make_unique<LayerTreeHost>(m_webPage);
+#else
+ m_layerTreeHost = nullptr;
+ return;
+#endif
+ if (m_isPaintingSuspended)
+ m_layerTreeHost->pauseRendering();
+ }
+
+#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
+ if (m_nativeSurfaceHandleForCompositing)
+ m_layerTreeHost->setNativeSurfaceHandleForCompositing(m_nativeSurfaceHandleForCompositing);
+#endif
+ if (!m_inUpdateBackingStoreState)
+ m_layerTreeHost->setShouldNotifyAfterNextScheduledLayerFlush(true);
+
+ m_layerTreeHost->setRootCompositingLayer(graphicsLayer);
+
+ // Non-composited content will now be handled exclusively by the layer tree host.
+ m_dirtyRegion = Region();
+ m_scrollRect = IntRect();
+ m_scrollOffset = IntSize();
+ m_displayTimer.stop();
+ m_isWaitingForDidUpdate = false;
+}
+
+void DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingMode()
+{
+ if (m_alwaysUseCompositing)
+ return;
+
+ ASSERT(!m_layerTreeStateIsFrozen);
+
+ m_exitCompositingTimer.stop();
+ m_wantsToExitAcceleratedCompositingMode = false;
+
+ ASSERT(m_layerTreeHost);
+ m_previousLayerTreeHost = WTFMove(m_layerTreeHost);
+ m_previousLayerTreeHost->setIsDiscardable(true);
+ m_previousLayerTreeHost->pauseRendering();
+ m_previousLayerTreeHost->setLayerFlushSchedulingEnabled(false);
+ m_discardPreviousLayerTreeHostTimer.startOneShot(5_s);
+
+ m_dirtyRegion = m_webPage.bounds();
+
+ if (m_inUpdateBackingStoreState)
+ return;
+
+ if (m_shouldSendDidUpdateBackingStoreState) {
+ sendDidUpdateBackingStoreState();
+ return;
+ }
+
+ UpdateInfo updateInfo;
+ if (m_isPaintingSuspended) {
+ updateInfo.viewSize = m_webPage.size();
+ updateInfo.deviceScaleFactor = m_webPage.corePage()->deviceScaleFactor();
+ } else
+ display(updateInfo);
+
+ // Send along a complete update of the page so we can paint the contents right after we exit the
+ // accelerated compositing mode, eliminiating flicker.
+ if (m_compositingAccordingToProxyMessages) {
+ m_webPage.send(Messages::DrawingAreaProxy::ExitAcceleratedCompositingMode(m_backingStoreStateID, updateInfo));
+ m_compositingAccordingToProxyMessages = false;
+ } else {
+ // If we left accelerated compositing mode before we sent an EnterAcceleratedCompositingMode message to the
+ // UI process, we still need to let it know about the new contents, so send an Update message.
+ m_webPage.send(Messages::DrawingAreaProxy::Update(m_backingStoreStateID, updateInfo));
+ }
+}
+
+void DrawingAreaCoordinatedGraphics::scheduleDisplay()
+{
+ ASSERT(!m_layerTreeHost);
+
+ if (m_isWaitingForDidUpdate)
+ return;
+
+ if (m_isPaintingSuspended)
+ return;
+
+ if (m_dirtyRegion.isEmpty())
+ return;
+
+ if (m_displayTimer.isActive())
+ return;
+
+ m_displayTimer.startOneShot(0_s);
+}
+
+void DrawingAreaCoordinatedGraphics::displayTimerFired()
+{
+ display();
+}
+
+void DrawingAreaCoordinatedGraphics::display()
+{
+ ASSERT(!m_layerTreeHost);
+ ASSERT(!m_isWaitingForDidUpdate);
+ ASSERT(!m_inUpdateBackingStoreState);
+
+ if (m_isPaintingSuspended)
+ return;
+
+ if (m_dirtyRegion.isEmpty())
+ return;
+
+ if (m_shouldSendDidUpdateBackingStoreState) {
+ sendDidUpdateBackingStoreState();
+ return;
+ }
+
+ UpdateInfo updateInfo;
+ display(updateInfo);
+
+ if (m_layerTreeHost) {
+ // The call to update caused layout which turned on accelerated compositing.
+ // Don't send an Update message in this case.
+ return;
+ }
+
+ m_webPage.send(Messages::DrawingAreaProxy::Update(m_backingStoreStateID, updateInfo));
+ m_isWaitingForDidUpdate = true;
+}
+
+static bool shouldPaintBoundsRect(const IntRect& bounds, const Vector<IntRect>& rects)
+{
+ const size_t rectThreshold = 10;
+ const double wastedSpaceThreshold = 0.75;
+
+ if (rects.size() <= 1 || rects.size() > rectThreshold)
+ return true;
+
+ // Attempt to guess whether or not we should use the region bounds rect or the individual rects.
+ // We do this by computing the percentage of "wasted space" in the bounds. If that wasted space
+ // is too large, then we will do individual rect painting instead.
+ unsigned boundsArea = bounds.width() * bounds.height();
+ unsigned rectsArea = 0;
+ for (size_t i = 0; i < rects.size(); ++i)
+ rectsArea += rects[i].width() * rects[i].height();
+
+ double wastedSpace = 1 - (static_cast<double>(rectsArea) / boundsArea);
+
+ return wastedSpace <= wastedSpaceThreshold;
+}
+
+void DrawingAreaCoordinatedGraphics::display(UpdateInfo& updateInfo)
+{
+ ASSERT(!m_isPaintingSuspended);
+ ASSERT(!m_layerTreeHost);
+ ASSERT(!m_webPage.size().isEmpty());
+
+ m_webPage.layoutIfNeeded();
+ m_webPage.flushPendingEditorStateUpdate();
+
+ // The layout may have put the page into accelerated compositing mode. If the LayerTreeHost is
+ // in charge of displaying, we have nothing more to do.
+ if (m_layerTreeHost)
+ return;
+
+ m_webPage.willDisplayPage();
+ updateInfo.viewSize = m_webPage.size();
+ updateInfo.deviceScaleFactor = m_webPage.corePage()->deviceScaleFactor();
+
+ IntRect bounds = m_dirtyRegion.bounds();
+ ASSERT(m_webPage.bounds().contains(bounds));
+
+ IntSize bitmapSize = bounds.size();
+ float deviceScaleFactor = m_webPage.corePage()->deviceScaleFactor();
+ bitmapSize.scale(deviceScaleFactor);
+ auto bitmap = ShareableBitmap::createShareable(bitmapSize, { });
+ if (!bitmap)
+ return;
+
+ if (!bitmap->createHandle(updateInfo.bitmapHandle))
+ return;
+
+ Vector<IntRect> rects = m_dirtyRegion.rects();
+ if (shouldPaintBoundsRect(bounds, rects)) {
+ rects.clear();
+ rects.append(bounds);
+ }
+
+ updateInfo.scrollRect = m_scrollRect;
+ updateInfo.scrollOffset = m_scrollOffset;
+
+ m_dirtyRegion = Region();
+ m_scrollRect = IntRect();
+ m_scrollOffset = IntSize();
+
+ auto graphicsContext = bitmap->createGraphicsContext();
+ graphicsContext->applyDeviceScaleFactor(deviceScaleFactor);
+
+ updateInfo.updateRectBounds = bounds;
+
+ graphicsContext->translate(-bounds.x(), -bounds.y());
+
+ for (const auto& rect : rects) {
+ m_webPage.drawRect(*graphicsContext, rect);
+ updateInfo.updateRects.append(rect);
+ }
+
+ // Layout can trigger more calls to setNeedsDisplay and we don't want to process them
+ // until the UI process has painted the update, so we stop the timer here.
+ m_displayTimer.stop();
+}
+
+} // namespace WebKit
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitWebProcessWebPageCoordinatedGraphicsDrawingAreaCoordinatedGraphicshfromrev243981releasesWebKitGTKwebkit224SourceWebKitWebProcessWebPageAcceleratedDrawingAreah"></a>
<div class="copfile"><h4>Copied: releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h (from rev 243981, releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.h) (0 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h (rev 0)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -0,0 +1,154 @@
</span><ins>+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ * Copyright (C) 2019 Igalia S.L.
+ *
+ * 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
+
+#include "DrawingArea.h"
+#include <WebCore/Region.h>
+#include <wtf/RunLoop.h>
+
+namespace WebCore {
+class GraphicsContext;
+}
+
+namespace WebKit {
+
+class ShareableBitmap;
+class UpdateInfo;
+
+class DrawingAreaCoordinatedGraphics final : public DrawingArea {
+public:
+ DrawingAreaCoordinatedGraphics(WebPage&, const WebPageCreationParameters&);
+ virtual ~DrawingAreaCoordinatedGraphics();
+
+private:
+ // DrawingArea
+ void setNeedsDisplay() override;
+ void setNeedsDisplayInRect(const WebCore::IntRect&) override;
+ void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollDelta) override;
+ void forceRepaint() override;
+ bool forceRepaintAsync(CallbackID) override;
+
+ void setLayerTreeStateIsFrozen(bool) override;
+ bool layerTreeStateIsFrozen() const override { return m_layerTreeStateIsFrozen; }
+
+ void setPaintingEnabled(bool paintingEnabled) override { m_isPaintingEnabled = paintingEnabled; };
+ void updatePreferences(const WebPreferencesStore&) override;
+ void mainFrameContentSizeChanged(const WebCore::IntSize&) override;
+ void deviceOrPageScaleFactorChanged() override;
+ void didChangeViewportAttributes(WebCore::ViewportAttributes&&) override;
+
+ WebCore::GraphicsLayerFactory* graphicsLayerFactory() override;
+ void setRootCompositingLayer(WebCore::GraphicsLayer*) override;
+ void scheduleInitialDeferredPaint() override { };
+ void scheduleCompositingLayerFlush() override;
+ void scheduleCompositingLayerFlushImmediately() override { scheduleCompositingLayerFlush(); };
+ void layerHostDidFlushLayers() override;
+
+#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
+ RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(WebCore::PlatformDisplayID) override;
+#endif
+
+#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
+ void setNativeSurfaceHandleForCompositing(uint64_t) override;
+ void destroyNativeSurfaceHandleForCompositing(bool&) override;
+#endif
+
+ void activityStateDidChange(OptionSet<WebCore::ActivityState::Flag>, ActivityStateChangeID, const Vector<CallbackID>& /* callbackIDs */) override;
+ void attachViewOverlayGraphicsLayer(WebCore::GraphicsLayer*) override;
+
+ // IPC message handlers.
+ void updateBackingStoreState(uint64_t backingStoreStateID, bool respondImmediately, float deviceScaleFactor, const WebCore::IntSize&, const WebCore::IntSize& scrollOffset) override;
+ void didUpdate() override;
+
+ void sendDidUpdateBackingStoreState();
+
+ void exitAcceleratedCompositingModeSoon();
+ bool exitAcceleratedCompositingModePending() const { return m_exitCompositingTimer.isActive(); }
+ void discardPreviousLayerTreeHost();
+
+ void suspendPainting();
+ void resumePainting();
+
+ void enterAcceleratedCompositingMode(WebCore::GraphicsLayer*);
+ void exitAcceleratedCompositingMode();
+
+ void scheduleDisplay();
+ void displayTimerFired();
+ void display();
+ void display(UpdateInfo&);
+
+ uint64_t m_backingStoreStateID { 0 };
+
+ // Whether painting is enabled. If painting is disabled, any calls to setNeedsDisplay and scroll are ignored.
+ bool m_isPaintingEnabled { true };
+
+ // Whether we're currently processing an UpdateBackingStoreState message.
+ bool m_inUpdateBackingStoreState { false };
+
+ // When true, we should send an UpdateBackingStoreState message instead of any other messages
+ // we normally send to the UI process.
+ bool m_shouldSendDidUpdateBackingStoreState { false };
+
+ // True between sending the 'enter compositing' messages, and the 'exit compositing' message.
+ bool m_compositingAccordingToProxyMessages { false };
+
+ // When true, we maintain the layer tree in its current state by not leaving accelerated compositing mode
+ // and not scheduling layer flushes.
+ bool m_layerTreeStateIsFrozen { false };
+
+ // True when we were asked to exit accelerated compositing mode but couldn't because layer tree
+ // state was frozen.
+ bool m_wantsToExitAcceleratedCompositingMode { false };
+
+ // Whether painting is suspended. We'll still keep track of the dirty region but we
+ // won't paint until painting has resumed again.
+ bool m_isPaintingSuspended { false };
+
+ RunLoop::Timer<DrawingAreaCoordinatedGraphics> m_exitCompositingTimer;
+
+ // The layer tree host that handles accelerated compositing.
+ std::unique_ptr<LayerTreeHost> m_layerTreeHost;
+
+ std::unique_ptr<LayerTreeHost> m_previousLayerTreeHost;
+ RunLoop::Timer<DrawingAreaCoordinatedGraphics> m_discardPreviousLayerTreeHostTimer;
+
+ WebCore::Region m_dirtyRegion;
+ WebCore::IntRect m_scrollRect;
+ WebCore::IntSize m_scrollOffset;
+
+ // Whether we're waiting for a DidUpdate message. Used for throttling paints so that the
+ // web process won't paint more frequent than the UI process can handle.
+ bool m_isWaitingForDidUpdate { false };
+
+ bool m_alwaysUseCompositing {false };
+ bool m_forceRepaintAfterBackingStoreStateUpdate { false };
+
+ RunLoop::Timer<DrawingAreaCoordinatedGraphics> m_displayTimer;
+};
+
+} // namespace WebKit
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitWebProcessWebPageDrawingAreacpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/DrawingArea.cpp (243981 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/DrawingArea.cpp 2019-04-08 10:14:55 UTC (rev 243981)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/DrawingArea.cpp 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -37,10 +37,8 @@
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> #include "RemoteLayerTreeDrawingArea.h"
</span><span class="cx"> #include "TiledCoreAnimationDrawingArea.h"
</span><del>-#elif PLATFORM(WPE)
-#include "AcceleratedDrawingArea.h"
-#else
-#include "DrawingAreaImpl.h"
</del><ins>+#elif USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER)
+#include "DrawingAreaCoordinatedGraphics.h"
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -56,14 +54,10 @@
</span><span class="cx"> #endif
</span><span class="cx"> case DrawingAreaTypeRemoteLayerTree:
</span><span class="cx"> return std::make_unique<RemoteLayerTreeDrawingArea>(webPage, parameters);
</span><del>-#else
- case DrawingAreaTypeImpl:
-#if PLATFORM(WPE)
- return std::make_unique<AcceleratedDrawingArea>(webPage, parameters);
-#else
- return std::make_unique<DrawingAreaImpl>(webPage, parameters);
</del><ins>+#elif USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER)
+ case DrawingAreaTypeCoordinatedGraphics:
+ return std::make_unique<DrawingAreaCoordinatedGraphics>(webPage, parameters);
</ins><span class="cx"> #endif
</span><del>-#endif
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return nullptr;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitWebProcessWebPageDrawingAreah"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/DrawingArea.h (243981 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/DrawingArea.h 2019-04-08 10:14:55 UTC (rev 243981)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/DrawingArea.h 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -85,7 +85,6 @@
</span><span class="cx"> virtual void setLayerTreeStateIsFrozen(bool) { }
</span><span class="cx"> virtual bool layerTreeStateIsFrozen() const { return false; }
</span><span class="cx"> virtual bool layerFlushThrottlingIsActive() const { return false; }
</span><del>- virtual LayerTreeHost* layerTreeHost() const { return 0; }
</del><span class="cx">
</span><span class="cx"> virtual void setPaintingEnabled(bool) { }
</span><span class="cx"> virtual void updatePreferences(const WebPreferencesStore&) { }
</span><span class="lines">@@ -141,11 +140,8 @@
</span><span class="cx">
</span><span class="cx"> virtual void layerHostDidFlushLayers() { };
</span><span class="cx">
</span><del>-#if USE(COORDINATED_GRAPHICS)
</del><ins>+#if USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER)
</ins><span class="cx"> virtual void didChangeViewportAttributes(WebCore::ViewportAttributes&&) = 0;
</span><del>-#endif
-
-#if USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER)
</del><span class="cx"> virtual void deviceOrPageScaleFactorChanged() = 0;
</span><span class="cx"> #endif
</span><span class="cx">
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitWebProcessWebPageDrawingAreaImplcpp"></a>
<div class="delfile"><h4>Deleted: releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/DrawingAreaImpl.cpp (243981 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/DrawingAreaImpl.cpp 2019-04-08 10:14:55 UTC (rev 243981)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/DrawingAreaImpl.cpp 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -1,454 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 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 "DrawingAreaImpl.h"
-
-#include "DrawingAreaProxyMessages.h"
-#include "LayerTreeHost.h"
-#include "ShareableBitmap.h"
-#include "UpdateInfo.h"
-#include "WebPage.h"
-#include "WebPageCreationParameters.h"
-#include "WebPreferencesKeys.h"
-#include <WebCore/GraphicsContext.h>
-#include <WebCore/Page.h>
-#include <WebCore/Settings.h>
-
-#if USE(GLIB_EVENT_LOOP)
-#include <wtf/glib/RunLoopSourcePriority.h>
-#endif
-
-namespace WebKit {
-using namespace WebCore;
-
-DrawingAreaImpl::~DrawingAreaImpl()
-{
-}
-
-DrawingAreaImpl::DrawingAreaImpl(WebPage& webPage, const WebPageCreationParameters& parameters)
- : AcceleratedDrawingArea(webPage, parameters)
- , m_displayTimer(RunLoop::main(), this, &DrawingAreaImpl::displayTimerFired)
-{
-#if USE(GLIB_EVENT_LOOP)
- m_displayTimer.setPriority(RunLoopSourcePriority::NonAcceleratedDrawingTimer);
-#endif
-}
-
-void DrawingAreaImpl::setNeedsDisplay()
-{
- if (m_layerTreeHost) {
- ASSERT(m_dirtyRegion.isEmpty());
- return;
- }
-
- setNeedsDisplayInRect(m_webPage.bounds());
-}
-
-void DrawingAreaImpl::setNeedsDisplayInRect(const IntRect& rect)
-{
- if (m_layerTreeHost) {
- ASSERT(m_dirtyRegion.isEmpty());
- return;
- }
-
- if (!m_isPaintingEnabled)
- return;
-
- IntRect dirtyRect = rect;
- dirtyRect.intersect(m_webPage.bounds());
- if (dirtyRect.isEmpty())
- return;
-
- m_dirtyRegion.unite(dirtyRect);
- scheduleDisplay();
-}
-
-void DrawingAreaImpl::scroll(const IntRect& scrollRect, const IntSize& scrollDelta)
-{
- if (m_layerTreeHost) {
- ASSERT(m_scrollRect.isEmpty());
- ASSERT(m_scrollOffset.isEmpty());
- ASSERT(m_dirtyRegion.isEmpty());
- AcceleratedDrawingArea::scroll(scrollRect, scrollDelta);
- return;
- }
-
- if (!m_isPaintingEnabled)
- return;
-
- if (scrollRect.isEmpty())
- return;
-
- if (m_previousLayerTreeHost)
- m_previousLayerTreeHost->scrollNonCompositedContents(scrollRect);
-
- if (!m_scrollRect.isEmpty() && scrollRect != m_scrollRect) {
- unsigned scrollArea = scrollRect.width() * scrollRect.height();
- unsigned currentScrollArea = m_scrollRect.width() * m_scrollRect.height();
-
- if (currentScrollArea >= scrollArea) {
- // The rect being scrolled is at least as large as the rect we'd like to scroll.
- // Go ahead and just invalidate the scroll rect.
- setNeedsDisplayInRect(scrollRect);
- return;
- }
-
- // Just repaint the entire current scroll rect, we'll scroll the new rect instead.
- setNeedsDisplayInRect(m_scrollRect);
- m_scrollRect = IntRect();
- m_scrollOffset = IntSize();
- }
-
- // Get the part of the dirty region that is in the scroll rect.
- Region dirtyRegionInScrollRect = intersect(scrollRect, m_dirtyRegion);
- if (!dirtyRegionInScrollRect.isEmpty()) {
- // There are parts of the dirty region that are inside the scroll rect.
- // We need to subtract them from the region, move them and re-add them.
- m_dirtyRegion.subtract(scrollRect);
-
- // Move the dirty parts.
- Region movedDirtyRegionInScrollRect = intersect(translate(dirtyRegionInScrollRect, scrollDelta), scrollRect);
-
- // And add them back.
- m_dirtyRegion.unite(movedDirtyRegionInScrollRect);
- }
-
- // Compute the scroll repaint region.
- Region scrollRepaintRegion = subtract(scrollRect, translate(scrollRect, scrollDelta));
-
- m_dirtyRegion.unite(scrollRepaintRegion);
- scheduleDisplay();
-
- m_scrollRect = scrollRect;
- m_scrollOffset += scrollDelta;
-}
-
-void DrawingAreaImpl::forceRepaint()
-{
- if (m_inUpdateBackingStoreState) {
- m_forceRepaintAfterBackingStoreStateUpdate = true;
- return;
- }
- m_forceRepaintAfterBackingStoreStateUpdate = false;
-
- if (m_layerTreeHost) {
- AcceleratedDrawingArea::forceRepaint();
- return;
- }
-
- m_isWaitingForDidUpdate = false;
- if (m_isPaintingEnabled) {
- m_dirtyRegion = m_webPage.bounds();
- display();
- }
-}
-
-void DrawingAreaImpl::updatePreferences(const WebPreferencesStore& store)
-{
- Settings& settings = m_webPage.corePage()->settings();
- settings.setForceCompositingMode(store.getBoolValueForKey(WebPreferencesKey::forceCompositingModeKey()));
-
-#if USE(COORDINATED_GRAPHICS)
- // Fixed position elements need to be composited and create stacking contexts
- // in order to be scrolled by the ScrollingCoordinator.
- settings.setAcceleratedCompositingForFixedPositionEnabled(settings.acceleratedCompositingEnabled());
-#endif
-
- m_alwaysUseCompositing = settings.acceleratedCompositingEnabled() && settings.forceCompositingMode();
- if (m_alwaysUseCompositing && !m_layerTreeHost)
- enterAcceleratedCompositingMode(nullptr);
-}
-
-void DrawingAreaImpl::setRootCompositingLayer(GraphicsLayer* graphicsLayer)
-{
- if (m_layerTreeHost) {
- AcceleratedDrawingArea::setRootCompositingLayer(graphicsLayer);
-
- if (!graphicsLayer && !m_alwaysUseCompositing) {
- // We'll exit accelerated compositing mode on a timer, to avoid re-entering
- // compositing code via display() and layout.
- // If we're leaving compositing mode because of a setSize, it is safe to
- // exit accelerated compositing mode right away.
- if (m_inUpdateBackingStoreState)
- exitAcceleratedCompositingMode();
- else
- exitAcceleratedCompositingModeSoon();
- }
- return;
- }
-
- if (!graphicsLayer)
- return;
-
- // We're actually entering accelerated compositing mode.
- enterAcceleratedCompositingMode(graphicsLayer);
-}
-
-void DrawingAreaImpl::updateBackingStoreState(uint64_t stateID, bool respondImmediately, float deviceScaleFactor, const WebCore::IntSize& size, const WebCore::IntSize& scrollOffset)
-{
- if (stateID != m_backingStoreStateID && !m_layerTreeHost)
- m_dirtyRegion = IntRect(IntPoint(), size);
-
- AcceleratedDrawingArea::updateBackingStoreState(stateID, respondImmediately, deviceScaleFactor, size, scrollOffset);
-
- if (m_forceRepaintAfterBackingStoreStateUpdate)
- forceRepaint();
-}
-
-void DrawingAreaImpl::didUpdateBackingStoreState()
-{
- // The UI process has updated to a new backing store state. Any Update messages we sent before
- // this point will be ignored. We wait to set this to false until after updating the page's
- // size so that any displays triggered by the relayout will be ignored. If we're supposed to
- // respond to the UpdateBackingStoreState message immediately, we'll do a display anyway in
- // sendDidUpdateBackingStoreState; otherwise we shouldn't do one right now.
- m_isWaitingForDidUpdate = false;
-}
-
-void DrawingAreaImpl::sendDidUpdateBackingStoreState()
-{
- ASSERT(!m_isWaitingForDidUpdate);
- ASSERT(m_shouldSendDidUpdateBackingStoreState);
-
- if (!m_isPaintingSuspended && !m_layerTreeHost) {
- UpdateInfo updateInfo;
- display(updateInfo);
- if (!m_layerTreeHost) {
- m_shouldSendDidUpdateBackingStoreState = false;
-
- LayerTreeContext layerTreeContext;
- m_webPage.send(Messages::DrawingAreaProxy::DidUpdateBackingStoreState(m_backingStoreStateID, updateInfo, layerTreeContext));
- m_compositingAccordingToProxyMessages = false;
- return;
- }
- }
-
- AcceleratedDrawingArea::sendDidUpdateBackingStoreState();
-}
-
-void DrawingAreaImpl::didUpdate()
-{
- // We might get didUpdate messages from the UI process even after we've
- // entered accelerated compositing mode. Ignore them.
- if (m_layerTreeHost)
- return;
-
- m_isWaitingForDidUpdate = false;
-
- // Display if needed. We call displayTimerFired here since it will throttle updates to 60fps.
- displayTimerFired();
-}
-
-void DrawingAreaImpl::suspendPainting()
-{
- AcceleratedDrawingArea::suspendPainting();
- m_displayTimer.stop();
-}
-
-void DrawingAreaImpl::enterAcceleratedCompositingMode(GraphicsLayer* graphicsLayer)
-{
- AcceleratedDrawingArea::enterAcceleratedCompositingMode(graphicsLayer);
-
- // Non-composited content will now be handled exclusively by the layer tree host.
- m_dirtyRegion = Region();
- m_scrollRect = IntRect();
- m_scrollOffset = IntSize();
- m_displayTimer.stop();
- m_isWaitingForDidUpdate = false;
-}
-
-void DrawingAreaImpl::exitAcceleratedCompositingMode()
-{
- if (m_alwaysUseCompositing)
- return;
-
- AcceleratedDrawingArea::exitAcceleratedCompositingModeNow();
- m_dirtyRegion = m_webPage.bounds();
-
- if (m_inUpdateBackingStoreState)
- return;
-
- if (m_shouldSendDidUpdateBackingStoreState) {
- sendDidUpdateBackingStoreState();
- return;
- }
-
- UpdateInfo updateInfo;
- if (m_isPaintingSuspended) {
- updateInfo.viewSize = m_webPage.size();
- updateInfo.deviceScaleFactor = m_webPage.corePage()->deviceScaleFactor();
- } else
- display(updateInfo);
-
- // Send along a complete update of the page so we can paint the contents right after we exit the
- // accelerated compositing mode, eliminiating flicker.
- if (m_compositingAccordingToProxyMessages) {
- m_webPage.send(Messages::DrawingAreaProxy::ExitAcceleratedCompositingMode(m_backingStoreStateID, updateInfo));
- m_compositingAccordingToProxyMessages = false;
- } else {
- // If we left accelerated compositing mode before we sent an EnterAcceleratedCompositingMode message to the
- // UI process, we still need to let it know about the new contents, so send an Update message.
- m_webPage.send(Messages::DrawingAreaProxy::Update(m_backingStoreStateID, updateInfo));
- }
-}
-
-void DrawingAreaImpl::scheduleDisplay()
-{
- ASSERT(!m_layerTreeHost);
-
- if (m_isWaitingForDidUpdate)
- return;
-
- if (m_isPaintingSuspended)
- return;
-
- if (m_dirtyRegion.isEmpty())
- return;
-
- if (m_displayTimer.isActive())
- return;
-
- m_displayTimer.startOneShot(0_s);
-}
-
-void DrawingAreaImpl::displayTimerFired()
-{
- display();
-}
-
-void DrawingAreaImpl::display()
-{
- ASSERT(!m_layerTreeHost);
- ASSERT(!m_isWaitingForDidUpdate);
- ASSERT(!m_inUpdateBackingStoreState);
-
- if (m_isPaintingSuspended)
- return;
-
- if (m_dirtyRegion.isEmpty())
- return;
-
- if (m_shouldSendDidUpdateBackingStoreState) {
- sendDidUpdateBackingStoreState();
- return;
- }
-
- UpdateInfo updateInfo;
- display(updateInfo);
-
- if (m_layerTreeHost) {
- // The call to update caused layout which turned on accelerated compositing.
- // Don't send an Update message in this case.
- return;
- }
-
- m_webPage.send(Messages::DrawingAreaProxy::Update(m_backingStoreStateID, updateInfo));
- m_isWaitingForDidUpdate = true;
-}
-
-static bool shouldPaintBoundsRect(const IntRect& bounds, const Vector<IntRect>& rects)
-{
- const size_t rectThreshold = 10;
- const double wastedSpaceThreshold = 0.75;
-
- if (rects.size() <= 1 || rects.size() > rectThreshold)
- return true;
-
- // Attempt to guess whether or not we should use the region bounds rect or the individual rects.
- // We do this by computing the percentage of "wasted space" in the bounds. If that wasted space
- // is too large, then we will do individual rect painting instead.
- unsigned boundsArea = bounds.width() * bounds.height();
- unsigned rectsArea = 0;
- for (size_t i = 0; i < rects.size(); ++i)
- rectsArea += rects[i].width() * rects[i].height();
-
- double wastedSpace = 1 - (static_cast<double>(rectsArea) / boundsArea);
-
- return wastedSpace <= wastedSpaceThreshold;
-}
-
-void DrawingAreaImpl::display(UpdateInfo& updateInfo)
-{
- ASSERT(!m_isPaintingSuspended);
- ASSERT(!m_layerTreeHost);
- ASSERT(!m_webPage.size().isEmpty());
-
- m_webPage.layoutIfNeeded();
- m_webPage.flushPendingEditorStateUpdate();
-
- // The layout may have put the page into accelerated compositing mode. If the LayerTreeHost is
- // in charge of displaying, we have nothing more to do.
- if (m_layerTreeHost)
- return;
-
- m_webPage.willDisplayPage();
- updateInfo.viewSize = m_webPage.size();
- updateInfo.deviceScaleFactor = m_webPage.corePage()->deviceScaleFactor();
-
- IntRect bounds = m_dirtyRegion.bounds();
- ASSERT(m_webPage.bounds().contains(bounds));
-
- IntSize bitmapSize = bounds.size();
- float deviceScaleFactor = m_webPage.corePage()->deviceScaleFactor();
- bitmapSize.scale(deviceScaleFactor);
- auto bitmap = ShareableBitmap::createShareable(bitmapSize, { });
- if (!bitmap)
- return;
-
- if (!bitmap->createHandle(updateInfo.bitmapHandle))
- return;
-
- Vector<IntRect> rects = m_dirtyRegion.rects();
- if (shouldPaintBoundsRect(bounds, rects)) {
- rects.clear();
- rects.append(bounds);
- }
-
- updateInfo.scrollRect = m_scrollRect;
- updateInfo.scrollOffset = m_scrollOffset;
-
- m_dirtyRegion = Region();
- m_scrollRect = IntRect();
- m_scrollOffset = IntSize();
-
- auto graphicsContext = bitmap->createGraphicsContext();
- graphicsContext->applyDeviceScaleFactor(deviceScaleFactor);
-
- updateInfo.updateRectBounds = bounds;
-
- graphicsContext->translate(-bounds.x(), -bounds.y());
-
- for (const auto& rect : rects) {
- m_webPage.drawRect(*graphicsContext, rect);
- updateInfo.updateRects.append(rect);
- }
-
- // Layout can trigger more calls to setNeedsDisplay and we don't want to process them
- // until the UI process has painted the update, so we stop the timer here.
- m_displayTimer.stop();
-}
-
-} // namespace WebKit
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitWebProcessWebPageDrawingAreaImplh"></a>
<div class="delfile"><h4>Deleted: releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/DrawingAreaImpl.h (243981 => 243982)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/DrawingAreaImpl.h 2019-04-08 10:14:55 UTC (rev 243981)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/DrawingAreaImpl.h 2019-04-08 10:15:06 UTC (rev 243982)
</span><span class="lines">@@ -1,87 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 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
-
-#include "AcceleratedDrawingArea.h"
-#include <WebCore/Region.h>
-
-namespace WebCore {
-class GraphicsContext;
-}
-
-namespace WebKit {
-
-class ShareableBitmap;
-class UpdateInfo;
-
-class DrawingAreaImpl final : public AcceleratedDrawingArea {
-public:
- DrawingAreaImpl(WebPage&, const WebPageCreationParameters&);
- virtual ~DrawingAreaImpl();
-
-private:
- // DrawingArea
- void setNeedsDisplay() override;
- void setNeedsDisplayInRect(const WebCore::IntRect&) override;
- void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollDelta) override;
- void forceRepaint() override;
-
- void updatePreferences(const WebPreferencesStore&) override;
-
- void setRootCompositingLayer(WebCore::GraphicsLayer*) override;
-
- // IPC message handlers.
- void updateBackingStoreState(uint64_t backingStoreStateID, bool respondImmediately, float deviceScaleFactor, const WebCore::IntSize&, const WebCore::IntSize& scrollOffset) override;
- void didUpdate() override;
-
- // AcceleratedDrawingArea
- void suspendPainting() override;
- void sendDidUpdateBackingStoreState() override;
- void didUpdateBackingStoreState() override;
-
- void enterAcceleratedCompositingMode(WebCore::GraphicsLayer*) override;
- void exitAcceleratedCompositingMode() override;
-
- void scheduleDisplay();
- void displayTimerFired();
- void display();
- void display(UpdateInfo&);
-
- WebCore::Region m_dirtyRegion;
- WebCore::IntRect m_scrollRect;
- WebCore::IntSize m_scrollOffset;
-
- // Whether we're waiting for a DidUpdate message. Used for throttling paints so that the
- // web process won't paint more frequent than the UI process can handle.
- bool m_isWaitingForDidUpdate { false };
-
- bool m_alwaysUseCompositing {false };
- bool m_forceRepaintAfterBackingStoreStateUpdate { false };
-
- RunLoop::Timer<DrawingAreaImpl> m_displayTimer;
-};
-
-} // namespace WebKit
</del></span></pre>
</div>
</div>
</body>
</html>