Changeset 225509 in webkit


Ignore:
Timestamp:
Dec 4, 2017 5:13:27 PM (6 years ago)
Author:
Simon Fraser
Message:

Minor DisplayRefreshMonitor-related cleanup
https://bugs.webkit.org/show_bug.cgi?id=179802

Reviewed by Sam Weinig.

Source/WebCore:

New trace point for when the CVDisplayLink fires on its own thread.

Some #pragma once, and put all the WellKnownRunLoopOrders in one place.

  • inspector/agents/InspectorTimelineAgent.cpp:

(WebCore::InspectorTimelineAgent::internalStart):

  • platform/cf/RunLoopObserver.h:
  • platform/graphics/DisplayRefreshMonitor.cpp:

(WebCore::DisplayRefreshMonitor::displayDidRefresh):

  • platform/graphics/ca/LayerFlushScheduler.h:
  • platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp:

(WebCore::LayerFlushScheduler::LayerFlushScheduler):

Source/WebKit:

Use RunLoopObserver::WellKnownRunLoopOrders. We want to fire before layer flushing.

  • UIProcess/WebPageProxy.cpp:

(WebKit::m_configurationPreferenceValues):

Source/WTF:

New trace point for when the CVDisplayLink fires on its own thread.

  • wtf/SystemTracing.h:

Tools:

