⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 286565 in webkit


Ignore:
Timestamp:
Dec 6, 2021, 1:15:39 PM (5 years ago)
Author:
Simon Fraser
Message:

Add a call to os_signpost to tag a momentum scroll animation
https://bugs.webkit.org/show_bug.cgi?id=233885

Reviewed by Tim Horton.

Source/WebCore:

Use the momentum "Began" and "Ended" events to mark the start/end of a momentum scroll
as an animation via os_signost.

Put the code in ScrollingEffectsController rather than MomentumEventDispatcher so that
non-generated momentum gets marked too.

  • platform/mac/ScrollingEffectsController.mm:

(WebCore::ScrollingEffectsController::handleWheelEvent):

Source/WTF:

  • wtf/SystemTracing.h:
Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r286555 r286565  
     12021-12-06  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Add a call to os_signpost to tag a momentum scroll animation
     4        https://bugs.webkit.org/show_bug.cgi?id=233885
     5
     6        Reviewed by Tim Horton.
     7
     8        * wtf/SystemTracing.h:
     9
    1102021-12-06  Antoine Quint  <graouts@webkit.org>
    211
  • trunk/Source/WTF/wtf/SystemTracing.h

    r286537 r286565  
    197197WTF_EXTERN_C_END
    198198
     199// These macros only emit signposts on internal builds when WEBKIT_SIGNPOSTS_ENABLED is set.
    199200#define WTFEmitSignpost(pointer, name, ...) \
    200201    WTFEmitSignpostWithFunction(os_signpost_event_emit, (pointer), name, ##__VA_ARGS__)
     
    215216} while (0)
    216217
     218// These macros emit signposts on all builds.
     219#define WTFEmitSignpostAlways(name, format, ...) \
     220    do { os_signpost_event_emit(WTFSignpostLogHandle(), OS_SIGNPOST_ID_EXCLUSIVE, name, format, ##__VA_ARGS__); } } while (0)
     221
     222#define WTFBeginSignpostIntervalAlways(name, format, ...) \
     223    do { os_signpost_interval_begin(WTFSignpostLogHandle(), OS_SIGNPOST_ID_EXCLUSIVE, name, format, ##__VA_ARGS__); } while (0)
     224
     225#define WTF_OS_SIGNPOST_ANIMATION_INTERVAL_TAG "isAnimation=YES"
     226
     227#define WTFBeginAnimationSignpostIntervalAlways(name, format, ...) \
     228    do { os_signpost_interval_begin(WTFSignpostLogHandle(), OS_SIGNPOST_ID_EXCLUSIVE, name, format " " WTF_OS_SIGNPOST_ANIMATION_INTERVAL_TAG, ##__VA_ARGS__); } while (0)
     229
     230#define WTFEndSignpostIntervalAlways(name, format, ...) \
     231    do { os_signpost_interval_end(WTFSignpostLogHandle(), OS_SIGNPOST_ID_EXCLUSIVE, name, format, ##__VA_ARGS__); } while (0)
     232
    217233#else
    218234
     
    221237#define WTFEndSignpost(pointer, name, ...) do { } while (0)
    222238
     239#define WTFEmitSignpostAlways(name, format, ...) do { } while (0)
     240#define WTFBeginSignpostIntervalAlways(name, format, ...) do { } while (0)
     241#define WTFBeginAnimationSignpostIntervalAlways(name, format, ...) do { } while (0)
     242#define WTFEndSignpostIntervalAlways(name, format, ...) do { } while (0)
     243
    223244#endif
  • trunk/Source/WebCore/ChangeLog

    r286560 r286565  
     12021-12-06  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Add a call to os_signpost to tag a momentum scroll animation
     4        https://bugs.webkit.org/show_bug.cgi?id=233885
     5
     6        Reviewed by Tim Horton.
     7
     8        Use the momentum "Began" and "Ended" events to mark the start/end of a momentum scroll
     9        as an animation via os_signost.
     10
     11        Put the code in ScrollingEffectsController rather than MomentumEventDispatcher so that
     12        non-generated momentum gets marked too.
     13
     14        * platform/mac/ScrollingEffectsController.mm:
     15        (WebCore::ScrollingEffectsController::handleWheelEvent):
     16
    1172021-12-06  Devin Rousso  <drousso@apple.com>
    218
  • trunk/Source/WebCore/platform/mac/ScrollingEffectsController.mm

    r286274 r286565  
    3535#import <sys/sysctl.h>
    3636#import <sys/time.h>
     37#import <wtf/SystemTracing.h>
    3738#import <wtf/text/TextStream.h>
    3839
     
    178179
    179180    auto momentumPhase = wheelEvent.momentumPhase();
     181   
     182    if (momentumPhase == PlatformWheelEventPhase::Began)
     183        WTFBeginAnimationSignpostIntervalAlways("Momentum scroll", "");
     184   
    180185    if (!m_momentumScrollInProgress && (momentumPhase == PlatformWheelEventPhase::Began || momentumPhase == PlatformWheelEventPhase::Changed))
    181186        m_momentumScrollInProgress = true;
     
    220225
    221226    if (m_momentumScrollInProgress && momentumPhase == PlatformWheelEventPhase::Ended) {
     227        WTFEndSignpostIntervalAlways("Momentum scroll", "");
    222228        m_momentumScrollInProgress = false;
    223229        m_ignoreMomentumScrolls = false;
Note: See TracChangeset for help on using the changeset viewer.