RESOLVED FIXED 134398
Flush throttling with remote layers
https://bugs.webkit.org/show_bug.cgi?id=134398
Summary Flush throttling with remote layers
Antti Koivisto
Reported 2014-06-27 09:34:31 PDT
The new remote layer code has largely defeated the existing flush throttling. We should bring it back.
Attachments
patch (14.95 KB, patch)
2014-06-27 09:59 PDT, Antti Koivisto
no flags
non-Cocoa build fix (15.01 KB, patch)
2014-06-27 10:49 PDT, Antti Koivisto
simon.fraser: review-
updated patch (22.47 KB, patch)
2014-06-27 14:25 PDT, Antti Koivisto
darin: review+
Antti Koivisto
Comment 1 2014-06-27 09:34:53 PDT
Antti Koivisto
Comment 2 2014-06-27 09:59:36 PDT
Antti Koivisto
Comment 3 2014-06-27 10:49:25 PDT
Created attachment 233997 [details] non-Cocoa build fix
Simon Fraser (smfr)
Comment 4 2014-06-27 11:16:19 PDT
Comment on attachment 233997 [details] non-Cocoa build fix View in context: https://bugs.webkit.org/attachment.cgi?id=233997&action=review > Source/WebCore/page/FrameView.cpp:2257 > + if (frame().page()->chrome().client().usesRemoteLayerTree()) { > + frame().page()->chrome().client().disableLayerFlushThrottlingTemporarilyForInteraction(); Icky knowledge of DrawingArea in FrameView.
Simon Fraser (smfr)
Comment 5 2014-06-27 11:16:29 PDT
FrameView::updateLayerFlushThrottlingInAllFrames() should call FrameView::frameLoadProgressingStatusChanged(Frame*) FrameView::frameLoadProgressingStatusChanged() calls updateLayerFlushThrottlingInAllFrames(); adjustTiledBackingCoverage(); FrameView::updateLayerFlushThrottlingInAllFrames() { bool isMainLoadProgressing = frame().page()->progress().isMainLoadProgressing(); if (frame().page()->chrome().client().adjustLayerFlushThrottling(isMainLoadProgressing)) return; // client handled throttling ... } Maybe have: enum ThottleState { MainLoadProgressing = 1 << 0, UserIsInteracting = 1 << 1 ... }; typedef unsigned ThottleStateFlags; ChromeClient::adjustLayerFlushThrottling(ThottleStateFlags);
Antti Koivisto
Comment 6 2014-06-27 14:25:32 PDT
Created attachment 234017 [details] updated patch
Darin Adler
Comment 7 2014-06-27 14:31:52 PDT
Comment on attachment 234017 [details] updated patch View in context: https://bugs.webkit.org/attachment.cgi?id=234017&action=review > Source/WebCore/loader/FrameLoader.cpp:3413 > void FrameLoader::loadProgressingStatusChanged() > { > - FrameView* view = m_frame.mainFrame().view(); > - if (!view) > - return; > - > - view->updateLayerFlushThrottlingInAllFrames(); > - view->adjustTiledBackingCoverage(); > + if (auto* view = m_frame.mainFrame().view()) > + view->loadProgressingStatusChanged(); > } Could the callers work directly on FrameView instead of calling through FrameLoader? > Source/WebCore/page/FrameView.cpp:2276 > - bool isMainLoadProgressing = frame().page()->progress().isMainLoadProgressing(); > + ASSERT(frame().isMainFrame()); > + > + bool mainLoadProgressing = frame().page()->progress().isMainLoadProgressing(); I think the old name with "is" is better. > Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:259 > + static const auto initialFlushDelay = 500_ms; > + static const auto flushDelay = 1500_ms; I don’t think the “static” here are helpful. > Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:284 > + // Re-schedule the flush if we stopped throttling. > + if (!wasThrottlingLayerFlushes || m_isThrottlingLayerFlushes) > + return true; > + if (!m_layerFlushTimer.isActive()) > + return true; > + m_layerFlushTimer.stop(); > + > + scheduleCompositingLayerFlush(); I think we could rewrite this to match the comment better: if (wasThrottlingLayerFlushes && !m_isThrottlingLayerFlushes && m_layerFlushTimer.isActive()) { m_layerFlushTimer.stop(); scheduleCompositingLayerFlush(); } Seems clearer to me than the early return version.
Simon Fraser (smfr)
Comment 8 2014-06-27 14:40:08 PDT
Comment on attachment 234017 [details] updated patch View in context: https://bugs.webkit.org/attachment.cgi?id=234017&action=review > Source/WebCore/page/FrameView.cpp:2261 > + bool mainLoadProgressing = frame().page()->progress().isMainLoadProgressing(); > + > + LayerFlushThrottleState::Flags flags = LayerFlushThrottleState::UserIsInteracting | (mainLoadProgressing ? LayerFlushThrottleState::MainLoadProgressing : 0); > + if (frame().page()->chrome().client().adjustLayerFlushThrottling(flags)) > + return; > + Would be nice if this could just call updateLayerFlushThrottling(LayerFlushThrottleState::UserIsInteracting) at some point.
Antti Koivisto
Comment 9 2014-06-27 14:47:03 PDT
> Could the callers work directly on FrameView instead of calling through FrameLoader? I don't want to make ProgressTracker know about views.
Antti Koivisto
Comment 10 2014-06-27 14:59:02 PDT
Note You need to log in before you can comment on or make changes to this bug.