Changeset 270557 in webkit


Ignore:
Timestamp:
Dec 8, 2020, 2:57:27 PM (5 years ago)
Author:
Simon Fraser
Message:

Make ScrollingPerformanceLoggingEnabled an internal debug preference
https://bugs.webkit.org/show_bug.cgi?id=219647

Reviewed by Sam Weinig.

Source/WebCore:

ScrollingPerformanceLoggingEnabled is used by a Safari performance test, so it needs to be
easily toggleable from a script. That's easier if it's an Internal Debug preference.

Testing also sets ForceUpdateScrollbarsOnMainThreadForPerformanceTesting but we can just use
the ScrollingPerformanceLoggingEnabled flag, but it makes more sense to rename
ScrollingPerformanceLoggingEnabled to ScrollingPerformanceTestingEnabled when we do that.

Also fix how we propagate ScrollingPerformanceTestingEnabled to the scrolling tree;
do so via ScrollingStateFrameScrollingNode as we do for the other tree-wide settings,
removing code in TiledCoreAnimationDrawingArea::updatePreferences() that did this.

  • page/FrameView.cpp:

(WebCore::FrameView::forceUpdateScrollbarsOnMainThreadForPerformanceTesting const):
(WebCore::FrameView::setScrollingPerformanceTestingEnabled):
(WebCore::FrameView::setScrollingPerformanceLoggingEnabled): Deleted.

  • page/FrameView.h:
  • page/SettingsBase.cpp:

(WebCore::SettingsBase::scrollingPerformanceTestingEnabledChanged):
(WebCore::SettingsBase::scrollingPerformanceLoggingEnabledChanged): Deleted.

  • page/SettingsBase.h:
  • page/scrolling/AsyncScrollingCoordinator.cpp:

(WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
(WebCore::AsyncScrollingCoordinator::asyncFrameOrOverflowScrollingEnabled const): Deleted.
(WebCore::AsyncScrollingCoordinator::wheelEventGesturesBecomeNonBlocking const): Deleted.

  • page/scrolling/AsyncScrollingCoordinator.h:
  • page/scrolling/ScrollingStateFrameScrollingNode.cpp:

(WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
(WebCore::ScrollingStateFrameScrollingNode::applicableProperties const):
(WebCore::ScrollingStateFrameScrollingNode::setScrollingPerformanceTestingEnabled):

  • page/scrolling/ScrollingStateFrameScrollingNode.h:
  • page/scrolling/ScrollingStateNode.h:
  • page/scrolling/ScrollingTree.cpp:

(WebCore::ScrollingTree::commitTreeState):
(WebCore::ScrollingTree::setScrollingPerformanceLoggingEnabled): Deleted.
(WebCore::ScrollingTree::scrollingPerformanceLoggingEnabled): Deleted.

  • page/scrolling/ScrollingTree.h:

(WebCore::ScrollingTree::scrollingPerformanceTestingEnabled const):
(WebCore::ScrollingTree::setScrollingPerformanceTestingEnabled):

  • page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:

(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged):

  • platform/graphics/TiledBacking.h:
  • platform/graphics/ca/TileController.h:
  • platform/graphics/ca/TileGrid.cpp:

(WebCore::TileGrid::platformCALayerPaintContents):

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::forceUpdateScrollbarsOnMainThreadForPerformanceTesting const):

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::RenderLayerBacking):

  • rendering/RenderListBox.cpp:

(WebCore::RenderListBox::forceUpdateScrollbarsOnMainThreadForPerformanceTesting const):

Source/WebKit:

ScrollingPerformanceLoggingEnabled is used by a Safari performance test, so it needs to be
easily toggleable from a script. That's easier if it's an Internal Debug preference.

Testing also sets ForceUpdateScrollbarsOnMainThreadForPerformanceTesting but we can just use
the ScrollingPerformanceLoggingEnabled flag, but it makes more sense to rename
ScrollingPerformanceLoggingEnabled to ScrollingPerformanceTestingEnabled when we do that.

Also fix how we propagate ScrollingPerformanceTestingEnabled to the scrolling tree;
do so via ScrollingStateFrameScrollingNode as we do for the other tree-wide settings,
removing code in TiledCoreAnimationDrawingArea::updatePreferences() that did this.

  • Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:

(ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
(ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):

  • UIProcess/API/C/WKPreferences.cpp:

(WKPreferencesSetScrollingPerformanceLoggingEnabled):
(WKPreferencesGetScrollingPerformanceLoggingEnabled):

  • WebProcess/Plugins/PDF/PDFPlugin.mm:

(WebKit::PDFPlugin::forceUpdateScrollbarsOnMainThreadForPerformanceTesting const):

  • WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:

(WebKit::TiledCoreAnimationDrawingArea::updatePreferences):

Source/WTF:

Rename ScrollingPerformanceLoggingEnabled to ScrollingPerformanceTestingEnabled and make
it an Internal Debug preference.

Remove ForceUpdateScrollbarsOnMainThreadForPerformanceTesting.

  • Scripts/Preferences/WebPreferences.yaml:
  • Scripts/Preferences/WebPreferencesInternal.yaml:
Location:
trunk/Source
Files:
29 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/Source/WTF/ChangeLog

    r270542 r270557  
     12020-12-08  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Make ScrollingPerformanceLoggingEnabled an internal debug preference
     4        https://bugs.webkit.org/show_bug.cgi?id=219647
     5
     6        Reviewed by Sam Weinig.
     7
     8        Rename ScrollingPerformanceLoggingEnabled to ScrollingPerformanceTestingEnabled and make
     9        it an Internal Debug preference.
     10
     11        Remove ForceUpdateScrollbarsOnMainThreadForPerformanceTesting.
     12
     13        * Scripts/Preferences/WebPreferences.yaml:
     14        * Scripts/Preferences/WebPreferencesInternal.yaml:
     15
    1162020-12-08  Chris Dumez  <cdumez@apple.com>
    217
  • TabularUnified trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml

    r270446 r270557  
    803803      default: false
    804804
    805 ForceUpdateScrollbarsOnMainThreadForPerformanceTesting:
    806   type: bool
    807   defaultValue:
    808     WebKitLegacy:
    809       default: false
    810     WebKit:
    811       default: false
    812     WebCore:
    813       default: false
    814 
    815805ForceWebGLUsesLowPower:
    816806  type: bool
     
    18471837      default: true
    18481838
    1849 # FIXME: Is this implemented for WebKitLegacy? If not, this should be excluded from WebKitLegacy entirely (though we should still set the default value to false when initializing settings).
    1850 ScrollingPerformanceLoggingEnabled:
    1851   type: bool
    1852   webcoreOnChange: scrollingPerformanceLoggingEnabledChanged
    1853   defaultValue:
    1854     WebKitLegacy:
    1855       default: false
    1856     WebKit:
    1857       default: false
    1858     WebCore:
    1859       default: false
    1860 
    18611839# FIXME: This is handled via WebView SPI rather than WebPreferences for WebKitLegacy. We should change the SPI to lookup the WebPreferences value instead.
    18621840SelectTrailingWhitespaceEnabled:
  • TabularUnified trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml

    r269985 r270557  
    611611      default: true
    612612
     613ScrollingPerformanceTestingEnabled:
     614  type: bool
     615  humanReadableName: "Scroll Performance Testing Enabled"
     616  humanReadableDescription: "Enable behaviors used by scrolling performance tests"
     617  webcoreOnChange: scrollingPerformanceTestingEnabledChanged
     618  exposed: [ WebKit ]
     619  defaultValue:
     620    WebKitLegacy:
     621      default: false
     622    WebKit:
     623      default: false
     624    WebCore:
     625      default: false
     626
    613627SecureContextChecksEnabled:
    614628  type: bool
  • TabularUnified trunk/Source/WebCore/ChangeLog

    r270556 r270557  
     12020-12-08  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Make ScrollingPerformanceLoggingEnabled an internal debug preference
     4        https://bugs.webkit.org/show_bug.cgi?id=219647
     5
     6        Reviewed by Sam Weinig.
     7
     8        ScrollingPerformanceLoggingEnabled is used by a Safari performance test, so it needs to be
     9        easily toggleable from a script. That's easier if it's an Internal Debug preference.
     10
     11        Testing also sets ForceUpdateScrollbarsOnMainThreadForPerformanceTesting but we can just use
     12        the ScrollingPerformanceLoggingEnabled flag, but it makes more sense to rename
     13        ScrollingPerformanceLoggingEnabled to ScrollingPerformanceTestingEnabled when we do that.
     14
     15        Also fix how we propagate ScrollingPerformanceTestingEnabled to the scrolling tree;
     16        do so via ScrollingStateFrameScrollingNode as we do for the other tree-wide settings,
     17        removing code in TiledCoreAnimationDrawingArea::updatePreferences() that did this.
     18
     19        * page/FrameView.cpp:
     20        (WebCore::FrameView::forceUpdateScrollbarsOnMainThreadForPerformanceTesting const):
     21        (WebCore::FrameView::setScrollingPerformanceTestingEnabled):
     22        (WebCore::FrameView::setScrollingPerformanceLoggingEnabled): Deleted.
     23        * page/FrameView.h:
     24        * page/SettingsBase.cpp:
     25        (WebCore::SettingsBase::scrollingPerformanceTestingEnabledChanged):
     26        (WebCore::SettingsBase::scrollingPerformanceLoggingEnabledChanged): Deleted.
     27        * page/SettingsBase.h:
     28        * page/scrolling/AsyncScrollingCoordinator.cpp:
     29        (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
     30        (WebCore::AsyncScrollingCoordinator::asyncFrameOrOverflowScrollingEnabled const): Deleted.
     31        (WebCore::AsyncScrollingCoordinator::wheelEventGesturesBecomeNonBlocking const): Deleted.
     32        * page/scrolling/AsyncScrollingCoordinator.h:
     33        * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
     34        (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
     35        (WebCore::ScrollingStateFrameScrollingNode::applicableProperties const):
     36        (WebCore::ScrollingStateFrameScrollingNode::setScrollingPerformanceTestingEnabled):
     37        * page/scrolling/ScrollingStateFrameScrollingNode.h:
     38        * page/scrolling/ScrollingStateNode.h:
     39        * page/scrolling/ScrollingTree.cpp:
     40        (WebCore::ScrollingTree::commitTreeState):
     41        (WebCore::ScrollingTree::setScrollingPerformanceLoggingEnabled): Deleted.
     42        (WebCore::ScrollingTree::scrollingPerformanceLoggingEnabled): Deleted.
     43        * page/scrolling/ScrollingTree.h:
     44        (WebCore::ScrollingTree::scrollingPerformanceTestingEnabled const):
     45        (WebCore::ScrollingTree::setScrollingPerformanceTestingEnabled):
     46        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
     47        (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
     48        (WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged):
     49        * platform/graphics/TiledBacking.h:
     50        * platform/graphics/ca/TileController.h:
     51        * platform/graphics/ca/TileGrid.cpp:
     52        (WebCore::TileGrid::platformCALayerPaintContents):
     53        * rendering/RenderLayer.cpp:
     54        (WebCore::RenderLayer::forceUpdateScrollbarsOnMainThreadForPerformanceTesting const):
     55        * rendering/RenderLayerBacking.cpp:
     56        (WebCore::RenderLayerBacking::RenderLayerBacking):
     57        * rendering/RenderListBox.cpp:
     58        (WebCore::RenderListBox::forceUpdateScrollbarsOnMainThreadForPerformanceTesting const):
     59
    1602020-12-08  Wenson Hsieh  <wenson_hsieh@apple.com>
    261
  • TabularUnified trunk/Source/WebCore/page/FrameView.cpp

    r270390 r270557  
    7373#include "Page.h"
    7474#include "PageOverlayController.h"
     75#include "PerformanceLoggingClient.h"
    7576#include "ProgressTracker.h"
    7677#include "Quirks.h"
     
    37473748{
    37483749    Page* page = frame().page();
    3749     return page && page->settings().forceUpdateScrollbarsOnMainThreadForPerformanceTesting();
     3750    return page && page->settings().scrollingPerformanceTestingEnabled();
    37503751}
    37513752
     
    52135214#endif // PLATFORM(IOS_FAMILY)
    52145215
    5215 void FrameView::setScrollingPerformanceLoggingEnabled(bool flag)
    5216 {
     5216void FrameView::setScrollingPerformanceTestingEnabled(bool scrollingPerformanceTestingEnabled)
     5217{
     5218    if (scrollingPerformanceTestingEnabled) {
     5219        auto* page = frame().page();
     5220        if (page && page->performanceLoggingClient())
     5221            page->performanceLoggingClient()->logScrollingEvent(PerformanceLoggingClient::ScrollingEvent::LoggingEnabled, MonotonicTime::now(), 0);
     5222    }
     5223
    52175224    if (TiledBacking* tiledBacking = this->tiledBacking())
    5218         tiledBacking->setScrollingPerformanceLoggingEnabled(flag);
     5225        tiledBacking->setScrollingPerformanceTestingEnabled(scrollingPerformanceTestingEnabled);
    52195226}
    52205227
  • TabularUnified trunk/Source/WebCore/page/FrameView.h

    r270389 r270557  
    568568    bool handleWheelEventForScrolling(const PlatformWheelEvent&, Optional<WheelScrollGestureState>) final;
    569569
    570     WEBCORE_EXPORT void setScrollingPerformanceLoggingEnabled(bool);
     570    WEBCORE_EXPORT void setScrollingPerformanceTestingEnabled(bool);
    571571
    572572    // Page and FrameView both store a Pagination value. Page::pagination() is set only by API,
  • TabularUnified trunk/Source/WebCore/page/PerformanceLoggingClient.h

    r257996 r270557  
    3838public:
    3939    enum class ScrollingEvent {
     40        LoggingEnabled,
    4041        ExposedTilelessArea,
    4142        FilledTile,
  • TabularUnified trunk/Source/WebCore/page/SettingsBase.cpp

    r269545 r270557  
    340340}
    341341
    342 void SettingsBase::scrollingPerformanceLoggingEnabledChanged()
     342void SettingsBase::scrollingPerformanceTestingEnabledChanged()
    343343{
    344344    if (m_page && m_page->mainFrame().view())
    345         m_page->mainFrame().view()->setScrollingPerformanceLoggingEnabled(m_page->settings().scrollingPerformanceLoggingEnabled());
     345        m_page->mainFrame().view()->setScrollingPerformanceTestingEnabled(m_page->settings().scrollingPerformanceTestingEnabled());
    346346}
    347347
  • TabularUnified trunk/Source/WebCore/page/SettingsBase.h

    r269953 r270557  
    126126    void storageBlockingPolicyChanged();
    127127    void backgroundShouldExtendBeyondPageChanged();
    128     void scrollingPerformanceLoggingEnabledChanged();
     128    void scrollingPerformanceTestingEnabledChanged();
    129129    void hiddenPageDOMTimerThrottlingStateChanged();
    130130    void hiddenPageCSSAnimationSuspensionEnabledChanged();
  • TabularUnified trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp

    r270338 r270557  
    646646        return;
    647647
     648    auto& settings = m_page->mainFrame().settings();
    648649    auto& frameScrollingNode = downcast<ScrollingStateFrameScrollingNode>(*stateNode);
    649650
     
    653654    frameScrollingNode.setTopContentInset(frameView.topContentInset());
    654655    frameScrollingNode.setLayoutViewport(frameView.layoutViewportRect());
    655     frameScrollingNode.setAsyncFrameOrOverflowScrollingEnabled(asyncFrameOrOverflowScrollingEnabled());
    656     frameScrollingNode.setWheelEventGesturesBecomeNonBlocking(wheelEventGesturesBecomeNonBlocking());
     656    frameScrollingNode.setAsyncFrameOrOverflowScrollingEnabled(settings.asyncFrameScrollingEnabled() || settings.asyncOverflowScrollingEnabled());
     657    frameScrollingNode.setScrollingPerformanceTestingEnabled(settings.scrollingPerformanceTestingEnabled());
     658    frameScrollingNode.setWheelEventGesturesBecomeNonBlocking(settings.wheelEventGesturesBecomeNonBlocking());
    657659
    658660    frameScrollingNode.setMinLayoutViewportOrigin(frameView.minStableLayoutViewportOrigin());
     
    832834}
    833835
    834 bool AsyncScrollingCoordinator::asyncFrameOrOverflowScrollingEnabled() const
    835 {
    836     auto& settings = m_page->mainFrame().settings();
    837     return settings.asyncFrameScrollingEnabled() || settings.asyncOverflowScrollingEnabled();
    838 }
    839 
    840 bool AsyncScrollingCoordinator::wheelEventGesturesBecomeNonBlocking() const
    841 {
    842     auto& settings = m_page->mainFrame().settings();
    843     return settings.wheelEventGesturesBecomeNonBlocking();
    844 }
    845 
    846836ScrollingNodeID AsyncScrollingCoordinator::scrollableContainerNodeID(const RenderObject& renderer) const
    847837{
  • TabularUnified trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h

    r270338 r270557  
    9595
    9696    bool hasVisibleSlowRepaintViewportConstrainedObjects(const FrameView&) const override { return false; }
    97    
    98     bool asyncFrameOrOverflowScrollingEnabled() const;
    99     bool wheelEventGesturesBecomeNonBlocking() const;
    10097
    10198    WEBCORE_EXPORT ScrollingNodeID scrollableContainerNodeID(const RenderObject&) const override;
  • TabularUnified trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp

    r270156 r270557  
    6161    , m_asyncFrameOrOverflowScrollingEnabled(stateNode.asyncFrameOrOverflowScrollingEnabled())
    6262    , m_wheelEventGesturesBecomeNonBlocking(stateNode.wheelEventGesturesBecomeNonBlocking())
     63    , m_scrollingPerformanceTestingEnabled(stateNode.scrollingPerformanceTestingEnabled())
    6364{
    6465    if (hasChangedProperty(Property::RootContentsLayer))
     
    107108        Property::AsyncFrameOrOverflowScrollingEnabled,
    108109        Property::WheelEventGesturesBecomeNonBlocking,
     110        Property::ScrollingPerformanceTestingEnabled,
    109111        Property::LayoutViewport,
    110112        Property::MinLayoutViewportOrigin,
     
    297299    m_wheelEventGesturesBecomeNonBlocking = enabled;
    298300    setPropertyChanged(Property::WheelEventGesturesBecomeNonBlocking);
     301}
     302
     303void ScrollingStateFrameScrollingNode::setScrollingPerformanceTestingEnabled(bool enabled)
     304{
     305    if (enabled == m_scrollingPerformanceTestingEnabled)
     306        return;
     307   
     308    m_scrollingPerformanceTestingEnabled = enabled;
     309    setPropertyChanged(Property::ScrollingPerformanceTestingEnabled);
    299310}
    300311
  • TabularUnified trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h

    r270156 r270557  
    112112    void setAsyncFrameOrOverflowScrollingEnabled(bool);
    113113
     114    bool scrollingPerformanceTestingEnabled() const { return m_scrollingPerformanceTestingEnabled; }
     115    WEBCORE_EXPORT void setScrollingPerformanceTestingEnabled(bool);
     116
    114117    bool wheelEventGesturesBecomeNonBlocking() const { return m_wheelEventGesturesBecomeNonBlocking; }
    115118    WEBCORE_EXPORT void setWheelEventGesturesBecomeNonBlocking(bool);
     
    146149    bool m_asyncFrameOrOverflowScrollingEnabled { false };
    147150    bool m_wheelEventGesturesBecomeNonBlocking { false };
     151    bool m_scrollingPerformanceTestingEnabled { false };
    148152};
    149153
  • TabularUnified trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h

    r270156 r270557  
    260260        AsyncFrameOrOverflowScrollingEnabled        = 1LLU << 36,
    261261        WheelEventGesturesBecomeNonBlocking         = 1LLU << 37,
    262         LayoutViewport                              = 1LLU << 38,
    263         MinLayoutViewportOrigin                     = 1LLU << 39,
    264         MaxLayoutViewportOrigin                     = 1LLU << 40,
    265         OverrideVisualViewportSize                  = 1LLU << 41,
     262        ScrollingPerformanceTestingEnabled          = 1LLU << 38,
     263        LayoutViewport                              = 1LLU << 39,
     264        MinLayoutViewportOrigin                     = 1LLU << 40,
     265        MaxLayoutViewportOrigin                     = 1LLU << 41,
     266        OverrideVisualViewportSize                  = 1LLU << 42,
    266267        // ScrollingStatePositionedNode
    267         RelatedOverflowScrollingNodes               = 1LLU << 42,
    268         LayoutConstraintData                        = 1LLU << 43,
     268        RelatedOverflowScrollingNodes               = 1LLU << 43,
     269        LayoutConstraintData                        = 1LLU << 44,
    269270        // ScrollingStateFixedNode, ScrollingStateStickyNode
    270         ViewportConstraints                         = 1LLU << 44,
     271        ViewportConstraints                         = 1LLU << 45,
    271272        // ScrollingStateOverflowScrollProxyNode
    272         OverflowScrollingNode                       = 1LLU << 45,
     273        OverflowScrollingNode                       = 1LLU << 46,
    273274    };
    274275   
  • TabularUnified trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp

    r270425 r270557  
    273273            || rootNode->hasChangedProperty(ScrollingStateNode::Property::AsyncFrameOrOverflowScrollingEnabled)
    274274            || rootNode->hasChangedProperty(ScrollingStateNode::Property::WheelEventGesturesBecomeNonBlocking)
     275            || rootNode->hasChangedProperty(ScrollingStateNode::Property::ScrollingPerformanceTestingEnabled)
    275276            || rootNode->hasChangedProperty(ScrollingStateNode::Property::IsMonitoringWheelEvents))) {
    276277        LockHolder lock(m_treeStateMutex);
     
    287288        if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateNode::Property::WheelEventGesturesBecomeNonBlocking))
    288289            m_wheelEventGesturesBecomeNonBlocking = scrollingStateTree->rootStateNode()->wheelEventGesturesBecomeNonBlocking();
     290
     291        if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateNode::Property::ScrollingPerformanceTestingEnabled))
     292            m_scrollingPerformanceTestingEnabled = scrollingStateTree->rootStateNode()->scrollingPerformanceTestingEnabled();
    289293
    290294        if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateNode::Property::IsMonitoringWheelEvents))
     
    697701}
    698702
    699 void ScrollingTree::setScrollingPerformanceLoggingEnabled(bool flag)
    700 {
    701     m_scrollingPerformanceLoggingEnabled = flag;
    702 }
    703 
    704 bool ScrollingTree::scrollingPerformanceLoggingEnabled()
    705 {
    706     return m_scrollingPerformanceLoggingEnabled;
    707 }
    708 
    709703String ScrollingTree::scrollingTreeAsText(ScrollingStateTreeAsTextBehavior behavior)
    710704{
  • TabularUnified trunk/Source/WebCore/page/scrolling/ScrollingTree.h

    r270491 r270557  
    9696    void setWheelEventGesturesBecomeNonBlocking(bool value) { m_wheelEventGesturesBecomeNonBlocking = value; }
    9797
     98    bool scrollingPerformanceTestingEnabled() const { return m_scrollingPerformanceTestingEnabled; }
     99    void setScrollingPerformanceTestingEnabled(bool value) { m_scrollingPerformanceTestingEnabled = value; }
     100
    98101    WEBCORE_EXPORT OptionSet<WheelEventProcessingSteps> determineWheelEventProcessing(const PlatformWheelEvent&);
    99102    WEBCORE_EXPORT virtual WheelEventHandlingResult handleWheelEvent(const PlatformWheelEvent&, OptionSet<WheelEventProcessingSteps> = { });
     
    178181
    179182    WEBCORE_EXPORT bool willWheelEventStartSwipeGesture(const PlatformWheelEvent&);
    180 
    181     WEBCORE_EXPORT void setScrollingPerformanceLoggingEnabled(bool flag);
    182     bool scrollingPerformanceLoggingEnabled();
    183183
    184184    ScrollingTreeFrameScrollingNode* rootNode() const { return m_rootNode.get(); }
     
    329329    bool m_isHandlingProgrammaticScroll { false };
    330330    bool m_isMonitoringWheelEvents { false };
    331     bool m_scrollingPerformanceLoggingEnabled { false };
     331    bool m_scrollingPerformanceTestingEnabled { false };
    332332    bool m_asyncFrameOrOverflowScrollingEnabled { false };
    333333    bool m_wheelEventGesturesBecomeNonBlocking { false };
  • TabularUnified trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm

    r270130 r270557  
    9191        logScrollingMode = true;
    9292
    93     if (logScrollingMode && isRootNode() && scrollingTree().scrollingPerformanceLoggingEnabled())
     93    if (logScrollingMode && isRootNode() && scrollingTree().scrollingPerformanceTestingEnabled())
    9494        scrollingTree().reportSynchronousScrollingReasonsChanged(MonotonicTime::now(), synchronousScrollingReasons());
    9595
     
    156156    ScrollingTreeFrameScrollingNode::currentScrollPositionChanged(scrollType, hasSynchronousScrollingReasons() ? ScrollingLayerPositionAction::Set : action);
    157157
    158     if (scrollingTree().scrollingPerformanceLoggingEnabled()) {
     158    if (scrollingTree().scrollingPerformanceTestingEnabled()) {
    159159        unsigned unfilledArea = exposedUnfilledArea();
    160160        if (unfilledArea || m_lastScrollHadUnfilledPixels)
  • TabularUnified trunk/Source/WebCore/platform/graphics/TiledBacking.h

    r245837 r270557  
    107107    virtual void forceRepaint() = 0;
    108108
    109     virtual void setScrollingPerformanceLoggingEnabled(bool) = 0;
    110     virtual bool scrollingPerformanceLoggingEnabled() const = 0;
     109    virtual void setScrollingPerformanceTestingEnabled(bool) = 0;
     110    virtual bool scrollingPerformanceTestingEnabled() const = 0;
    111111   
    112112    virtual double retainedTileBackingStoreMemory() const = 0;
  • TabularUnified trunk/Source/WebCore/platform/graphics/ca/TileController.h

    r250661 r270557  
    126126    FloatRect adjustTileCoverageRectForScrolling(const FloatRect& coverageRect, const FloatSize& newSize, const FloatRect& previousVisibleRect, const FloatRect& currentVisibleRect, float contentsScale) final;
    127127
    128     bool scrollingPerformanceLoggingEnabled() const final { return m_scrollingPerformanceLoggingEnabled; }
     128    bool scrollingPerformanceTestingEnabled() const final { return m_scrollingPerformanceTestingEnabled; }
    129129
    130130    IntSize computeTileSize();
     
    170170    void forceRepaint() final;
    171171    IntRect tileGridExtent() const final;
    172     void setScrollingPerformanceLoggingEnabled(bool flag) final { m_scrollingPerformanceLoggingEnabled = flag; }
     172    void setScrollingPerformanceTestingEnabled(bool flag) final { m_scrollingPerformanceTestingEnabled = flag; }
    173173    double retainedTileBackingStoreMemory() const final;
    174174    IntRect tileCoverageRect() const final;
     
    237237   
    238238    bool m_isInWindow { false };
    239     bool m_scrollingPerformanceLoggingEnabled { false };
     239    bool m_scrollingPerformanceTestingEnabled { false };
    240240    bool m_acceleratesDrawing { false };
    241241    bool m_wantsDeepColorBackingStore { false };
  • TabularUnified trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp

    r262028 r270557  
    738738        PlatformCALayer::drawRepaintIndicator(context, platformCALayer, repaintCount, m_controller.tileDebugBorderColor());
    739739
    740     if (m_controller.scrollingPerformanceLoggingEnabled()) {
     740    if (m_controller.scrollingPerformanceTestingEnabled()) {
    741741        FloatRect visiblePart(platformCALayer->position().x(), platformCALayer->position().y(), platformCALayer->bounds().size().width(), platformCALayer->bounds().size().height());
    742742        visiblePart.intersect(m_controller.visibleRect());
  • TabularUnified trunk/Source/WebCore/rendering/RenderLayer.cpp

    r270390 r270557  
    19241924bool RenderLayer::forceUpdateScrollbarsOnMainThreadForPerformanceTesting() const
    19251925{
    1926     return renderer().settings().forceUpdateScrollbarsOnMainThreadForPerformanceTesting();
     1926    return renderer().settings().scrollingPerformanceTestingEnabled();
    19271927}
    19281928
  • TabularUnified trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r270416 r270557  
    228228
    229229        if (m_isFrameLayerWithTiledBacking) {
    230             tiledBacking->setScrollingPerformanceLoggingEnabled(renderer().settings().scrollingPerformanceLoggingEnabled());
     230            tiledBacking->setScrollingPerformanceTestingEnabled(renderer().settings().scrollingPerformanceTestingEnabled());
    231231            adjustTiledBackingCoverage();
    232232        }
  • TabularUnified trunk/Source/WebCore/rendering/RenderListBox.cpp

    r265338 r270557  
    874874bool RenderListBox::forceUpdateScrollbarsOnMainThreadForPerformanceTesting() const
    875875{
    876     return settings().forceUpdateScrollbarsOnMainThreadForPerformanceTesting();
     876    return settings().scrollingPerformanceTestingEnabled();
    877877}
    878878
  • TabularUnified trunk/Source/WebKit/ChangeLog

    r270555 r270557  
     12020-12-08  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Make ScrollingPerformanceLoggingEnabled an internal debug preference
     4        https://bugs.webkit.org/show_bug.cgi?id=219647
     5
     6        Reviewed by Sam Weinig.
     7
     8        ScrollingPerformanceLoggingEnabled is used by a Safari performance test, so it needs to be
     9        easily toggleable from a script. That's easier if it's an Internal Debug preference.
     10
     11        Testing also sets ForceUpdateScrollbarsOnMainThreadForPerformanceTesting but we can just use
     12        the ScrollingPerformanceLoggingEnabled flag, but it makes more sense to rename
     13        ScrollingPerformanceLoggingEnabled to ScrollingPerformanceTestingEnabled when we do that.
     14
     15        Also fix how we propagate ScrollingPerformanceTestingEnabled to the scrolling tree;
     16        do so via ScrollingStateFrameScrollingNode as we do for the other tree-wide settings,
     17        removing code in TiledCoreAnimationDrawingArea::updatePreferences() that did this.
     18
     19        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
     20        (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
     21        (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
     22        * UIProcess/API/C/WKPreferences.cpp:
     23        (WKPreferencesSetScrollingPerformanceLoggingEnabled):
     24        (WKPreferencesGetScrollingPerformanceLoggingEnabled):
     25        * WebProcess/Plugins/PDF/PDFPlugin.mm:
     26        (WebKit::PDFPlugin::forceUpdateScrollbarsOnMainThreadForPerformanceTesting const):
     27        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
     28        (WebKit::TiledCoreAnimationDrawingArea::updatePreferences):
     29
    1302020-12-08  Per Arne Vollan  <pvollan@apple.com>
    231
  • TabularUnified trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp

    r270156 r270557  
    144144        WebCore::ScrollingStateNode::Property::AsyncFrameOrOverflowScrollingEnabled,
    145145        WebCore::ScrollingStateNode::Property::WheelEventGesturesBecomeNonBlocking,
     146        WebCore::ScrollingStateNode::Property::ScrollingPerformanceTestingEnabled,
    146147        WebCore::ScrollingStateNode::Property::LayoutViewport,
    147148        WebCore::ScrollingStateNode::Property::MinLayoutViewportOrigin,
     
    244245    // AsyncFrameOrOverflowScrollingEnabled is not relevant for UI-side compositing.
    245246    SCROLLING_NODE_ENCODE(ScrollingStateNode::Property::WheelEventGesturesBecomeNonBlocking, wheelEventGesturesBecomeNonBlocking)
     247    SCROLLING_NODE_ENCODE(ScrollingStateNode::Property::ScrollingPerformanceTestingEnabled, scrollingPerformanceTestingEnabled)
    246248    SCROLLING_NODE_ENCODE(ScrollingStateNode::Property::LayoutViewport, layoutViewport)
    247249    SCROLLING_NODE_ENCODE(ScrollingStateNode::Property::MinLayoutViewportOrigin, minLayoutViewportOrigin)
     
    362364    // AsyncFrameOrOverflowScrollingEnabled is not encoded.
    363365    SCROLLING_NODE_DECODE(ScrollingStateNode::Property::WheelEventGesturesBecomeNonBlocking, bool, setWheelEventGesturesBecomeNonBlocking)
     366    SCROLLING_NODE_DECODE(ScrollingStateNode::Property::ScrollingPerformanceTestingEnabled, bool, setScrollingPerformanceTestingEnabled)
    364367    SCROLLING_NODE_DECODE(ScrollingStateNode::Property::LayoutViewport, FloatRect, setLayoutViewport)
    365368    SCROLLING_NODE_DECODE(ScrollingStateNode::Property::MinLayoutViewportOrigin, FloatPoint, setMinLayoutViewportOrigin)
  • TabularUnified trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp

    r269888 r270557  
    10591059void WKPreferencesSetScrollingPerformanceLoggingEnabled(WKPreferencesRef preferencesRef, bool enabled)
    10601060{
    1061     toImpl(preferencesRef)->setScrollingPerformanceLoggingEnabled(enabled);
     1061    toImpl(preferencesRef)->setScrollingPerformanceTestingEnabled(enabled);
    10621062}
    10631063
    10641064bool WKPreferencesGetScrollingPerformanceLoggingEnabled(WKPreferencesRef preferencesRef)
    10651065{
    1066     return toImpl(preferencesRef)->scrollingPerformanceLoggingEnabled();
     1066    return toImpl(preferencesRef)->scrollingPerformanceTestingEnabled();
    10671067}
    10681068
  • TabularUnified trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r270545 r270557  
    72647264
    72657265    switch (event) {
     7266    case PerformanceLoggingClient::ScrollingEvent::LoggingEnabled:
     7267        WTFLogAlways("SCROLLING: ScrollingPerformanceTestingEnabled\n");
     7268        break;
    72667269    case PerformanceLoggingClient::ScrollingEvent::ExposedTilelessArea:
    72677270        WTFLogAlways("SCROLLING: Exposed tileless area. Time: %f Unfilled Pixels: %llu\n", timestamp.secondsSinceEpoch().value(), (unsigned long long)data);
  • TabularUnified trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm

    r270278 r270557  
    14581458    if (auto* coreFrame = m_frame ? m_frame->coreFrame() : nullptr) {
    14591459        if (auto* page = coreFrame->page())
    1460             return page->settings().forceUpdateScrollbarsOnMainThreadForPerformanceTesting();
     1460            return page->settings().scrollingPerformanceTestingEnabled();
    14611461    }
    14621462
  • TabularUnified trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm

    r269805 r270557  
    220220    Settings& settings = m_webPage.corePage()->settings();
    221221
    222 #if ENABLE(ASYNC_SCROLLING)
    223     if (AsyncScrollingCoordinator* scrollingCoordinator = downcast<AsyncScrollingCoordinator>(m_webPage.corePage()->scrollingCoordinator())) {
    224         bool scrollingPerformanceLoggingEnabled = store.getBoolValueForKey(WebPreferencesKey::scrollingPerformanceLoggingEnabledKey());
    225        
    226         RefPtr<ScrollingTree> scrollingTree = scrollingCoordinator->scrollingTree();
    227         ScrollingThread::dispatch([scrollingTree, scrollingPerformanceLoggingEnabled] {
    228             scrollingTree->setScrollingPerformanceLoggingEnabled(scrollingPerformanceLoggingEnabled);
    229         });
    230     }
    231 #endif
    232 
    233222    // Fixed position elements need to be composited and create stacking contexts
    234223    // in order to be scrolled by the ScrollingCoordinator.
Note: See TracChangeset for help on using the changeset viewer.