New trace point for when the CVDisplayLink fires on its own thread.

  • Tracing/SystemTracePoints.plist:
Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r225499 r225509  
     12017-12-04  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Minor DisplayRefreshMonitor-related cleanup
     4        https://bugs.webkit.org/show_bug.cgi?id=179802
     5
     6        Reviewed by Sam Weinig.
     7
     8        New trace point for when the CVDisplayLink fires on its own thread.
     9
     10        * wtf/SystemTracing.h:
     11
    1122017-12-04  JF Bastien  <jfbastien@apple.com>
    213
  • trunk/Source/WTF/wtf/SystemTracing.h

    r224312 r225509  
    7474    DisplayListRecordStart,
    7575    DisplayListRecordEnd,
     76    DisplayRefreshDispatchingToMainThread,
    7677
    7778    WebKitRange = 10000,
  • trunk/Source/WebCore/ChangeLog

    r225507 r225509  
     12017-12-04  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Minor DisplayRefreshMonitor-related cleanup
     4        https://bugs.webkit.org/show_bug.cgi?id=179802
     5
     6        Reviewed by Sam Weinig.
     7
     8        New trace point for when the CVDisplayLink fires on its own thread.
     9
     10        Some #pragma once, and put all the WellKnownRunLoopOrders in one place.
     11
     12        * inspector/agents/InspectorTimelineAgent.cpp:
     13        (WebCore::InspectorTimelineAgent::internalStart):
     14        * platform/cf/RunLoopObserver.h:
     15        * platform/graphics/DisplayRefreshMonitor.cpp:
     16        (WebCore::DisplayRefreshMonitor::displayDidRefresh):
     17        * platform/graphics/ca/LayerFlushScheduler.h:
     18        * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp:
     19        (WebCore::LayerFlushScheduler::LayerFlushScheduler):
     20
    1212017-12-04  David Quesada  <david_quesada@apple.com>
    222
  • trunk/Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp

    r225263 r225509  
    6868
    6969#if PLATFORM(COCOA)
    70 static const CFIndex frameStopRunLoopOrder = (CFIndex)RunLoopObserver::WellKnownRunLoopOrders::CoreAnimationCommit + 1;
    71 
    7270static CFRunLoopRef currentRunLoop()
    7371{
     
    175173
    176174#if PLATFORM(COCOA)
    177     m_frameStartObserver = std::make_unique<RunLoopObserver>(0, [this]() {
     175    m_frameStartObserver = std::make_unique<RunLoopObserver>(static_cast<CFIndex>(RunLoopObserver::WellKnownRunLoopOrders::InspectorFrameBegin), [this]() {
    178176        if (!m_enabled || m_environment.scriptDebugServer().isPaused())
    179177            return;
     
    184182    });
    185183
    186     m_frameStopObserver = std::make_unique<RunLoopObserver>(frameStopRunLoopOrder, [this]() {
     184    m_frameStopObserver = std::make_unique<RunLoopObserver>(static_cast<CFIndex>(RunLoopObserver::WellKnownRunLoopOrders::InspectorFrameEnd), [this]() {
    187185        if (!m_enabled || m_environment.scriptDebugServer().isPaused())
    188186            return;
  • trunk/Source/WebCore/platform/cf/RunLoopObserver.h

    r218615 r225509  
    2424 */
    2525
    26 #ifndef RunLoopObserver_h
    27 #define RunLoopObserver_h
     26#pragma once
    2827
    2928#include <CoreFoundation/CoreFoundation.h>
     
    5251
    5352    enum class WellKnownRunLoopOrders : CFIndex {
    54         CoreAnimationCommit = 2000000
     53        CoreAnimationCommit     = 2000000,
     54        LayerFlush              = CoreAnimationCommit - 1,
     55        ActivityStateChange     = CoreAnimationCommit - 2,
     56        InspectorFrameBegin     = 0,
     57        InspectorFrameEnd       = CoreAnimationCommit + 1
    5558    };
    5659
     
    6871} // namespace WebCore
    6972
    70 #endif // RunLoopObserver_h
  • trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.cpp

    r224797 r225509  
    117117    {
    118118        LockHolder lock(m_mutex);
    119         m_previousFrameDone = true;
     119        setIsPreviousFrameDone(true);
    120120    }
    121121
  • trunk/Source/WebCore/platform/graphics/ca/LayerFlushScheduler.h

    r172862 r225509  
    2424 */
    2525
    26 #ifndef LayerFlushScheduler_h
    27 #define LayerFlushScheduler_h
     26#pragma once
    2827
    2928#include "LayerFlushSchedulerClient.h"
     
    6261} // namespace WebCore
    6362
    64 #endif // LayerFlushScheduler_h
  • trunk/Source/WebCore/platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp

    r223728 r225509  
    3737namespace WebCore {
    3838
    39 static const CFIndex layerFlushRunLoopOrder = (CFIndex)RunLoopObserver::WellKnownRunLoopOrders::CoreAnimationCommit - 1;
    40 
    4139static CFRunLoopRef currentRunLoop()
    4240{
     
    5957    ASSERT_ARG(client, client);
    6058
    61     m_runLoopObserver = std::make_unique<RunLoopObserver>(layerFlushRunLoopOrder, [this]() {
     59    m_runLoopObserver = std::make_unique<RunLoopObserver>(static_cast<CFIndex>(RunLoopObserver::WellKnownRunLoopOrders::LayerFlush), [this]() {
    6260        if (this->isSuspended())
    6361            return;
  • trunk/Source/WebKit/ChangeLog

    r225508 r225509  
     12017-12-04  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Minor DisplayRefreshMonitor-related cleanup
     4        https://bugs.webkit.org/show_bug.cgi?id=179802
     5
     6        Reviewed by Sam Weinig.
     7
     8        Use RunLoopObserver::WellKnownRunLoopOrders. We want to fire before layer flushing.
     9
     10        * UIProcess/WebPageProxy.cpp:
     11        (WebKit::m_configurationPreferenceValues):
     12
    1132017-12-04  Brent Fulgham  <bfulgham@apple.com>
    214
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r225438 r225509  
    409409
    410410#if PLATFORM(COCOA)
    411     const CFIndex activityStateChangeRunLoopOrder = (CFIndex)RunLoopObserver::WellKnownRunLoopOrders::CoreAnimationCommit - 1;
    412     m_activityStateChangeDispatcher = std::make_unique<RunLoopObserver>(activityStateChangeRunLoopOrder, [this] {
     411    m_activityStateChangeDispatcher = std::make_unique<RunLoopObserver>(static_cast<CFIndex>(RunLoopObserver::WellKnownRunLoopOrders::ActivityStateChange), [this] {
    413412        this->dispatchActivityStateChange();
    414413    });
  • trunk/Tools/ChangeLog

    r225507 r225509  
     12017-12-04  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Minor DisplayRefreshMonitor-related cleanup
     4        https://bugs.webkit.org/show_bug.cgi?id=179802
     5
     6        Reviewed by Sam Weinig.
     7
     8        New trace point for when the CVDisplayLink fires on its own thread.
     9
     10        * Tracing/SystemTracePoints.plist:
     11
    1122017-12-04  David Quesada  <david_quesada@apple.com>
    213
  • trunk/Tools/Tracing/SystemTracePoints.plist

    r224312 r225509  
    197197             <dict>
    198198                 <key>Name</key>
     199                 <string>Display Refresh Dispatch to main thread</string>
     200                 <key>Type</key>
     201                 <string>Impulse</string>
     202                 <key>Component</key>
     203                 <string>47</string>
     204                 <key>Code</key>
     205                 <string>5026</string>
     206             </dict>
     207             <dict>
     208                 <key>Name</key>
    199209                 <string>Paint WebHTMLView</string>
    200210                 <key>Type</key>
Note: See TracChangeset for help on using the changeset viewer.