Diff
Modified: trunk/Source/WebCore/ChangeLog (257393 => 257394)
--- trunk/Source/WebCore/ChangeLog 2020-02-26 00:44:29 UTC (rev 257393)
+++ trunk/Source/WebCore/ChangeLog 2020-02-26 00:57:01 UTC (rev 257394)
@@ -1,3 +1,40 @@
+2020-02-25 Ben Nham <[email protected]>
+
+ Remove render update throttling
+ https://bugs.webkit.org/show_bug.cgi?id=208168
+
+ Reviewed by Zalan Bujtas.
+
+ Currently, we disable render updates after the first paint for 500 ms while the page is
+ actively loading. However, oftentimes our first paint heuristic selects a first paint that
+ isn't particularly interesting (mostly background colors) and this paint throttler just
+ makes the user look at a nearly empty page for 500 ms. Antti and Simon both think we should
+ remove the throttler to fix this so this patch does that.
+
+ * Headers.cmake:
+ * WebCore.xcodeproj/project.pbxproj:
+ * dom/Document.cpp:
+ (WebCore::Document::scheduleStyleRecalc):
+ (WebCore::Document::shouldScheduleLayout):
+ * editing/AlternativeTextController.cpp:
+ (WebCore::AlternativeTextController::insertDictatedText):
+ * page/ChromeClient.h:
+ (WebCore::ChromeClient::layerTreeStateIsFrozen const):
+ (WebCore::ChromeClient::renderingUpdateThrottlingIsActive const): Deleted.
+ (WebCore::ChromeClient::adjustRenderingUpdateThrottling): Deleted.
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::dispatchDragEvent):
+ (WebCore::EventHandler::dispatchMouseEvent):
+ (WebCore::EventHandler::internalKeyEvent):
+ (WebCore::EventHandler::handleTextInputEvent):
+ * page/FrameView.cpp:
+ (WebCore::FrameView::loadProgressingStatusChanged):
+ (WebCore::FrameView::setWasScrolledByUser):
+ (WebCore::determineLayerFlushThrottleState): Deleted.
+ (WebCore::FrameView::disableLayerFlushThrottlingTemporarilyForInteraction): Deleted.
+ (WebCore::FrameView::updateLayerFlushThrottling): Deleted.
+ * page/FrameView.h:
+
2020-02-25 Myles C. Maxfield <[email protected]>
[iPadOS] REGRESSION(r247667): Autosizing style changes don't invalidate RenderText's preferred logical widths
Modified: trunk/Source/WebCore/Headers.cmake (257393 => 257394)
--- trunk/Source/WebCore/Headers.cmake 2020-02-26 00:44:29 UTC (rev 257393)
+++ trunk/Source/WebCore/Headers.cmake 2020-02-26 00:57:01 UTC (rev 257394)
@@ -834,7 +834,6 @@
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 (257393 => 257394)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2020-02-26 00:44:29 UTC (rev 257393)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2020-02-26 00:57:01 UTC (rev 257394)
@@ -4875,7 +4875,6 @@
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 /* 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, ); }; };
@@ -15273,7 +15272,6 @@
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 /* 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>"; };
@@ -20764,7 +20762,6 @@
46B95192207D632E00A7D2DD /* RemoteFrame.h */,
556C7C4922123943009B06CA /* RenderingUpdateScheduler.cpp */,
556C7C4722123942009B06CA /* RenderingUpdateScheduler.h */,
- E4916FF6195DF6A0005AB349 /* RenderingUpdateThrottleState.h */,
58B2F9F22232D43F00938D63 /* ResizeObservation.cpp */,
58B2F9F32232D43F00938D63 /* ResizeObservation.h */,
58B2F9EF2232D43D00938D63 /* ResizeObserver.cpp */,
@@ -31953,7 +31950,6 @@
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 (257393 => 257394)
--- trunk/Source/WebCore/dom/Document.cpp 2020-02-26 00:44:29 UTC (rev 257393)
+++ trunk/Source/WebCore/dom/Document.cpp 2020-02-26 00:57:01 UTC (rev 257394)
@@ -1872,10 +1872,6 @@
return;
ASSERT(childNeedsStyleRecalc() || m_needsFullStyleRebuild);
- if (page() && page()->chrome().client().renderingUpdateThrottlingIsActive()) {
- // Do not run optional style recalcs while we throttle painting.
- return;
- }
m_styleRecalcTimer.startOneShot(0_s);
@@ -3129,8 +3125,6 @@
return false;
if (styleScope().hasPendingSheetsBeforeBody())
return false;
- if (page() && page()->chrome().client().renderingUpdateThrottlingIsActive())
- return false;
if (view() && !view()->isVisuallyNonEmpty())
return false;
return true;
Modified: trunk/Source/WebCore/editing/AlternativeTextController.cpp (257393 => 257394)
--- trunk/Source/WebCore/editing/AlternativeTextController.cpp 2020-02-26 00:44:29 UTC (rev 257393)
+++ trunk/Source/WebCore/editing/AlternativeTextController.cpp 2020-02-26 00:57:01 UTC (rev 257394)
@@ -627,9 +627,6 @@
if (!target)
return false;
- if (FrameView* view = m_frame.view())
- view->disableLayerFlushThrottlingTemporarilyForInteraction();
-
auto event = TextEvent::createForDictation(&m_frame.windowProxy(), text, dictationAlternatives);
event->setUnderlyingEvent(triggeringEvent);
Modified: trunk/Source/WebCore/page/ChromeClient.h (257393 => 257394)
--- trunk/Source/WebCore/page/ChromeClient.h 2020-02-26 00:44:29 UTC (rev 257393)
+++ trunk/Source/WebCore/page/ChromeClient.h 2020-02-26 00:57:01 UTC (rev 257394)
@@ -43,7 +43,6 @@
#include "PopupMenuClient.h"
#include "RegistrableDomain.h"
#include "RenderEmbeddedObject.h"
-#include "RenderingUpdateThrottleState.h"
#include "ScrollTypes.h"
#include "ScrollingCoordinator.h"
#include "SearchPopupMenu.h"
@@ -340,10 +339,7 @@
// Returns true if layer tree updates are disabled.
virtual bool layerTreeStateIsFrozen() const { return false; }
- virtual bool renderingUpdateThrottlingIsActive() const { return false; }
- virtual bool adjustRenderingUpdateThrottling(OptionSet<RenderingUpdateThrottleState>) { return false; }
-
virtual RefPtr<ScrollingCoordinator> createScrollingCoordinator(Page&) const { return nullptr; }
#if PLATFORM(WIN) && USE(AVFOUNDATION)
Modified: trunk/Source/WebCore/page/EventHandler.cpp (257393 => 257394)
--- trunk/Source/WebCore/page/EventHandler.cpp 2020-02-26 00:44:29 UTC (rev 257393)
+++ trunk/Source/WebCore/page/EventHandler.cpp 2020-02-26 00:57:01 UTC (rev 257394)
@@ -2257,8 +2257,6 @@
if (!view)
return false;
- view->disableLayerFlushThrottlingTemporarilyForInteraction();
-
auto dragEvent = DragEvent::create(eventType, Event::CanBubble::Yes, Event::IsCancelable::Yes, Event::IsComposed::Yes,
event.timestamp().approximateMonotonicTime(), &m_frame.windowProxy(), 0,
event.globalPosition(), event.position(),
@@ -2634,9 +2632,6 @@
{
Ref<Frame> protectedFrame(m_frame);
- if (auto* view = m_frame.view())
- view->disableLayerFlushThrottlingTemporarilyForInteraction();
-
updateMouseEventTargetNode(targetNode, platformMouseEvent, setUnder ? FireMouseOverOut::Yes : FireMouseOverOut::No);
if (m_elementUnderMouse && !m_elementUnderMouse->dispatchMouseEvent(platformMouseEvent, eventType, clickCount))
@@ -3302,9 +3297,6 @@
UserGestureIndicator gestureIndicator(ProcessingUserGesture, m_frame.document(), gestureType, UserGestureIndicator::ProcessInteractionStyle::Delayed);
UserTypingGestureIndicator typingGestureIndicator(m_frame);
- if (FrameView* view = m_frame.view())
- view->disableLayerFlushThrottlingTemporarilyForInteraction();
-
// FIXME (bug 68185): this call should be made at another abstraction layer
m_frame.loader().resetMultipleFormSubmissionProtection();
@@ -3885,9 +3877,6 @@
target = eventTargetElementForDocument(m_frame.document());
if (!target)
return false;
-
- if (FrameView* view = m_frame.view())
- view->disableLayerFlushThrottlingTemporarilyForInteraction();
auto event = TextEvent::create(&m_frame.windowProxy(), text, inputType);
event->setUnderlyingEvent(underlyingEvent);
Modified: trunk/Source/WebCore/page/FrameView.cpp (257393 => 257394)
--- trunk/Source/WebCore/page/FrameView.cpp 2020-02-26 00:44:29 UTC (rev 257393)
+++ trunk/Source/WebCore/page/FrameView.cpp 2020-02-26 00:57:01 UTC (rev 257394)
@@ -2822,53 +2822,13 @@
#endif
}
-static OptionSet<RenderingUpdateThrottleState> determineLayerFlushThrottleState(Page& page)
-{
- // We only throttle when constantly receiving new data during the inital page load.
- if (!page.progress().isMainLoadProgressing())
- return { };
- // Scrolling during page loading disables throttling.
- if (page.mainFrame().view()->wasScrolledByUser())
- 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 { };
- return { RenderingUpdateThrottleState::Enabled };
-}
-
-void FrameView::disableLayerFlushThrottlingTemporarilyForInteraction()
-{
- if (!frame().page())
- return;
- auto& page = *frame().page();
-
- auto flags = determineLayerFlushThrottleState(page);
- flags.add(RenderingUpdateThrottleState::UserIsInteracting);
- page.chrome().client().adjustRenderingUpdateThrottling(flags);
-}
-
void FrameView::loadProgressingStatusChanged()
{
if (m_firstVisuallyNonEmptyLayoutMilestoneIsPending && frame().loader().isComplete())
fireLayoutRelatedMilestonesIfNeeded();
- updateLayerFlushThrottling();
adjustTiledBackingCoverage();
}
-void FrameView::updateLayerFlushThrottling()
-{
- Page* page = frame().page();
- if (!page)
- return;
-
- ASSERT(frame().isMainFrame());
-
- auto flags = determineLayerFlushThrottleState(*page);
-
- page->chrome().client().adjustRenderingUpdateThrottling(flags);
-}
-
void FrameView::adjustTiledBackingCoverage()
{
if (!m_speculativeTilingEnabled)
@@ -4087,8 +4047,6 @@
if (m_wasScrolledByUser == wasScrolledByUser)
return;
m_wasScrolledByUser = wasScrolledByUser;
- if (frame().isMainFrame())
- updateLayerFlushThrottling();
adjustTiledBackingCoverage();
}
Modified: trunk/Source/WebCore/page/FrameView.h (257393 => 257394)
--- trunk/Source/WebCore/page/FrameView.h 2020-02-26 00:44:29 UTC (rev 257393)
+++ trunk/Source/WebCore/page/FrameView.h 2020-02-26 00:57:01 UTC (rev 257394)
@@ -334,7 +334,6 @@
bool fixedElementsLayoutRelativeToFrame() const;
- WEBCORE_EXPORT void disableLayerFlushThrottlingTemporarilyForInteraction();
bool speculativeTilingEnabled() const { return m_speculativeTilingEnabled; }
void loadProgressingStatusChanged();
@@ -711,7 +710,6 @@
void resumeVisibleImageAnimations(const IntRect& visibleRect);
void updateScriptedAnimationsAndTimersThrottlingState(const IntRect& visibleRect);
- void updateLayerFlushThrottling();
WEBCORE_EXPORT void adjustTiledBackingCoverage();
void repaintContentRectangle(const IntRect&) final;
Modified: trunk/Source/WebKit/ChangeLog (257393 => 257394)
--- trunk/Source/WebKit/ChangeLog 2020-02-26 00:44:29 UTC (rev 257393)
+++ trunk/Source/WebKit/ChangeLog 2020-02-26 00:57:01 UTC (rev 257394)
@@ -1,3 +1,45 @@
+2020-02-25 Ben Nham <[email protected]>
+
+ Remove render update throttling
+ https://bugs.webkit.org/show_bug.cgi?id=208168
+
+ Reviewed by Zalan Bujtas.
+
+ Currently, we disable render updates after the first paint for 500 ms while the page is
+ actively loading. However, oftentimes our first paint heuristic selects a first paint that
+ isn't particularly interesting (mostly background colors) and this paint throttler just
+ makes the user look at a nearly empty page for 500 ms. Antti and Simon both think we should
+ remove the throttler to fix this so this patch does that.
+
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::adjustRenderingUpdateThrottling): Deleted.
+ (WebKit::WebChromeClient::renderingUpdateThrottlingIsActive const): Deleted.
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
+ * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h:
+ (WebKit::DrawingAreaCoordinatedGraphics::scheduleInitialDeferredPaint): Deleted.
+ * WebProcess/WebPage/DrawingArea.h:
+ (WebKit::DrawingArea::layerTreeStateIsFrozen const):
+ (WebKit::DrawingArea::renderingUpdateThrottlingIsActive const): Deleted.
+ (WebKit::DrawingArea::adjustRenderingUpdateThrottling): Deleted.
+ * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
+ * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
+ (WebKit::RemoteLayerTreeDrawingArea::setLayerTreeStateIsFrozen):
+ (WebKit::RemoteLayerTreeDrawingArea::scheduleRenderingUpdate):
+ (WebKit::RemoteLayerTreeDrawingArea::updateRendering):
+ (WebKit::RemoteLayerTreeDrawingArea::scheduleInitialDeferredPaint): Deleted.
+ (WebKit::RemoteLayerTreeDrawingArea::adjustRenderingUpdateThrottling): Deleted.
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+ (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
+ (WebKit::TiledCoreAnimationDrawingArea::setLayerTreeStateIsFrozen):
+ (WebKit::TiledCoreAnimationDrawingArea::scheduleRenderingUpdate):
+ (WebKit::TiledCoreAnimationDrawingArea::updateRendering):
+ (WebKit::TiledCoreAnimationDrawingArea::scheduleInitialDeferredPaint): Deleted.
+ (WebKit::TiledCoreAnimationDrawingArea::adjustRenderingUpdateThrottling): Deleted.
+ (WebKit::TiledCoreAnimationDrawingArea::renderingUpdateThrottlingIsActive const): Deleted.
+ (WebKit::TiledCoreAnimationDrawingArea::startRenderThrottlingTimer): Deleted.
+ (WebKit::TiledCoreAnimationDrawingArea::renderThrottlingTimerFired): Deleted.
+
2020-02-25 Tim Horton <[email protected]>
PDFPlugin: 'Open in Preview' and 'Save' don't work for blobs
Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp (257393 => 257394)
--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp 2020-02-26 00:44:29 UTC (rev 257393)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp 2020-02-26 00:57:01 UTC (rev 257394)
@@ -938,11 +938,6 @@
#endif
}
-bool WebChromeClient::adjustRenderingUpdateThrottling(OptionSet<RenderingUpdateThrottleState> flags)
-{
- return m_page.drawingArea() && m_page.drawingArea()->adjustRenderingUpdateThrottling(flags);
-}
-
bool WebChromeClient::layerTreeStateIsFrozen() const
{
if (m_page.drawingArea())
@@ -951,14 +946,6 @@
return false;
}
-bool WebChromeClient::renderingUpdateThrottlingIsActive() const
-{
- if (m_page.drawingArea())
- return m_page.drawingArea()->renderingUpdateThrottlingIsActive();
-
- return false;
-}
-
#if ENABLE(ASYNC_SCROLLING)
RefPtr<ScrollingCoordinator> WebChromeClient::createScrollingCoordinator(Page& page) const
Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h (257393 => 257394)
--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h 2020-02-26 00:44:29 UTC (rev 257393)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h 2020-02-26 00:57:01 UTC (rev 257394)
@@ -219,7 +219,6 @@
void attachViewOverlayGraphicsLayer(WebCore::GraphicsLayer*) final;
void setNeedsOneShotDrawingSynchronization() final;
void scheduleRenderingUpdate() final;
- bool adjustRenderingUpdateThrottling(OptionSet<WebCore::RenderingUpdateThrottleState>) final;
void contentRuleListNotification(const URL&, const WebCore::ContentRuleListResults&) final;
@@ -252,7 +251,6 @@
}
bool layerTreeStateIsFrozen() 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.h (257393 => 257394)
--- trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h 2020-02-26 00:44:29 UTC (rev 257393)
+++ trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h 2020-02-26 00:57:01 UTC (rev 257394)
@@ -69,7 +69,6 @@
WebCore::GraphicsLayerFactory* graphicsLayerFactory() override;
void setRootCompositingLayer(WebCore::GraphicsLayer*) override;
- void scheduleInitialDeferredPaint() override { };
void scheduleRenderingUpdate() override;
void scheduleImmediateRenderingUpdate() override { scheduleRenderingUpdate(); };
Modified: trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h (257393 => 257394)
--- trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h 2020-02-26 00:44:29 UTC (rev 257393)
+++ trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h 2020-02-26 00:57:01 UTC (rev 257394)
@@ -35,7 +35,6 @@
#include <WebCore/IntRect.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 +84,6 @@
virtual bool forceRepaintAsync(CallbackID) { return false; }
virtual void setLayerTreeStateIsFrozen(bool) { }
virtual bool layerTreeStateIsFrozen() const { return false; }
- virtual bool renderingUpdateThrottlingIsActive() const { return false; }
virtual void updatePreferences(const WebPreferencesStore&) { }
virtual void enablePainting() { }
@@ -114,7 +112,6 @@
virtual WebCore::GraphicsLayerFactory* graphicsLayerFactory() { return nullptr; }
virtual void setRootCompositingLayer(WebCore::GraphicsLayer*) = 0;
virtual void scheduleRenderingUpdate() = 0;
- virtual void scheduleInitialDeferredPaint() = 0;
virtual void scheduleImmediateRenderingUpdate() = 0;
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
@@ -128,8 +125,6 @@
virtual bool markLayersVolatileImmediatelyIfPossible() { return true; }
- virtual bool adjustRenderingUpdateThrottling(OptionSet<WebCore::RenderingUpdateThrottleState>) { return false; }
-
virtual void attachViewOverlayGraphicsLayer(WebCore::GraphicsLayer*) { }
virtual void setShouldScaleViewToFitDocument(bool) { }
Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h (257393 => 257394)
--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h 2020-02-26 00:44:29 UTC (rev 257393)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h 2020-02-26 00:57:01 UTC (rev 257394)
@@ -64,7 +64,6 @@
WebCore::GraphicsLayerFactory* graphicsLayerFactory() override;
void setRootCompositingLayer(WebCore::GraphicsLayer*) override;
- void scheduleInitialDeferredPaint() override;
void scheduleRenderingUpdate() override;
void scheduleImmediateRenderingUpdate() override;
void attachViewOverlayGraphicsLayer(WebCore::GraphicsLayer*) override;
@@ -84,7 +83,6 @@
void setLayerTreeStateIsFrozen(bool) override;
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,8 +106,6 @@
void activityStateDidChange(OptionSet<WebCore::ActivityState::Flag> changed, ActivityStateChangeID, const Vector<CallbackID>& callbackIDs) override;
- bool adjustRenderingUpdateThrottling(OptionSet<WebCore::RenderingUpdateThrottleState>) override;
-
bool addMilestonesToDispatch(OptionSet<WebCore::LayoutMilestone>) override;
void updateScrolledExposedRect();
@@ -154,14 +150,9 @@
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_deferredRenderingUpdateWhileWaitingForBackingStoreSwap { false };
Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm (257393 => 257394)
--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm 2020-02-26 00:44:29 UTC (rev 257393)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm 2020-02-26 00:57:01 UTC (rev 257394)
@@ -194,7 +194,7 @@
if (!m_isRenderingSuspended && m_hasDeferredRenderingUpdate) {
m_hasDeferredRenderingUpdate = false;
- scheduleInitialDeferredPaint();
+ scheduleImmediateRenderingUpdate();
}
}
@@ -278,59 +278,18 @@
m_updateRenderingTimer.startOneShot(0_s);
}
-void RemoteLayerTreeDrawingArea::scheduleInitialDeferredPaint()
-{
- ASSERT(!m_isRenderingSuspended);
- m_inInitialDeferredRenderingUpdate = true;
-
- if (m_updateRenderingTimer.isActive())
- return;
- scheduleImmediateRenderingUpdate();
-}
-
void RemoteLayerTreeDrawingArea::scheduleRenderingUpdate()
{
if (m_isRenderingSuspended) {
- m_isRenderingUpdateThrottlingTemporarilyDisabledForInteraction = false;
m_hasDeferredRenderingUpdate = true;
return;
}
- if (m_isRenderingUpdateThrottlingTemporarilyDisabledForInteraction) {
- m_isRenderingUpdateThrottlingTemporarilyDisabledForInteraction = false;
- scheduleImmediateRenderingUpdate();
- return;
- }
if (m_updateRenderingTimer.isActive())
return;
-
- const Seconds initialFlushDelay = 500_ms;
- const Seconds flushDelay = 1500_ms;
- Seconds throttleDelay = m_isThrottlingRenderingUpdates ? (m_isFirstThrottledRenderingUpdate ? initialFlushDelay : flushDelay) : 0_s;
- m_isFirstThrottledRenderingUpdate = false;
-
- m_updateRenderingTimer.startOneShot(throttleDelay);
+ scheduleImmediateRenderingUpdate();
}
-bool RemoteLayerTreeDrawingArea::adjustRenderingUpdateThrottling(OptionSet<RenderingUpdateThrottleState> flags)
-{
- if (flags.contains(RenderingUpdateThrottleState::UserIsInteracting))
- m_isRenderingUpdateThrottlingTemporarilyDisabledForInteraction = true;
-
- bool wasThrottlingLayerFlushes = m_isThrottlingRenderingUpdates;
- m_isThrottlingRenderingUpdates = flags.contains(RenderingUpdateThrottleState::Enabled);
-
- if (!wasThrottlingLayerFlushes && m_isThrottlingRenderingUpdates)
- m_isFirstThrottledRenderingUpdate = true;
-
- // Re-schedule the flush if we stopped throttling.
- if (wasThrottlingLayerFlushes && !m_isThrottlingRenderingUpdates && m_updateRenderingTimer.isActive()) {
- m_updateRenderingTimer.stop();
- scheduleRenderingUpdate();
- }
- return true;
-}
-
void RemoteLayerTreeDrawingArea::addCommitHandlers()
{
if (m_webPage.firstFlushAfterCommit())
@@ -366,13 +325,6 @@
return;
}
- if (m_inInitialDeferredRenderingUpdate) {
- m_inInitialDeferredRenderingUpdate = false;
- // Reschedule the flush timer for the second paint if painting is being throttled.
- if (m_isThrottlingRenderingUpdates)
- scheduleRenderingUpdate();
- }
-
// This function is not reentrant, e.g. a rAF callback may force repaint.
if (m_inUpdateRendering)
return;
Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h (257393 => 257394)
--- trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h 2020-02-26 00:44:29 UTC (rev 257393)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h 2020-02-26 00:57:01 UTC (rev 257394)
@@ -65,7 +65,6 @@
void setLayerTreeStateIsFrozen(bool) override;
bool layerTreeStateIsFrozen() const override;
void setRootCompositingLayer(WebCore::GraphicsLayer*) override;
- void scheduleInitialDeferredPaint() override;
void scheduleRenderingUpdate() override;
void scheduleImmediateRenderingUpdate() override;
@@ -134,9 +133,6 @@
void invalidateRenderingUpdateRunLoopObserver();
void scheduleRenderingUpdateRunLoopObserver();
- bool adjustRenderingUpdateThrottling(OptionSet<WebCore::RenderingUpdateThrottleState>) override;
- bool renderingUpdateThrottlingIsActive() const override;
-
void startRenderThrottlingTimer();
void renderThrottlingTimerFired();
@@ -156,8 +152,6 @@
double m_transientZoomScale { 1 };
WebCore::FloatPoint m_transientZoomOrigin;
- WebCore::Timer m_renderThrottlingTimer;
-
RunLoop::Timer<TiledCoreAnimationDrawingArea> m_sendDidUpdateActivityStateTimer;
Vector<CallbackID> m_nextActivityStateChangeCallbackIDs;
ActivityStateChangeID m_activityStateChangeID { ActivityStateChangeAsynchronous };
@@ -174,8 +168,6 @@
bool m_layerTreeStateIsFrozen { false };
bool m_shouldScaleViewToFitDocument { false };
bool m_isScalingViewToFitDocument { false };
- bool m_isThrottlingRenderingUpdates { false };
- bool m_isRenderingUpdateThrottlingTemporarilyDisabledForInteraction { false };
bool m_needsSendEnterAcceleratedCompositingMode { true };
};
Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (257393 => 257394)
--- trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2020-02-26 00:44:29 UTC (rev 257393)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2020-02-26 00:57:01 UTC (rev 257394)
@@ -73,7 +73,6 @@
TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea(WebPage& webPage, const WebPageCreationParameters& parameters)
: DrawingArea(DrawingAreaTypeTiledCoreAnimation, parameters.drawingAreaIdentifier, webPage)
- , m_renderThrottlingTimer(*this, &TiledCoreAnimationDrawingArea::renderThrottlingTimerFired)
, m_sendDidUpdateActivityStateTimer(RunLoop::main(), this, &TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired)
, m_isPaintingSuspended(!(parameters.activityState & ActivityState::IsVisible))
{
@@ -184,7 +183,6 @@
if (m_layerTreeStateIsFrozen) {
invalidateRenderingUpdateRunLoopObserver();
- m_renderThrottlingTimer.stop();
} else {
// Immediate flush as any delay in unfreezing can result in flashes.
scheduleRenderingUpdateRunLoopObserver();
@@ -196,29 +194,12 @@
return m_layerTreeStateIsFrozen;
}
-void TiledCoreAnimationDrawingArea::scheduleInitialDeferredPaint()
-{
-}
-
void TiledCoreAnimationDrawingArea::scheduleRenderingUpdate()
{
if (m_layerTreeStateIsFrozen) {
- m_isRenderingUpdateThrottlingTemporarilyDisabledForInteraction = false;
return;
}
- if (m_isRenderingUpdateThrottlingTemporarilyDisabledForInteraction) {
- m_isRenderingUpdateThrottlingTemporarilyDisabledForInteraction = false;
- scheduleRenderingUpdateRunLoopObserver();
- m_renderThrottlingTimer.stop();
- return;
- }
-
- if (m_renderThrottlingTimer.isActive()) {
- ASSERT(m_isThrottlingRenderingUpdates);
- return;
- }
-
scheduleRenderingUpdateRunLoopObserver();
}
@@ -507,11 +488,6 @@
sendEnterAcceleratedCompositingModeIfNeeded();
invalidateRenderingUpdateRunLoopObserver();
}
-
- if (m_isThrottlingRenderingUpdates)
- startRenderThrottlingTimer();
- else
- m_renderThrottlingTimer.stop();
}
}
@@ -969,49 +945,6 @@
WebCore::WindowEventLoop::breakToAllowRenderingUpdate();
}
-bool TiledCoreAnimationDrawingArea::adjustRenderingUpdateThrottling(OptionSet<RenderingUpdateThrottleState> flags)
-{
- bool wasThrottlingRendering = m_isThrottlingRenderingUpdates;
- m_isThrottlingRenderingUpdates = flags.contains(RenderingUpdateThrottleState::Enabled);
- m_isRenderingUpdateThrottlingTemporarilyDisabledForInteraction = flags.contains(RenderingUpdateThrottleState::UserIsInteracting);
-
- if (wasThrottlingRendering == m_isThrottlingRenderingUpdates)
- return true;
-
- m_renderThrottlingTimer.stop();
-
- if (m_layerTreeStateIsFrozen)
- return true;
-
- if (m_isThrottlingRenderingUpdates) {
- invalidateRenderingUpdateRunLoopObserver();
- startRenderThrottlingTimer();
- } else
- scheduleRenderingUpdateRunLoopObserver();
-
- return true;
-}
-
-bool TiledCoreAnimationDrawingArea::renderingUpdateThrottlingIsActive() const
-{
- return m_isThrottlingRenderingUpdates && !m_layerTreeStateIsFrozen;
-}
-
-void TiledCoreAnimationDrawingArea::startRenderThrottlingTimer()
-{
- ASSERT(m_isThrottlingRenderingUpdates);
-
- const auto throttledFlushDelay = 500_ms;
- m_renderThrottlingTimer.startOneShot(throttledFlushDelay);
-}
-
-void TiledCoreAnimationDrawingArea::renderThrottlingTimerFired()
-{
- if (m_layerTreeStateIsFrozen)
- return;
- scheduleRenderingUpdateRunLoopObserver();
-}
-
} // namespace WebKit
#endif // PLATFORM(MAC)