Diff
Modified: trunk/Source/WTF/ChangeLog (256833 => 256834)
--- trunk/Source/WTF/ChangeLog 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WTF/ChangeLog 2020-02-18 17:24:30 UTC (rev 256834)
@@ -1,3 +1,12 @@
+2020-02-18 Simon Fraser <simon.fra...@apple.com>
+
+ Move from "layer flush" terminology to "rendering update"
+ https://bugs.webkit.org/show_bug.cgi?id=207870
+
+ Reviewed by Tim Horton.
+
+ * wtf/SystemTracing.h:
+
2020-02-17 Chris Dumez <cdu...@apple.com>
[WK2][Cocoa] Implement in-WebProcess cookie cache to avoid sync IPC for document.cookie in most cases
Modified: trunk/Source/WTF/wtf/SystemTracing.h (256833 => 256834)
--- trunk/Source/WTF/wtf/SystemTracing.h 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WTF/wtf/SystemTracing.h 2020-02-18 17:24:30 UTC (rev 256834)
@@ -102,8 +102,8 @@
SyncTouchEventEnd,
InitializeWebProcessStart,
InitializeWebProcessEnd,
- LayerFlushRunLoopObserverStart,
- LayerFlushRunLoopObserverEnd,
+ RenderingUpdateRunLoopObserverStart,
+ RenderingUpdateRunLoopObserverEnd,
LayerTreeFreezeStart,
LayerTreeFreezeEnd,
Modified: trunk/Source/WebCore/ChangeLog (256833 => 256834)
--- trunk/Source/WebCore/ChangeLog 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebCore/ChangeLog 2020-02-18 17:24:30 UTC (rev 256834)
@@ -1,3 +1,35 @@
+2020-02-18 Simon Fraser <simon.fra...@apple.com>
+
+ Move from "layer flush" terminology to "rendering update"
+ https://bugs.webkit.org/show_bug.cgi?id=207870
+
+ Reviewed by Tim Horton.
+
+ Rename various functions and member variables to move away from the legacy "layer flush"
+ terminology and instead use "rendering update", matching Page::updateRendering(). The fact
+ that we have layers is an implementation detail.
+
+ Change LayerFlushThrottlingState to be an OptionSet<>.
+
+ * Headers.cmake:
+ * WebCore.xcodeproj/project.pbxproj:
+ * dom/Document.cpp:
+ (WebCore::Document::scheduleStyleRecalc):
+ (WebCore::Document::shouldScheduleLayout):
+ * loader/EmptyClients.h:
+ * page/ChromeClient.h:
+ (WebCore::ChromeClient::renderingUpdateThrottlingIsActive const):
+ (WebCore::ChromeClient::adjustRenderUpdateThrottling):
+ (WebCore::ChromeClient::layerFlushThrottlingIsActive const): Deleted.
+ (WebCore::ChromeClient::adjustLayerFlushThrottling): Deleted.
+ * page/FrameView.cpp:
+ (WebCore::determineLayerFlushThrottleState):
+ (WebCore::FrameView::disableLayerFlushThrottlingTemporarilyForInteraction):
+ (WebCore::FrameView::updateLayerFlushThrottling):
+ * page/RenderingUpdateScheduler.cpp:
+ (WebCore::RenderingUpdateScheduler::scheduleImmediateRenderingUpdate):
+ * page/RenderingUpdateThrottleState.h: Renamed from Source/WebCore/page/LayerFlushThrottleState.h.
+
2020-02-18 Chris Dumez <cdu...@apple.com>
ASSERT_NOT_REACHED() under WebPageProxy::suspendCurrentPageIfPossible()
Modified: trunk/Source/WebCore/Headers.cmake (256833 => 256834)
--- trunk/Source/WebCore/Headers.cmake 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebCore/Headers.cmake 2020-02-18 17:24:30 UTC (rev 256834)
@@ -811,7 +811,6 @@
page/FrameViewLayoutContext.h
page/GlobalFrameIdentifier.h
page/GlobalWindowIdentifier.h
- page/LayerFlushThrottleState.h
page/LayoutMilestone.h
page/MediaCanStartListener.h
page/MediaProducer.h
@@ -837,6 +836,7 @@
page/RemoteDOMWindow.h
page/RemoteFrame.h
page/RenderingUpdateScheduler.h
+ page/RenderingUpdateThrottleState.h
page/RuntimeEnabledFeatures.h
page/ScrollBehavior.h
page/ScrollIntoViewOptions.h
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (256833 => 256834)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2020-02-18 17:24:30 UTC (rev 256834)
@@ -4875,7 +4875,7 @@
E484A33E23055325009ADE6A /* LineLayoutTraversal.h in Headers */ = {isa = PBXBuildFile; fileRef = E484A33B23055303009ADE6A /* LineLayoutTraversal.h */; settings = {ATTRIBUTES = (Private, ); }; };
E4863CFE23842E9E00972158 /* RuleData.h in Headers */ = {isa = PBXBuildFile; fileRef = E4863CFD23842E9E00972158 /* RuleData.h */; };
E48944A3180B57D800F165D8 /* SimpleLineLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = E48944A1180B57D800F165D8 /* SimpleLineLayout.h */; settings = {ATTRIBUTES = (Private, ); }; };
- E4916FF7195DF6A0005AB349 /* LayerFlushThrottleState.h in Headers */ = {isa = PBXBuildFile; fileRef = E4916FF6195DF6A0005AB349 /* LayerFlushThrottleState.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ E4916FF7195DF6A0005AB349 /* RenderingUpdateThrottleState.h in Headers */ = {isa = PBXBuildFile; fileRef = E4916FF6195DF6A0005AB349 /* RenderingUpdateThrottleState.h */; settings = {ATTRIBUTES = (Private, ); }; };
E4946EAF156E64DD00D3297F /* StyleRuleImport.h in Headers */ = {isa = PBXBuildFile; fileRef = E4946EAD156E64DD00D3297F /* StyleRuleImport.h */; settings = {ATTRIBUTES = (Private, ); }; };
E49BD9FA131FD2ED003C56F0 /* CSSValuePool.h in Headers */ = {isa = PBXBuildFile; fileRef = E49BD9F9131FD2ED003C56F0 /* CSSValuePool.h */; };
E4A7995220EE4B1400C19568 /* CSSParserContext.h in Headers */ = {isa = PBXBuildFile; fileRef = E4A7994E20EE4AE100C19568 /* CSSParserContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -15260,7 +15260,7 @@
E4863CFD23842E9E00972158 /* RuleData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RuleData.h; sourceTree = "<group>"; };
E48944A0180B57D800F165D8 /* SimpleLineLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleLineLayout.cpp; sourceTree = "<group>"; };
E48944A1180B57D800F165D8 /* SimpleLineLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleLineLayout.h; sourceTree = "<group>"; };
- E4916FF6195DF6A0005AB349 /* LayerFlushThrottleState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayerFlushThrottleState.h; sourceTree = "<group>"; };
+ E4916FF6195DF6A0005AB349 /* RenderingUpdateThrottleState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderingUpdateThrottleState.h; sourceTree = "<group>"; };
E4946EAC156E64DD00D3297F /* StyleRuleImport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleRuleImport.cpp; sourceTree = "<group>"; };
E4946EAD156E64DD00D3297F /* StyleRuleImport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleRuleImport.h; sourceTree = "<group>"; };
E49BD9F9131FD2ED003C56F0 /* CSSValuePool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSValuePool.h; sourceTree = "<group>"; };
@@ -20644,7 +20644,6 @@
0F4710D81DB6FE22002DCEC3 /* IntersectionObserverEntry.cpp */,
0F4710D91DB6FE22002DCEC3 /* IntersectionObserverEntry.h */,
0F4710DA1DB6FE22002DCEC3 /* IntersectionObserverEntry.idl */,
- E4916FF6195DF6A0005AB349 /* LayerFlushThrottleState.h */,
931D72F515FE695300C4C07E /* LayoutMilestone.h */,
BCE1C41A0D982980003B02F2 /* Location.cpp */,
BCE1C4190D982980003B02F2 /* Location.h */,
@@ -20749,6 +20748,7 @@
46B95192207D632E00A7D2DD /* RemoteFrame.h */,
556C7C4922123943009B06CA /* RenderingUpdateScheduler.cpp */,
556C7C4722123942009B06CA /* RenderingUpdateScheduler.h */,
+ E4916FF6195DF6A0005AB349 /* RenderingUpdateThrottleState.h */,
58B2F9F22232D43F00938D63 /* ResizeObservation.cpp */,
58B2F9F32232D43F00938D63 /* ResizeObservation.h */,
58B2F9EF2232D43D00938D63 /* ResizeObserver.cpp */,
@@ -31270,7 +31270,6 @@
450CEBF115073BBE002BB149 /* LabelableElement.h in Headers */,
A456FA2711AD4A830020B420 /* LabelsNodeList.h in Headers */,
0FEC120C22BF2CD2004E9D35 /* LayerAncestorClippingStack.h in Headers */,
- E4916FF7195DF6A0005AB349 /* LayerFlushThrottleState.h in Headers */,
580371641A66F1D300BAF519 /* LayerFragment.h in Headers */,
7AA3A6A0194B59B6001CBD24 /* LayerPool.h in Headers */,
11310CF720BA4A620065A8D0 /* LayoutAncestorIterator.h in Headers */,
@@ -31929,6 +31928,7 @@
08641D4812142F7D008DE9F6 /* RenderImageResourceStyleImage.h in Headers */,
7299BC6823D6A53E00CC6883 /* RenderingMode.h in Headers */,
556C7C4B22123997009B06CA /* RenderingUpdateScheduler.h in Headers */,
+ E4916FF7195DF6A0005AB349 /* RenderingUpdateThrottleState.h in Headers */,
BCEA4878097D93020094C9E4 /* RenderInline.h in Headers */,
B595FF471824CEE300FF51CD /* RenderIterator.h in Headers */,
BCEA487A097D93020094C9E4 /* RenderLayer.h in Headers */,
Modified: trunk/Source/WebCore/dom/Document.cpp (256833 => 256834)
--- trunk/Source/WebCore/dom/Document.cpp 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebCore/dom/Document.cpp 2020-02-18 17:24:30 UTC (rev 256834)
@@ -1875,7 +1875,7 @@
auto shouldThrottleStyleRecalc = [&] {
if (!view() || !view()->isVisuallyNonEmpty())
return false;
- if (!page() || !page()->chrome().client().layerFlushThrottlingIsActive())
+ if (!page() || !page()->chrome().client().renderingUpdateThrottlingIsActive())
return false;
return true;
};
@@ -3135,7 +3135,7 @@
return false;
if (styleScope().hasPendingSheetsBeforeBody())
return false;
- if (page() && page()->chrome().client().layerFlushThrottlingIsActive() && view() && view()->isVisuallyNonEmpty())
+ if (page() && page()->chrome().client().renderingUpdateThrottlingIsActive() && view() && view()->isVisuallyNonEmpty())
return false;
return true;
Modified: trunk/Source/WebCore/loader/EmptyClients.h (256833 => 256834)
--- trunk/Source/WebCore/loader/EmptyClients.h 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebCore/loader/EmptyClients.h 2020-02-18 17:24:30 UTC (rev 256834)
@@ -150,7 +150,7 @@
void attachRootGraphicsLayer(Frame&, GraphicsLayer*) final { }
void attachViewOverlayGraphicsLayer(GraphicsLayer*) final { }
void setNeedsOneShotDrawingSynchronization() final { }
- void scheduleCompositingLayerFlush() final { }
+ void scheduleRenderingUpdate() final { }
#if PLATFORM(WIN)
void setLastSetCursorToCurrentCursor() final { }
Modified: trunk/Source/WebCore/page/ChromeClient.h (256833 => 256834)
--- trunk/Source/WebCore/page/ChromeClient.h 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebCore/page/ChromeClient.h 2020-02-18 17:24:30 UTC (rev 256834)
@@ -37,12 +37,12 @@
#include "HostWindow.h"
#include "Icon.h"
#include "InputMode.h"
-#include "LayerFlushThrottleState.h"
#include "MediaProducer.h"
#include "PopupMenu.h"
#include "PopupMenuClient.h"
#include "RegistrableDomain.h"
#include "RenderEmbeddedObject.h"
+#include "RenderingUpdateThrottleState.h"
#include "ScrollTypes.h"
#include "ScrollingCoordinator.h"
#include "SearchPopupMenu.h"
@@ -313,7 +313,7 @@
virtual void setNeedsOneShotDrawingSynchronization() = 0;
// Sets a flag to specify that the view needs to be updated, so we need
// to do an eager layout before the drawing.
- virtual void scheduleCompositingLayerFlush() = 0;
+ virtual void scheduleRenderingUpdate() = 0;
virtual bool needsImmediateRenderingUpdate() const { return false; }
// Returns whether or not the client can render the composited layer,
// regardless of the settings.
@@ -337,9 +337,9 @@
// Returns true if layer tree updates are disabled.
virtual bool layerTreeStateIsFrozen() const { return false; }
- virtual bool layerFlushThrottlingIsActive() const { return false; }
+ virtual bool renderingUpdateThrottlingIsActive() const { return false; }
- virtual bool adjustLayerFlushThrottling(LayerFlushThrottleState::Flags) { return false; }
+ virtual bool adjustRenderingUpdateThrottling(OptionSet<RenderingUpdateThrottleState>) { return false; }
virtual RefPtr<ScrollingCoordinator> createScrollingCoordinator(Page&) const { return nullptr; }
Modified: trunk/Source/WebCore/page/FrameView.cpp (256833 => 256834)
--- trunk/Source/WebCore/page/FrameView.cpp 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebCore/page/FrameView.cpp 2020-02-18 17:24:30 UTC (rev 256834)
@@ -2817,19 +2817,19 @@
#endif
}
-static LayerFlushThrottleState::Flags determineLayerFlushThrottleState(Page& page)
+static OptionSet<RenderingUpdateThrottleState> determineLayerFlushThrottleState(Page& page)
{
// We only throttle when constantly receiving new data during the inital page load.
if (!page.progress().isMainLoadProgressing())
- return 0;
+ return { };
// Scrolling during page loading disables throttling.
if (page.mainFrame().view()->wasScrolledByUser())
- return 0;
+ return { };
// Disable for image documents so large GIF animations don't get throttled during loading.
auto* document = page.mainFrame().document();
if (!document || is<ImageDocument>(*document))
- return 0;
- return LayerFlushThrottleState::Enabled;
+ return { };
+ return { RenderingUpdateThrottleState::Enabled };
}
void FrameView::disableLayerFlushThrottlingTemporarilyForInteraction()
@@ -2838,8 +2838,9 @@
return;
auto& page = *frame().page();
- LayerFlushThrottleState::Flags flags = LayerFlushThrottleState::UserIsInteracting | determineLayerFlushThrottleState(page);
- if (page.chrome().client().adjustLayerFlushThrottling(flags))
+ auto flags = determineLayerFlushThrottleState(page);
+ flags.add(RenderingUpdateThrottleState::UserIsInteracting);
+ if (page.chrome().client().adjustRenderingUpdateThrottling(flags))
return;
if (RenderView* view = renderView())
@@ -2862,15 +2863,15 @@
ASSERT(frame().isMainFrame());
- LayerFlushThrottleState::Flags flags = determineLayerFlushThrottleState(*page);
+ auto flags = determineLayerFlushThrottleState(*page);
// See if the client is handling throttling.
- if (page->chrome().client().adjustLayerFlushThrottling(flags))
+ if (page->chrome().client().adjustRenderingUpdateThrottling(flags))
return;
for (auto* frame = m_frame.ptr(); frame; frame = frame->tree().traverseNext(m_frame.ptr())) {
if (RenderView* renderView = frame->contentRenderer())
- renderView->compositor().setLayerFlushThrottlingEnabled(flags & LayerFlushThrottleState::Enabled);
+ renderView->compositor().setLayerFlushThrottlingEnabled(flags.contains(RenderingUpdateThrottleState::Enabled));
}
}
Deleted: trunk/Source/WebCore/page/LayerFlushThrottleState.h (256833 => 256834)
--- trunk/Source/WebCore/page/LayerFlushThrottleState.h 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebCore/page/LayerFlushThrottleState.h 2020-02-18 17:24:30 UTC (rev 256834)
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2014 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
-
-namespace WebCore {
-
-struct LayerFlushThrottleState {
- enum {
- Enabled = 1 << 0,
- UserIsInteracting = 1 << 1
- };
- typedef unsigned Flags;
-};
-
-} // namespace WebCore
Modified: trunk/Source/WebCore/page/RenderingUpdateScheduler.cpp (256833 => 256834)
--- trunk/Source/WebCore/page/RenderingUpdateScheduler.cpp 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebCore/page/RenderingUpdateScheduler.cpp 2020-02-18 17:24:30 UTC (rev 256834)
@@ -107,7 +107,7 @@
void RenderingUpdateScheduler::scheduleImmediateRenderingUpdate()
{
- m_page.chrome().client().scheduleCompositingLayerFlush();
+ m_page.chrome().client().scheduleRenderingUpdate();
}
void RenderingUpdateScheduler::scheduleRenderingUpdate()
Copied: trunk/Source/WebCore/page/RenderingUpdateThrottleState.h (from rev 256833, trunk/Source/WebCore/page/LayerFlushThrottleState.h) (0 => 256834)
--- trunk/Source/WebCore/page/RenderingUpdateThrottleState.h (rev 0)
+++ trunk/Source/WebCore/page/RenderingUpdateThrottleState.h 2020-02-18 17:24:30 UTC (rev 256834)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2014-2020 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
+
+namespace WebCore {
+
+enum class RenderingUpdateThrottleState {
+ Enabled = 1 << 0,
+ UserIsInteracting = 1 << 1
+};
+
+} // namespace WebCore
Modified: trunk/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp (256833 => 256834)
--- trunk/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp 2020-02-18 17:24:30 UTC (rev 256834)
@@ -124,7 +124,7 @@
void notifyFlushRequired(const GraphicsLayer*) override
{
- m_overlay.overlay().page()->chrome().client().scheduleCompositingLayerFlush();
+ m_overlay.overlay().page()->chrome().client().scheduleRenderingUpdate();
}
ResourceUsageOverlay& m_overlay;
Modified: trunk/Source/WebKit/ChangeLog (256833 => 256834)
--- trunk/Source/WebKit/ChangeLog 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebKit/ChangeLog 2020-02-18 17:24:30 UTC (rev 256834)
@@ -1,3 +1,94 @@
+2020-02-18 Simon Fraser <simon.fra...@apple.com>
+
+ Move from "layer flush" terminology to "rendering update"
+ https://bugs.webkit.org/show_bug.cgi?id=207870
+
+ Reviewed by Tim Horton.
+
+ Rename various functions and member variables to move away from the legacy "layer flush"
+ terminology and instead use "rendering update", matching Page::updateRendering(). The fact
+ that we have layers is an implementation detail.
+
+ Change LayerFlushThrottlingState to be an OptionSet<>.
+
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::scheduleRenderingUpdate):
+ (WebKit::WebChromeClient::adjustRenderUpdateThrottling):
+ (WebKit::WebChromeClient::renderingUpdateThrottlingIsActive const):
+ (WebKit::WebChromeClient::scheduleCompositingLayerFlush): Deleted.
+ (WebKit::WebChromeClient::adjustLayerFlushThrottling): Deleted.
+ (WebKit::WebChromeClient::layerFlushThrottlingIsActive const): Deleted.
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
+ * WebProcess/WebPage/DrawingArea.h:
+ (WebKit::DrawingArea::renderingUpdateThrottlingIsActive const):
+ (WebKit::DrawingArea::adjustRenderUpdateThrottling):
+ (WebKit::DrawingArea::layerFlushThrottlingIsActive const): Deleted.
+ (WebKit::DrawingArea::adjustLayerFlushThrottling): Deleted.
+ * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
+ (WebKit::RemoteLayerTreeContext::setNextFlushIsForImmediatePaint):
+ (WebKit::RemoteLayerTreeContext::nextFlushIsForImmediatePaint const):
+ * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
+ (WebKit::RemoteLayerTreeDisplayRefreshMonitor::requestRefreshCallback):
+ * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
+ * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
+ (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
+ (WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
+ (WebKit::RemoteLayerTreeDrawingArea::updateGeometry):
+ (WebKit::RemoteLayerTreeDrawingArea::setLayerTreeStateIsFrozen):
+ (WebKit::RemoteLayerTreeDrawingArea::forceRepaint):
+ (WebKit::RemoteLayerTreeDrawingArea::setExposedContentRect):
+ (WebKit::RemoteLayerTreeDrawingArea::scheduleImmediateRenderingUpdate):
+ (WebKit::RemoteLayerTreeDrawingArea::scheduleInitialDeferredPaint):
+ (WebKit::RemoteLayerTreeDrawingArea::scheduleRenderingUpdate):
+ (WebKit::RemoteLayerTreeDrawingArea::adjustRenderUpdateThrottling):
+ (WebKit::RemoteLayerTreeDrawingArea::updateRendering):
+ (WebKit::RemoteLayerTreeDrawingArea::didUpdate):
+ (WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange):
+ (WebKit::RemoteLayerTreeDrawingArea::addTransactionCallbackID):
+ (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately): Deleted.
+ (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush): Deleted.
+ (WebKit::RemoteLayerTreeDrawingArea::adjustLayerFlushThrottling): Deleted.
+ (WebKit::RemoteLayerTreeDrawingArea::flushLayers): Deleted.
+ * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
+ (WebKit::RemoteScrollingCoordinator::scheduleTreeStateCommit):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::scheduleFullEditorStateUpdate):
+ * WebProcess/WebPage/ios/WebPageIOS.mm:
+ (WebKit::WebPage::dynamicViewportSizeUpdate):
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+ (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
+ (WebKit::TiledCoreAnimationDrawingArea::~TiledCoreAnimationDrawingArea):
+ (WebKit::TiledCoreAnimationDrawingArea::forceRepaint):
+ (WebKit::TiledCoreAnimationDrawingArea::setLayerTreeStateIsFrozen):
+ (WebKit::TiledCoreAnimationDrawingArea::scheduleRenderingUpdate):
+ (WebKit::TiledCoreAnimationDrawingArea::scheduleImmediateRenderingUpdate):
+ (WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
+ (WebKit::TiledCoreAnimationDrawingArea::setShouldScaleViewToFitDocument):
+ (WebKit::TiledCoreAnimationDrawingArea::dispatchAfterEnsuringUpdatedScrollPosition):
+ (WebKit::TiledCoreAnimationDrawingArea::addTransactionCallbackID):
+ (WebKit::TiledCoreAnimationDrawingArea::updateRendering):
+ (WebKit::TiledCoreAnimationDrawingArea::suspendPainting):
+ (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
+ (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
+ (WebKit::TiledCoreAnimationDrawingArea::updateRenderingRunLoopCallback):
+ (WebKit::TiledCoreAnimationDrawingArea::invalidateRenderingUpdateRunLoopObserver):
+ (WebKit::TiledCoreAnimationDrawingArea::scheduleRenderingUpdateRunLoopObserver):
+ (WebKit::TiledCoreAnimationDrawingArea::adjustRenderUpdateThrottling):
+ (WebKit::TiledCoreAnimationDrawingArea::renderingUpdateThrottlingIsActive const):
+ (WebKit::TiledCoreAnimationDrawingArea::startRenderThrottlingTimer):
+ (WebKit::TiledCoreAnimationDrawingArea::renderThrottlingTimerFired):
+ (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlush): Deleted.
+ (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlushImmediately): Deleted.
+ (WebKit::TiledCoreAnimationDrawingArea::flushLayers): Deleted.
+ (WebKit::TiledCoreAnimationDrawingArea::layerFlushRunLoopCallback): Deleted.
+ (WebKit::TiledCoreAnimationDrawingArea::invalidateLayerFlushRunLoopObserver): Deleted.
+ (WebKit::TiledCoreAnimationDrawingArea::scheduleLayerFlushRunLoopObserver): Deleted.
+ (WebKit::TiledCoreAnimationDrawingArea::adjustLayerFlushThrottling): Deleted.
+ (WebKit::TiledCoreAnimationDrawingArea::layerFlushThrottlingIsActive const): Deleted.
+ (WebKit::TiledCoreAnimationDrawingArea::startLayerFlushThrottlingTimer): Deleted.
+ (WebKit::TiledCoreAnimationDrawingArea::layerFlushThrottlingTimerFired): Deleted.
+
2020-02-18 Daniel Bates <daba...@apple.com>
Rename dispatchDidReceiveEditorStateAfterFocus() to dispatchDidUpdateEditorState() to better describe its purpose
Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm (256833 => 256834)
--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm 2020-02-18 17:24:30 UTC (rev 256834)
@@ -343,7 +343,8 @@
context.scale(m_scale);
- auto flags = m_layer->context() && m_layer->context()->nextFlushIsForImmediatePaint() ? WebCore::GraphicsLayerPaintSnapshotting : WebCore::GraphicsLayerPaintNormal;
+ // FIXME: Clarify that WebCore::GraphicsLayerPaintSnapshotting is just about image decoding.
+ auto flags = m_layer->context() && m_layer->context()->nextRenderingUpdateRequiresSynchronousImageDecoding() ? WebCore::GraphicsLayerPaintSnapshotting : WebCore::GraphicsLayerPaintNormal;
// FIXME: This should be moved to PlatformCALayerRemote for better layering.
switch (m_layer->layerType()) {
Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp (256833 => 256834)
--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp 2020-02-18 17:24:30 UTC (rev 256834)
@@ -910,10 +910,10 @@
notImplemented();
}
-void WebChromeClient::scheduleCompositingLayerFlush()
+void WebChromeClient::scheduleRenderingUpdate()
{
if (m_page.drawingArea())
- m_page.drawingArea()->scheduleCompositingLayerFlush();
+ m_page.drawingArea()->scheduleRenderingUpdate();
}
void WebChromeClient::contentRuleListNotification(const URL& url, const ContentRuleListResults& results)
@@ -924,9 +924,9 @@
#endif
}
-bool WebChromeClient::adjustLayerFlushThrottling(LayerFlushThrottleState::Flags flags)
+bool WebChromeClient::adjustRenderingUpdateThrottling(OptionSet<RenderingUpdateThrottleState> flags)
{
- return m_page.drawingArea() && m_page.drawingArea()->adjustLayerFlushThrottling(flags);
+ return m_page.drawingArea() && m_page.drawingArea()->adjustRenderingUpdateThrottling(flags);
}
bool WebChromeClient::layerTreeStateIsFrozen() const
@@ -937,10 +937,10 @@
return false;
}
-bool WebChromeClient::layerFlushThrottlingIsActive() const
+bool WebChromeClient::renderingUpdateThrottlingIsActive() const
{
if (m_page.drawingArea())
- return m_page.drawingArea()->layerFlushThrottlingIsActive();
+ return m_page.drawingArea()->renderingUpdateThrottlingIsActive();
return false;
}
Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h (256833 => 256834)
--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h 2020-02-18 17:24:30 UTC (rev 256834)
@@ -216,8 +216,8 @@
void attachRootGraphicsLayer(WebCore::Frame&, WebCore::GraphicsLayer*) final;
void attachViewOverlayGraphicsLayer(WebCore::GraphicsLayer*) final;
void setNeedsOneShotDrawingSynchronization() final;
- void scheduleCompositingLayerFlush() final;
- bool adjustLayerFlushThrottling(WebCore::LayerFlushThrottleState::Flags) final;
+ void scheduleRenderingUpdate() final;
+ bool adjustRenderingUpdateThrottling(OptionSet<WebCore::RenderingUpdateThrottleState>) final;
void contentRuleListNotification(const URL&, const WebCore::ContentRuleListResults&) final;
@@ -250,7 +250,7 @@
}
bool layerTreeStateIsFrozen() const final;
- bool layerFlushThrottlingIsActive() const final;
+ bool renderingUpdateThrottlingIsActive() const final;
#if ENABLE(ASYNC_SCROLLING)
RefPtr<WebCore::ScrollingCoordinator> createScrollingCoordinator(WebCore::Page&) const final;
Modified: trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp (256833 => 256834)
--- trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp 2020-02-18 17:24:30 UTC (rev 256834)
@@ -204,8 +204,10 @@
// Call setShouldNotifyAfterNextScheduledLayerFlush(false) here to
// prevent layerHostDidFlushLayers() from being called a second time.
m_layerTreeHost->setShouldNotifyAfterNextScheduledLayerFlush(false);
+#if USE(COORDINATED_GRAPHICS)
layerHostDidFlushLayers();
- }
+#endif
+ }
}
bool DrawingAreaCoordinatedGraphics::forceRepaintAsync(CallbackID callbackID)
@@ -338,7 +340,7 @@
enterAcceleratedCompositingMode(graphicsLayer);
}
-void DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush()
+void DrawingAreaCoordinatedGraphics::scheduleRenderingUpdate()
{
if (m_layerTreeHost)
m_layerTreeHost->scheduleLayerFlush();
@@ -346,6 +348,7 @@
setNeedsDisplay();
}
+#if USE(COORDINATED_GRAPHICS)
void DrawingAreaCoordinatedGraphics::layerHostDidFlushLayers()
{
ASSERT(m_layerTreeHost);
@@ -362,6 +365,7 @@
m_compositingAccordingToProxyMessages = true;
}
}
+#endif
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
RefPtr<DisplayRefreshMonitor> DrawingAreaCoordinatedGraphics::createDisplayRefreshMonitor(PlatformDisplayID displayID)
Modified: trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h (256833 => 256834)
--- trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h 2020-02-18 17:24:30 UTC (rev 256834)
@@ -70,10 +70,13 @@
WebCore::GraphicsLayerFactory* graphicsLayerFactory() override;
void setRootCompositingLayer(WebCore::GraphicsLayer*) override;
void scheduleInitialDeferredPaint() override { };
- void scheduleCompositingLayerFlush() override;
- void scheduleCompositingLayerFlushImmediately() override { scheduleCompositingLayerFlush(); };
+ void scheduleRenderingUpdate() override;
+ void scheduleImmediateRenderingUpdate() override { scheduleRenderingUpdate(); };
+
+#if USE(COORDINATED_GRAPHICS)
void layerHostDidFlushLayers() override;
-
+#endif
+
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(WebCore::PlatformDisplayID) override;
#endif
Modified: trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h (256833 => 256834)
--- trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h 2020-02-18 17:24:30 UTC (rev 256834)
@@ -33,9 +33,9 @@
#include <WebCore/ActivityState.h>
#include <WebCore/FloatRect.h>
#include <WebCore/IntRect.h>
-#include <WebCore/LayerFlushThrottleState.h>
#include <WebCore/LayoutMilestone.h>
#include <WebCore/PlatformScreen.h>
+#include <WebCore/RenderingUpdateThrottleState.h>
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
#include <wtf/TypeCasts.h>
@@ -85,7 +85,7 @@
virtual bool forceRepaintAsync(CallbackID) { return false; }
virtual void setLayerTreeStateIsFrozen(bool) { }
virtual bool layerTreeStateIsFrozen() const { return false; }
- virtual bool layerFlushThrottlingIsActive() const { return false; }
+ virtual bool renderingUpdateThrottlingIsActive() const { return false; }
virtual void updatePreferences(const WebPreferencesStore&) { }
virtual void enablePainting() { }
@@ -113,9 +113,9 @@
virtual WebCore::GraphicsLayerFactory* graphicsLayerFactory() { return nullptr; }
virtual void setRootCompositingLayer(WebCore::GraphicsLayer*) = 0;
- virtual void scheduleCompositingLayerFlush() = 0;
+ virtual void scheduleRenderingUpdate() = 0;
virtual void scheduleInitialDeferredPaint() = 0;
- virtual void scheduleCompositingLayerFlushImmediately() = 0;
+ virtual void scheduleImmediateRenderingUpdate() = 0;
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
virtual RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(WebCore::PlatformDisplayID);
@@ -128,7 +128,7 @@
virtual bool markLayersVolatileImmediatelyIfPossible() { return true; }
- virtual bool adjustLayerFlushThrottling(WebCore::LayerFlushThrottleState::Flags) { return false; }
+ virtual bool adjustRenderingUpdateThrottling(OptionSet<WebCore::RenderingUpdateThrottleState>) { return false; }
virtual void attachViewOverlayGraphicsLayer(WebCore::GraphicsLayer*) { }
@@ -141,7 +141,9 @@
virtual void updateGeometry(const WebCore::IntSize& viewSize, bool flushSynchronously, const WTF::MachSendRight& fencePort) { }
#endif
+#if USE(COORDINATED_GRAPHICS)
virtual void layerHostDidFlushLayers() { }
+#endif
#if USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER)
virtual void didChangeViewportAttributes(WebCore::ViewportAttributes&&) = 0;
Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h (256833 => 256834)
--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h 2020-02-18 17:24:30 UTC (rev 256834)
@@ -73,8 +73,8 @@
RemoteLayerBackingStoreCollection& backingStoreCollection() { return m_backingStoreCollection; }
- void setNextFlushIsForImmediatePaint(bool nextFlushIsForImmediatePaint) { m_nextFlushIsForImmediatePaint = nextFlushIsForImmediatePaint; }
- bool nextFlushIsForImmediatePaint() const { return m_nextFlushIsForImmediatePaint; }
+ void setNextRenderingUpdateRequiresSynchronousImageDecoding(bool requireSynchronousDecoding) { m_nextRenderingUpdateRequiresSynchronousImageDecoding = requireSynchronousDecoding; }
+ bool nextRenderingUpdateRequiresSynchronousImageDecoding() const { return m_nextRenderingUpdateRequiresSynchronousImageDecoding; }
void adoptLayersFromContext(RemoteLayerTreeContext&);
@@ -102,7 +102,7 @@
WebCore::LayerPool m_layerPool;
- bool m_nextFlushIsForImmediatePaint { false };
+ bool m_nextRenderingUpdateRequiresSynchronousImageDecoding { false };
};
} // namespace WebKit
Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm (256833 => 256834)
--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm 2020-02-18 17:24:30 UTC (rev 256834)
@@ -49,7 +49,7 @@
return false;
if (!isScheduled())
- static_cast<DrawingArea&>(*m_drawingArea.get()).scheduleCompositingLayerFlush();
+ static_cast<DrawingArea&>(*m_drawingArea.get()).scheduleRenderingUpdate();
setIsActive(true);
setIsScheduled(true);
Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h (256833 => 256834)
--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h 2020-02-18 17:24:30 UTC (rev 256834)
@@ -65,8 +65,8 @@
WebCore::GraphicsLayerFactory* graphicsLayerFactory() override;
void setRootCompositingLayer(WebCore::GraphicsLayer*) override;
void scheduleInitialDeferredPaint() override;
- void scheduleCompositingLayerFlush() override;
- void scheduleCompositingLayerFlushImmediately() override;
+ void scheduleRenderingUpdate() override;
+ void scheduleImmediateRenderingUpdate() override;
void attachViewOverlayGraphicsLayer(WebCore::GraphicsLayer*) override;
void addTransactionCallbackID(CallbackID) override;
@@ -83,8 +83,8 @@
bool usesDelegatedPageScaling() const override { return true; }
void setLayerTreeStateIsFrozen(bool) override;
- bool layerTreeStateIsFrozen() const override { return m_isFlushingSuspended; }
- bool layerFlushThrottlingIsActive() const override { return m_isThrottlingLayerFlushes && m_layerFlushTimer.isActive(); }
+ bool layerTreeStateIsFrozen() const override { return m_isRenderingSuspended; }
+ bool renderingUpdateThrottlingIsActive() const override { return m_isThrottlingRenderingUpdates && m_updateRenderingTimer.isActive(); }
void forceRepaint() override;
bool forceRepaintAsync(CallbackID) override { return false; }
@@ -108,7 +108,7 @@
void activityStateDidChange(OptionSet<WebCore::ActivityState::Flag> changed, ActivityStateChangeID, const Vector<CallbackID>& callbackIDs) override;
- bool adjustLayerFlushThrottling(WebCore::LayerFlushThrottleState::Flags) override;
+ bool adjustRenderingUpdateThrottling(OptionSet<WebCore::RenderingUpdateThrottleState>) override;
bool addMilestonesToDispatch(OptionSet<WebCore::LayoutMilestone>) override;
@@ -116,7 +116,7 @@
void updateRootLayers();
void addCommitHandlers();
- void flushLayers();
+ void updateRendering();
WebCore::TiledBacking* mainFrameTiledBacking() const;
@@ -151,18 +151,19 @@
Optional<WebCore::FloatRect> m_viewExposedRect;
Optional<WebCore::FloatRect> m_scrolledViewExposedRect;
- WebCore::Timer m_layerFlushTimer;
- bool m_isFlushingSuspended { false };
- bool m_hasDeferredFlush { false };
- bool m_flushingInitialDeferredPaint { false };
- bool m_isThrottlingLayerFlushes { false };
- bool m_isLayerFlushThrottlingTemporarilyDisabledForInteraction { false };
- bool m_isInitialThrottledLayerFlush { false };
+ WebCore::Timer m_updateRenderingTimer;
+ bool m_isRenderingSuspended { false };
+ bool m_hasDeferredRenderingUpdate { false };
+ bool m_inInitialDeferredRenderingUpdate { false };
+ bool m_isFirstThrottledRenderingUpdate { false };
+ bool m_nextRenderingUpdateRequiresSynchronousImageDecoding { false };
+ bool m_inUpdateRendering { false };
+ bool m_isThrottlingRenderingUpdates { false };
+ bool m_isRenderingUpdateThrottlingTemporarilyDisabledForInteraction { false };
+
bool m_waitingForBackingStoreSwap { false };
- bool m_hadFlushDeferredWhileWaitingForBackingStoreSwap { false };
- bool m_nextFlushIsForImmediatePaint { false };
- bool m_inFlushLayers { false };
+ bool m_deferredRenderingUpdateWhileWaitingForBackingStoreSwap { false };
dispatch_queue_t m_commitQueue;
RefPtr<BackingStoreFlusher> m_pendingBackingStoreFlusher;
Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm (256833 => 256834)
--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm 2020-02-18 17:24:30 UTC (rev 256834)
@@ -60,7 +60,7 @@
: DrawingArea(DrawingAreaTypeRemoteLayerTree, parameters.drawingAreaIdentifier, webPage)
, m_remoteLayerTreeContext(makeUnique<RemoteLayerTreeContext>(webPage))
, m_rootLayer(GraphicsLayer::create(graphicsLayerFactory(), *this))
- , m_layerFlushTimer(*this, &RemoteLayerTreeDrawingArea::flushLayers)
+ , m_updateRenderingTimer(*this, &RemoteLayerTreeDrawingArea::updateRendering)
{
webPage.corePage()->settings().setForceCompositingMode(true);
m_rootLayer->setName("drawing area root");
@@ -145,7 +145,7 @@
{
m_contentLayer = rootLayer;
updateRootLayers();
- scheduleCompositingLayerFlush();
+ scheduleRenderingUpdate();
}
void RemoteLayerTreeDrawingArea::updateGeometry(const IntSize& viewSize, bool flushSynchronously, const WTF::MachSendRight&)
@@ -153,7 +153,7 @@
m_viewSize = viewSize;
m_webPage.setSize(viewSize);
- scheduleCompositingLayerFlush();
+ scheduleRenderingUpdate();
send(Messages::DrawingAreaProxy::DidUpdateGeometry());
}
@@ -185,15 +185,15 @@
void RemoteLayerTreeDrawingArea::setLayerTreeStateIsFrozen(bool isFrozen)
{
- if (m_isFlushingSuspended == isFrozen)
+ if (m_isRenderingSuspended == isFrozen)
return;
tracePoint(isFrozen ? LayerTreeFreezeStart : LayerTreeFreezeEnd);
- m_isFlushingSuspended = isFrozen;
+ m_isRenderingSuspended = isFrozen;
- if (!m_isFlushingSuspended && m_hasDeferredFlush) {
- m_hasDeferredFlush = false;
+ if (!m_isRenderingSuspended && m_hasDeferredRenderingUpdate) {
+ m_hasDeferredRenderingUpdate = false;
scheduleInitialDeferredPaint();
}
}
@@ -200,7 +200,7 @@
void RemoteLayerTreeDrawingArea::forceRepaint()
{
- if (m_isFlushingSuspended)
+ if (m_isRenderingSuspended)
return;
for (Frame* frame = &m_webPage.corePage()->mainFrame(); frame; frame = frame->tree().traverseNext()) {
@@ -211,7 +211,7 @@
frameView->tiledBacking()->forceRepaint();
}
- flushLayers();
+ updateRendering();
}
void RemoteLayerTreeDrawingArea::acceleratedAnimationDidStart(uint64_t layerID, const String& key, MonotonicTime startTime)
@@ -248,7 +248,7 @@
return;
frameView->setExposedContentRect(exposedContentRect);
- scheduleCompositingLayerFlush();
+ scheduleRenderingUpdate();
}
void RemoteLayerTreeDrawingArea::updateScrolledExposedRect()
@@ -273,60 +273,60 @@
return frameView ? frameView->tiledBacking() : nullptr;
}
-void RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately()
+void RemoteLayerTreeDrawingArea::scheduleImmediateRenderingUpdate()
{
- m_layerFlushTimer.startOneShot(0_s);
+ m_updateRenderingTimer.startOneShot(0_s);
}
void RemoteLayerTreeDrawingArea::scheduleInitialDeferredPaint()
{
- ASSERT(!m_isFlushingSuspended);
- m_flushingInitialDeferredPaint = true;
+ ASSERT(!m_isRenderingSuspended);
+ m_inInitialDeferredRenderingUpdate = true;
- if (m_layerFlushTimer.isActive())
+ if (m_updateRenderingTimer.isActive())
return;
- scheduleCompositingLayerFlushImmediately();
+ scheduleImmediateRenderingUpdate();
}
-void RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush()
+void RemoteLayerTreeDrawingArea::scheduleRenderingUpdate()
{
- if (m_isFlushingSuspended) {
- m_isLayerFlushThrottlingTemporarilyDisabledForInteraction = false;
- m_hasDeferredFlush = true;
+ if (m_isRenderingSuspended) {
+ m_isRenderingUpdateThrottlingTemporarilyDisabledForInteraction = false;
+ m_hasDeferredRenderingUpdate = true;
return;
}
- if (m_isLayerFlushThrottlingTemporarilyDisabledForInteraction) {
- m_isLayerFlushThrottlingTemporarilyDisabledForInteraction = false;
- scheduleCompositingLayerFlushImmediately();
+ if (m_isRenderingUpdateThrottlingTemporarilyDisabledForInteraction) {
+ m_isRenderingUpdateThrottlingTemporarilyDisabledForInteraction = false;
+ scheduleImmediateRenderingUpdate();
return;
}
- if (m_layerFlushTimer.isActive())
+ if (m_updateRenderingTimer.isActive())
return;
const Seconds initialFlushDelay = 500_ms;
const Seconds flushDelay = 1500_ms;
- Seconds throttleDelay = m_isThrottlingLayerFlushes ? (m_isInitialThrottledLayerFlush ? initialFlushDelay : flushDelay) : 0_s;
- m_isInitialThrottledLayerFlush = false;
+ Seconds throttleDelay = m_isThrottlingRenderingUpdates ? (m_isFirstThrottledRenderingUpdate ? initialFlushDelay : flushDelay) : 0_s;
+ m_isFirstThrottledRenderingUpdate = false;
- m_layerFlushTimer.startOneShot(throttleDelay);
+ m_updateRenderingTimer.startOneShot(throttleDelay);
}
-bool RemoteLayerTreeDrawingArea::adjustLayerFlushThrottling(WebCore::LayerFlushThrottleState::Flags flags)
+bool RemoteLayerTreeDrawingArea::adjustRenderingUpdateThrottling(OptionSet<RenderingUpdateThrottleState> flags)
{
- if (flags & WebCore::LayerFlushThrottleState::UserIsInteracting)
- m_isLayerFlushThrottlingTemporarilyDisabledForInteraction = true;
+ if (flags.contains(RenderingUpdateThrottleState::UserIsInteracting))
+ m_isRenderingUpdateThrottlingTemporarilyDisabledForInteraction = true;
- bool wasThrottlingLayerFlushes = m_isThrottlingLayerFlushes;
- m_isThrottlingLayerFlushes = flags & WebCore::LayerFlushThrottleState::Enabled;
+ bool wasThrottlingLayerFlushes = m_isThrottlingRenderingUpdates;
+ m_isThrottlingRenderingUpdates = flags.contains(RenderingUpdateThrottleState::Enabled);
- if (!wasThrottlingLayerFlushes && m_isThrottlingLayerFlushes)
- m_isInitialThrottledLayerFlush = true;
+ if (!wasThrottlingLayerFlushes && m_isThrottlingRenderingUpdates)
+ m_isFirstThrottledRenderingUpdate = true;
// Re-schedule the flush if we stopped throttling.
- if (wasThrottlingLayerFlushes && !m_isThrottlingLayerFlushes && m_layerFlushTimer.isActive()) {
- m_layerFlushTimer.stop();
- scheduleCompositingLayerFlush();
+ if (wasThrottlingLayerFlushes && !m_isThrottlingRenderingUpdates && m_updateRenderingTimer.isActive()) {
+ m_updateRenderingTimer.stop();
+ scheduleRenderingUpdate();
}
return true;
}
@@ -354,30 +354,30 @@
m_webPage.setFirstFlushAfterCommit(true);
}
-void RemoteLayerTreeDrawingArea::flushLayers()
+void RemoteLayerTreeDrawingArea::updateRendering()
{
- if (m_isFlushingSuspended) {
- m_hasDeferredFlush = true;
+ if (m_isRenderingSuspended) {
+ m_hasDeferredRenderingUpdate = true;
return;
}
if (m_waitingForBackingStoreSwap) {
- m_hadFlushDeferredWhileWaitingForBackingStoreSwap = true;
+ m_deferredRenderingUpdateWhileWaitingForBackingStoreSwap = true;
return;
}
- if (m_flushingInitialDeferredPaint) {
- m_flushingInitialDeferredPaint = false;
+ if (m_inInitialDeferredRenderingUpdate) {
+ m_inInitialDeferredRenderingUpdate = false;
// Reschedule the flush timer for the second paint if painting is being throttled.
- if (m_isThrottlingLayerFlushes)
- scheduleCompositingLayerFlush();
+ if (m_isThrottlingRenderingUpdates)
+ scheduleRenderingUpdate();
}
// This function is not reentrant, e.g. a rAF callback may force repaint.
- if (m_inFlushLayers)
+ if (m_inUpdateRendering)
return;
- SetForScope<bool> change(m_inFlushLayers, true);
+ SetForScope<bool> change(m_inUpdateRendering, true);
m_webPage.updateRendering();
FloatRect visibleRect(FloatPoint(), m_viewSize);
@@ -386,7 +386,7 @@
addCommitHandlers();
- if (m_nextFlushIsForImmediatePaint)
+ if (m_nextRenderingUpdateRequiresSynchronousImageDecoding)
m_webPage.mainFrameView()->invalidateImagesWithAsyncDecodes();
m_webPage.mainFrameView()->flushCompositingStateIncludingSubframes();
@@ -406,9 +406,11 @@
RemoteLayerTreeTransaction layerTransaction;
layerTransaction.setTransactionID(takeNextTransactionID());
layerTransaction.setCallbackIDs(WTFMove(m_pendingCallbackIDs));
- m_remoteLayerTreeContext->setNextFlushIsForImmediatePaint(m_nextFlushIsForImmediatePaint);
+
+ m_remoteLayerTreeContext->setNextRenderingUpdateRequiresSynchronousImageDecoding(m_nextRenderingUpdateRequiresSynchronousImageDecoding);
m_remoteLayerTreeContext->buildTransaction(layerTransaction, *downcast<GraphicsLayerCARemote>(m_rootLayer.get()).platformCALayer());
- m_remoteLayerTreeContext->setNextFlushIsForImmediatePaint(false);
+ m_remoteLayerTreeContext->setNextRenderingUpdateRequiresSynchronousImageDecoding(false);
+
backingStoreCollection.willCommitLayerTree(layerTransaction);
m_webPage.willCommitLayerTree(layerTransaction);
@@ -424,7 +426,7 @@
downcast<RemoteScrollingCoordinator>(*m_webPage.scrollingCoordinator()).buildTransaction(scrollingTransaction);
#endif
- m_nextFlushIsForImmediatePaint = false;
+ m_nextRenderingUpdateRequiresSynchronousImageDecoding = false;
m_waitingForBackingStoreSwap = true;
send(Messages::RemoteLayerTreeDrawingAreaProxy::WillCommitLayerTree(layerTransaction.transactionID()));
@@ -475,9 +477,9 @@
m_waitingForBackingStoreSwap = false;
- if (m_hadFlushDeferredWhileWaitingForBackingStoreSwap) {
- scheduleCompositingLayerFlush();
- m_hadFlushDeferredWhileWaitingForBackingStoreSwap = false;
+ if (m_deferredRenderingUpdateWhileWaitingForBackingStoreSwap) {
+ scheduleRenderingUpdate();
+ m_deferredRenderingUpdateWhileWaitingForBackingStoreSwap = false;
}
// This empty transaction serves to trigger CA's garbage collection of IOSurfaces. See <rdar://problem/16110687>
@@ -533,9 +535,9 @@
// FIXME: Should we suspend painting while not visible, like TiledCoreAnimationDrawingArea? Probably.
if (activityStateChangeID != ActivityStateChangeAsynchronous) {
- m_nextFlushIsForImmediatePaint = true;
+ m_nextRenderingUpdateRequiresSynchronousImageDecoding = true;
m_activityStateChangeID = activityStateChangeID;
- scheduleCompositingLayerFlushImmediately();
+ scheduleImmediateRenderingUpdate();
}
// FIXME: We may want to match behavior in TiledCoreAnimationDrawingArea by firing these callbacks after the next compositing flush, rather than immediately after
@@ -548,10 +550,10 @@
{
// Assume that if someone is listening for this transaction's completion, that they want it to
// be a "complete" paint (including images that would normally be asynchronously decoding).
- m_nextFlushIsForImmediatePaint = true;
+ m_nextRenderingUpdateRequiresSynchronousImageDecoding = true;
m_pendingCallbackIDs.append(static_cast<RemoteLayerTreeTransaction::TransactionCallbackID>(callbackID));
- scheduleCompositingLayerFlush();
+ scheduleRenderingUpdate();
}
void RemoteLayerTreeDrawingArea::adoptLayersFromDrawingArea(DrawingArea& oldDrawingArea)
Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm (256833 => 256834)
--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm 2020-02-18 17:24:30 UTC (rev 256834)
@@ -61,7 +61,7 @@
void RemoteScrollingCoordinator::scheduleTreeStateCommit()
{
- m_webPage->drawingArea()->scheduleCompositingLayerFlush();
+ m_webPage->drawingArea()->scheduleRenderingUpdate();
}
bool RemoteScrollingCoordinator::coordinatesScrollingForFrameView(const FrameView& frameView) const
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (256833 => 256834)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2020-02-18 17:24:30 UTC (rev 256834)
@@ -6218,7 +6218,7 @@
m_hasPendingEditorStateUpdate = true;
// FIXME: Scheduling a compositing layer flush here can be more expensive than necessary.
// Instead, we should just compute and send post-layout editor state during the next frame.
- m_drawingArea->scheduleCompositingLayerFlush();
+ m_drawingArea->scheduleRenderingUpdate();
}
#if HAVE(TOUCH_BAR)
Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (256833 => 256834)
--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm 2020-02-18 17:24:30 UTC (rev 256834)
@@ -3420,7 +3420,7 @@
viewportConfigurationChanged();
#endif
- m_drawingArea->scheduleCompositingLayerFlush();
+ m_drawingArea->scheduleRenderingUpdate();
m_pendingDynamicViewportSizeUpdateID = dynamicViewportSizeUpdateID;
}
Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h (256833 => 256834)
--- trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h 2020-02-18 17:24:30 UTC (rev 256834)
@@ -66,8 +66,8 @@
bool layerTreeStateIsFrozen() const override;
void setRootCompositingLayer(WebCore::GraphicsLayer*) override;
void scheduleInitialDeferredPaint() override;
- void scheduleCompositingLayerFlush() override;
- void scheduleCompositingLayerFlushImmediately() override;
+ void scheduleRenderingUpdate() override;
+ void scheduleImmediateRenderingUpdate() override;
void updatePreferences(const WebPreferencesStore&) override;
void mainFrameContentSizeChanged(const WebCore::IntSize&) override;
@@ -92,8 +92,8 @@
bool addMilestonesToDispatch(OptionSet<WebCore::LayoutMilestone> paintMilestones) override;
void addCommitHandlers();
- enum class FlushType { Normal, TransientZoom };
- void flushLayers(FlushType = FlushType::Normal);
+ enum class UpdateRenderingType { Normal, TransientZoom };
+ void updateRendering(UpdateRenderingType = UpdateRenderingType::Normal);
// Message handlers.
void updateGeometry(const WebCore::IntSize& viewSize, bool flushSynchronously, const WTF::MachSendRight& fencePort) override;
@@ -130,15 +130,15 @@
void sendPendingNewlyReachedPaintingMilestones();
- void layerFlushRunLoopCallback();
- void invalidateLayerFlushRunLoopObserver();
- void scheduleLayerFlushRunLoopObserver();
+ void updateRenderingRunLoopCallback();
+ void invalidateRenderingUpdateRunLoopObserver();
+ void scheduleRenderingUpdateRunLoopObserver();
- bool adjustLayerFlushThrottling(WebCore::LayerFlushThrottleState::Flags) override;
- bool layerFlushThrottlingIsActive() const override;
+ bool adjustRenderingUpdateThrottling(OptionSet<WebCore::RenderingUpdateThrottleState>) override;
+ bool renderingUpdateThrottlingIsActive() const override;
- void startLayerFlushThrottlingTimer();
- void layerFlushThrottlingTimerFired();
+ void startRenderThrottlingTimer();
+ void renderThrottlingTimerFired();
std::unique_ptr<LayerHostingContext> m_layerHostingContext;
@@ -156,7 +156,7 @@
double m_transientZoomScale { 1 };
WebCore::FloatPoint m_transientZoomOrigin;
- WebCore::Timer m_layerFlushThrottlingTimer;
+ WebCore::Timer m_renderThrottlingTimer;
RunLoop::Timer<TiledCoreAnimationDrawingArea> m_sendDidUpdateActivityStateTimer;
Vector<CallbackID> m_nextActivityStateChangeCallbackIDs;
@@ -167,7 +167,7 @@
OptionSet<WebCore::LayoutMilestone> m_pendingNewlyReachedPaintingMilestones;
Vector<CallbackID> m_pendingCallbackIDs;
- std::unique_ptr<WebCore::RunLoopObserver> m_layerFlushRunLoopObserver;
+ std::unique_ptr<WebCore::RunLoopObserver> m_renderUpdateRunLoopObserver;
bool m_isPaintingSuspended { false };
bool m_inUpdateGeometry { false };
@@ -174,8 +174,8 @@
bool m_layerTreeStateIsFrozen { false };
bool m_shouldScaleViewToFitDocument { false };
bool m_isScalingViewToFitDocument { false };
- bool m_isThrottlingLayerFlushes { false };
- bool m_isLayerFlushThrottlingTemporarilyDisabledForInteraction { false };
+ bool m_isThrottlingRenderingUpdates { false };
+ bool m_isRenderingUpdateThrottlingTemporarilyDisabledForInteraction { false };
bool m_needsSendEnterAcceleratedCompositingMode { true };
};
Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (256833 => 256834)
--- trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2020-02-18 17:24:30 UTC (rev 256834)
@@ -72,7 +72,7 @@
TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea(WebPage& webPage, const WebPageCreationParameters& parameters)
: DrawingArea(DrawingAreaTypeTiledCoreAnimation, parameters.drawingAreaIdentifier, webPage)
- , m_layerFlushThrottlingTimer(*this, &TiledCoreAnimationDrawingArea::layerFlushThrottlingTimerFired)
+ , m_renderThrottlingTimer(*this, &TiledCoreAnimationDrawingArea::renderThrottlingTimerFired)
, m_sendDidUpdateActivityStateTimer(RunLoop::main(), this, &TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired)
, m_isPaintingSuspended(!(parameters.activityState & ActivityState::IsVisible))
{
@@ -84,8 +84,8 @@
[m_hostingLayer setOpaque:YES];
[m_hostingLayer setGeometryFlipped:YES];
- m_layerFlushRunLoopObserver = makeUnique<RunLoopObserver>(static_cast<CFIndex>(RunLoopObserver::WellKnownRunLoopOrders::LayerFlush), [this]() {
- this->layerFlushRunLoopCallback();
+ m_renderUpdateRunLoopObserver = makeUnique<RunLoopObserver>(static_cast<CFIndex>(RunLoopObserver::WellKnownRunLoopOrders::LayerFlush), [this]() {
+ this->updateRenderingRunLoopCallback();
});
updateLayerHostingContext();
@@ -94,7 +94,7 @@
TiledCoreAnimationDrawingArea::~TiledCoreAnimationDrawingArea()
{
- invalidateLayerFlushRunLoopObserver();
+ invalidateRenderingUpdateRunLoopObserver();
}
void TiledCoreAnimationDrawingArea::sendEnterAcceleratedCompositingModeIfNeeded()
@@ -155,7 +155,7 @@
frameView->tiledBacking()->forceRepaint();
}
- flushLayers();
+ updateRendering();
[CATransaction flush];
[CATransaction synchronize];
}
@@ -182,11 +182,11 @@
m_layerTreeStateIsFrozen = layerTreeStateIsFrozen;
if (m_layerTreeStateIsFrozen) {
- invalidateLayerFlushRunLoopObserver();
- m_layerFlushThrottlingTimer.stop();
+ invalidateRenderingUpdateRunLoopObserver();
+ m_renderThrottlingTimer.stop();
} else {
// Immediate flush as any delay in unfreezing can result in flashes.
- scheduleLayerFlushRunLoopObserver();
+ scheduleRenderingUpdateRunLoopObserver();
}
}
@@ -199,31 +199,31 @@
{
}
-void TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlush()
+void TiledCoreAnimationDrawingArea::scheduleRenderingUpdate()
{
if (m_layerTreeStateIsFrozen) {
- m_isLayerFlushThrottlingTemporarilyDisabledForInteraction = false;
+ m_isRenderingUpdateThrottlingTemporarilyDisabledForInteraction = false;
return;
}
- if (m_isLayerFlushThrottlingTemporarilyDisabledForInteraction) {
- m_isLayerFlushThrottlingTemporarilyDisabledForInteraction = false;
- scheduleLayerFlushRunLoopObserver();
- m_layerFlushThrottlingTimer.stop();
+ if (m_isRenderingUpdateThrottlingTemporarilyDisabledForInteraction) {
+ m_isRenderingUpdateThrottlingTemporarilyDisabledForInteraction = false;
+ scheduleRenderingUpdateRunLoopObserver();
+ m_renderThrottlingTimer.stop();
return;
}
- if (m_layerFlushThrottlingTimer.isActive()) {
- ASSERT(m_isThrottlingLayerFlushes);
+ if (m_renderThrottlingTimer.isActive()) {
+ ASSERT(m_isThrottlingRenderingUpdates);
return;
}
- scheduleLayerFlushRunLoopObserver();
+ scheduleRenderingUpdateRunLoopObserver();
}
-void TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlushImmediately()
+void TiledCoreAnimationDrawingArea::scheduleImmediateRenderingUpdate()
{
- scheduleLayerFlushRunLoopObserver();
+ scheduleRenderingUpdateRunLoopObserver();
}
void TiledCoreAnimationDrawingArea::updatePreferences(const WebPreferencesStore&)
@@ -271,7 +271,7 @@
{
m_viewOverlayRootLayer = viewOverlayRootLayer;
updateRootLayers();
- scheduleCompositingLayerFlush();
+ scheduleRenderingUpdate();
}
void TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged(const IntSize& size)
@@ -284,7 +284,7 @@
return;
m_shouldScaleViewToFitDocument = shouldScaleView;
- scheduleCompositingLayerFlush();
+ scheduleRenderingUpdate();
}
void TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded()
@@ -392,7 +392,7 @@
m_webPage.corePage()->scrollingCoordinator()->commitTreeStateIfNeeded();
if (!m_layerTreeStateIsFrozen)
- invalidateLayerFlushRunLoopObserver();
+ invalidateRenderingUpdateRunLoopObserver();
// It is possible for the drawing area to be destroyed before the bound block
// is invoked, so grab a reference to the web page here so we can access the drawing area through it.
@@ -407,7 +407,7 @@
function();
if (!m_layerTreeStateIsFrozen)
- scheduleLayerFlushRunLoopObserver();
+ scheduleRenderingUpdateRunLoopObserver();
webPage->deref();
});
@@ -428,7 +428,7 @@
void TiledCoreAnimationDrawingArea::addTransactionCallbackID(CallbackID callbackID)
{
m_pendingCallbackIDs.append(callbackID);
- scheduleCompositingLayerFlush();
+ scheduleRenderingUpdate();
}
void TiledCoreAnimationDrawingArea::addCommitHandlers()
@@ -456,7 +456,7 @@
m_webPage.setFirstFlushAfterCommit(true);
}
-void TiledCoreAnimationDrawingArea::flushLayers(FlushType flushType)
+void TiledCoreAnimationDrawingArea::updateRendering(UpdateRenderingType flushType)
{
if (layerTreeStateIsFrozen())
return;
@@ -487,7 +487,7 @@
#if ENABLE(ASYNC_SCROLLING)
if (auto* scrollingCoordinator = m_webPage.corePage()->scrollingCoordinator()) {
scrollingCoordinator->commitTreeStateIfNeeded();
- if (flushType == FlushType::Normal)
+ if (flushType == UpdateRenderingType::Normal)
scrollingCoordinator->applyScrollingTreeLayerPositions();
}
#endif
@@ -504,13 +504,13 @@
if (didFlushAllFrames) {
sendEnterAcceleratedCompositingModeIfNeeded();
- invalidateLayerFlushRunLoopObserver();
+ invalidateRenderingUpdateRunLoopObserver();
}
- if (m_isThrottlingLayerFlushes)
- startLayerFlushThrottlingTimer();
+ if (m_isThrottlingRenderingUpdates)
+ startRenderThrottlingTimer();
else
- m_layerFlushThrottlingTimer.stop();
+ m_renderThrottlingTimer.stop();
}
}
@@ -549,6 +549,7 @@
ASSERT(!m_isPaintingSuspended);
m_isPaintingSuspended = true;
+ // This is a signal to media frameworks; it does not actively pause anything.
[m_hostingLayer setValue:@YES forKey:@"NSCAViewRenderPaused"];
[[NSNotificationCenter defaultCenter] postNotificationName:@"NSCAViewRenderDidPauseNotification" object:nil userInfo:[NSDictionary dictionaryWithObject:m_hostingLayer.get() forKey:@"layer"]];
}
@@ -623,7 +624,7 @@
size = contentSize;
}
- flushLayers();
+ updateRendering();
[CATransaction begin];
[CATransaction setDisableActions:YES];
@@ -929,7 +930,7 @@
unscrolledOrigin.moveBy(-unobscuredContentRect.location());
m_webPage.scalePage(scale / m_webPage.viewScaleFactor(), roundedIntPoint(-unscrolledOrigin));
m_transientZoomScale = 1;
- flushLayers(FlushType::TransientZoom);
+ updateRendering(UpdateRenderingType::TransientZoom);
}
void TiledCoreAnimationDrawingArea::addFence(const MachSendRight& fencePort)
@@ -937,71 +938,71 @@
m_layerHostingContext->setFencePort(fencePort.sendRight());
}
-void TiledCoreAnimationDrawingArea::layerFlushRunLoopCallback()
+void TiledCoreAnimationDrawingArea::updateRenderingRunLoopCallback()
{
- tracePoint(LayerFlushRunLoopObserverEnd, 0);
+ tracePoint(RenderingUpdateRunLoopObserverEnd, 0);
- flushLayers();
+ updateRendering();
}
-void TiledCoreAnimationDrawingArea::invalidateLayerFlushRunLoopObserver()
+void TiledCoreAnimationDrawingArea::invalidateRenderingUpdateRunLoopObserver()
{
- if (!m_layerFlushRunLoopObserver->isScheduled())
+ if (!m_renderUpdateRunLoopObserver->isScheduled())
return;
- tracePoint(LayerFlushRunLoopObserverEnd, 1);
+ tracePoint(RenderingUpdateRunLoopObserverEnd, 1);
- m_layerFlushRunLoopObserver->invalidate();
+ m_renderUpdateRunLoopObserver->invalidate();
}
-void TiledCoreAnimationDrawingArea::scheduleLayerFlushRunLoopObserver()
+void TiledCoreAnimationDrawingArea::scheduleRenderingUpdateRunLoopObserver()
{
- tracePoint(LayerFlushRunLoopObserverStart);
+ tracePoint(RenderingUpdateRunLoopObserverStart);
- m_layerFlushRunLoopObserver->schedule(CFRunLoopGetCurrent());
+ m_renderUpdateRunLoopObserver->schedule(CFRunLoopGetCurrent());
}
-bool TiledCoreAnimationDrawingArea::adjustLayerFlushThrottling(LayerFlushThrottleState::Flags flags)
+bool TiledCoreAnimationDrawingArea::adjustRenderingUpdateThrottling(OptionSet<RenderingUpdateThrottleState> flags)
{
- bool wasThrottlingLayerFlushes = m_isThrottlingLayerFlushes;
- m_isThrottlingLayerFlushes = flags & LayerFlushThrottleState::Enabled;
- m_isLayerFlushThrottlingTemporarilyDisabledForInteraction = flags & LayerFlushThrottleState::UserIsInteracting;
+ bool wasThrottlingRendering = m_isThrottlingRenderingUpdates;
+ m_isThrottlingRenderingUpdates = flags.contains(RenderingUpdateThrottleState::Enabled);
+ m_isRenderingUpdateThrottlingTemporarilyDisabledForInteraction = flags.contains(RenderingUpdateThrottleState::UserIsInteracting);
- if (wasThrottlingLayerFlushes == m_isThrottlingLayerFlushes)
+ if (wasThrottlingRendering == m_isThrottlingRenderingUpdates)
return true;
- m_layerFlushThrottlingTimer.stop();
+ m_renderThrottlingTimer.stop();
if (m_layerTreeStateIsFrozen)
return true;
- if (m_isThrottlingLayerFlushes) {
- invalidateLayerFlushRunLoopObserver();
- startLayerFlushThrottlingTimer();
+ if (m_isThrottlingRenderingUpdates) {
+ invalidateRenderingUpdateRunLoopObserver();
+ startRenderThrottlingTimer();
} else
- scheduleLayerFlushRunLoopObserver();
+ scheduleRenderingUpdateRunLoopObserver();
return true;
}
-bool TiledCoreAnimationDrawingArea::layerFlushThrottlingIsActive() const
+bool TiledCoreAnimationDrawingArea::renderingUpdateThrottlingIsActive() const
{
- return m_isThrottlingLayerFlushes && !m_layerTreeStateIsFrozen;
+ return m_isThrottlingRenderingUpdates && !m_layerTreeStateIsFrozen;
}
-void TiledCoreAnimationDrawingArea::startLayerFlushThrottlingTimer()
+void TiledCoreAnimationDrawingArea::startRenderThrottlingTimer()
{
- ASSERT(m_isThrottlingLayerFlushes);
+ ASSERT(m_isThrottlingRenderingUpdates);
const auto throttledFlushDelay = 500_ms;
- m_layerFlushThrottlingTimer.startOneShot(throttledFlushDelay);
+ m_renderThrottlingTimer.startOneShot(throttledFlushDelay);
}
-void TiledCoreAnimationDrawingArea::layerFlushThrottlingTimerFired()
+void TiledCoreAnimationDrawingArea::renderThrottlingTimerFired()
{
if (m_layerTreeStateIsFrozen)
return;
- scheduleLayerFlushRunLoopObserver();
+ scheduleRenderingUpdateRunLoopObserver();
}
} // namespace WebKit
Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (256833 => 256834)
--- trunk/Source/WebKitLegacy/mac/ChangeLog 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog 2020-02-18 17:24:30 UTC (rev 256834)
@@ -1,3 +1,26 @@
+2020-02-18 Simon Fraser <simon.fra...@apple.com>
+
+ Move from "layer flush" terminology to "rendering update"
+ https://bugs.webkit.org/show_bug.cgi?id=207870
+
+ Reviewed by Tim Horton.
+
+ Rename various functions and member variables to move away from the legacy "layer flush"
+ terminology and instead use "rendering update", matching Page::updateRendering(). The fact
+ that we have layers is an implementation detail.
+
+ Change LayerFlushThrottlingState to be an OptionSet<>.
+
+ * WebCoreSupport/WebChromeClient.h:
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::scheduleRenderingUpdate):
+ (WebChromeClient::scheduleCompositingLayerFlush): Deleted.
+ * WebView/WebView.mm:
+ (-[WebView _scheduleUpdateRendering]):
+ (-[WebView _scheduleCompositingLayerFlush]): Deleted.
+ * WebView/WebViewData.h:
+ * WebView/WebViewInternal.h:
+
2020-02-14 Jon Lee <jon...@apple.com>
Mask WebGL strings
Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h (256833 => 256834)
--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h 2020-02-18 17:24:30 UTC (rev 256834)
@@ -169,7 +169,7 @@
void attachRootGraphicsLayer(WebCore::Frame&, WebCore::GraphicsLayer*) override;
void attachViewOverlayGraphicsLayer(WebCore::GraphicsLayer*) final;
void setNeedsOneShotDrawingSynchronization() final;
- void scheduleCompositingLayerFlush() final;
+ void scheduleRenderingUpdate() final;
bool needsImmediateRenderingUpdate() const final { return true; }
CompositingTriggerFlags allowedCompositingTriggers() const final
Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm (256833 => 256834)
--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm 2020-02-18 17:24:30 UTC (rev 256834)
@@ -942,10 +942,10 @@
END_BLOCK_OBJC_EXCEPTIONS;
}
-void WebChromeClient::scheduleCompositingLayerFlush()
+void WebChromeClient::scheduleRenderingUpdate()
{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
- [m_webView _scheduleCompositingLayerFlush];
+ [m_webView _scheduleUpdateRendering];
END_BLOCK_OBJC_EXCEPTIONS;
}
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebView.mm (256833 => 256834)
--- trunk/Source/WebKitLegacy/mac/WebView/WebView.mm 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebView.mm 2020-02-18 17:24:30 UTC (rev 256834)
@@ -9288,7 +9288,7 @@
return false;
}
-- (void)_scheduleCompositingLayerFlush
+- (void)_scheduleUpdateRendering
{
#if PLATFORM(IOS_FAMILY)
if (_private->closing)
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebViewData.h (256833 => 256834)
--- trunk/Source/WebKitLegacy/mac/WebView/WebViewData.h 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebViewData.h 2020-02-18 17:24:30 UTC (rev 256834)
@@ -130,6 +130,7 @@
return adoptRef(*new LayerFlushController(webView));
}
+ // FIXME: Rename to use 'updateRendering' terminology.
bool flushLayers();
void scheduleLayerFlush();
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebViewInternal.h (256833 => 256834)
--- trunk/Source/WebKitLegacy/mac/WebView/WebViewInternal.h 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebViewInternal.h 2020-02-18 17:24:30 UTC (rev 256834)
@@ -128,7 +128,7 @@
- (BOOL)_needsOneShotDrawingSynchronization;
- (void)_setNeedsOneShotDrawingSynchronization:(BOOL)needsSynchronization;
-- (void)_scheduleCompositingLayerFlush;
+- (void)_scheduleUpdateRendering;
- (BOOL)_flushCompositingChanges;
#if USE(AUTOCORRECTION_PANEL)
Modified: trunk/Source/WebKitLegacy/win/WebCoreSupport/WebChromeClient.cpp (256833 => 256834)
--- trunk/Source/WebKitLegacy/win/WebCoreSupport/WebChromeClient.cpp 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebKitLegacy/win/WebCoreSupport/WebChromeClient.cpp 2020-02-18 17:24:30 UTC (rev 256834)
@@ -746,7 +746,7 @@
// FIXME: If we want view-relative page overlays in Legacy WebKit on Windows, this would be the place to hook them up.
}
-void WebChromeClient::scheduleCompositingLayerFlush()
+void WebChromeClient::scheduleRenderingUpdate()
{
m_webView->flushPendingGraphicsLayerChangesSoon();
}
Modified: trunk/Source/WebKitLegacy/win/WebCoreSupport/WebChromeClient.h (256833 => 256834)
--- trunk/Source/WebKitLegacy/win/WebCoreSupport/WebChromeClient.h 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Source/WebKitLegacy/win/WebCoreSupport/WebChromeClient.h 2020-02-18 17:24:30 UTC (rev 256834)
@@ -133,7 +133,7 @@
void setNeedsOneShotDrawingSynchronization() final { }
// Sets a flag to specify that the view needs to be updated, so we need
// to do an eager layout before the drawing.
- void scheduleCompositingLayerFlush() final;
+ void scheduleRenderingUpdate() final;
#if PLATFORM(WIN) && USE(AVFOUNDATION)
WebCore::GraphicsDeviceAdapter* graphicsDeviceAdapter() const final;
Modified: trunk/Tools/ChangeLog (256833 => 256834)
--- trunk/Tools/ChangeLog 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Tools/ChangeLog 2020-02-18 17:24:30 UTC (rev 256834)
@@ -1,3 +1,18 @@
+2020-02-18 Simon Fraser <simon.fra...@apple.com>
+
+ Move from "layer flush" terminology to "rendering update"
+ https://bugs.webkit.org/show_bug.cgi?id=207870
+
+ Reviewed by Tim Horton.
+
+ Rename various functions and member variables to move away from the legacy "layer flush"
+ terminology and instead use "rendering update", matching Page::updateRendering(). The fact
+ that we have layers is an implementation detail.
+
+ Change LayerFlushThrottlingState to be an OptionSet<>.
+
+ * Tracing/SystemTracePoints.plist:
+
2020-02-17 Zhifei Fang <zhifei_f...@apple.com>
[Webkit.css] Adding popover style element
Modified: trunk/Tools/Tracing/SystemTracePoints.plist (256833 => 256834)
--- trunk/Tools/Tracing/SystemTracePoints.plist 2020-02-18 17:11:21 UTC (rev 256833)
+++ trunk/Tools/Tracing/SystemTracePoints.plist 2020-02-18 17:24:30 UTC (rev 256834)
@@ -359,7 +359,7 @@
</dict>
<dict>
<key>Name</key>
- <string>Layer flush runloop observer</string>
+ <string>Rendering update runloop observer</string>
<key>Type</key>
<string>Interval</string>
<key>Component</key>