Changeset 253308 in webkit


Ignore:
Timestamp:
Dec 9, 2019 4:47:10 PM (4 years ago)
Author:
Truitt Savell
Message:

Unreviewed, rolling out r253299.

Casued 30+ imported/ test failures on Mac wk2

Reverted changeset:

"Throttling requestAnimationFrame should be controlled by
RenderingUpdateScheduler"
https://bugs.webkit.org/show_bug.cgi?id=204713
https://trac.webkit.org/changeset/253299

Location:
trunk
Files:
4 deleted
29 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r253302 r253308  
     12019-12-09  Truitt Savell  <tsavell@apple.com>
     2
     3        Unreviewed, rolling out r253299.
     4
     5        Casued 30+ imported/ test failures on Mac wk2
     6
     7        Reverted changeset:
     8
     9        "Throttling requestAnimationFrame should be controlled by
     10        RenderingUpdateScheduler"
     11        https://bugs.webkit.org/show_bug.cgi?id=204713
     12        https://trac.webkit.org/changeset/253299
     13
    1142019-12-09  Wenson Hsieh  <wenson_hsieh@apple.com>
    215
  • trunk/LayoutTests/fast/animation/request-animation-frame-throttling-lowPowerMode-expected.txt

    r253299 r253308  
    44
    55
    6 PASS farmesPerSecond < 35 is true
     6PASS internals.isRequestAnimationFrameThrottled() is false
     7PASS internals.requestAnimationFrameInterval is Infinity
     8rAFHandle = requestAnimationFrame(doWork);
     9PASS internals.isRequestAnimationFrameThrottled() is false
     10PASS internals.requestAnimationFrameInterval is 0.015
     11internals.setLowPowerModeEnabled(true);
     12PASS internals.isRequestAnimationFrameThrottled() is true
     13PASS internals.requestAnimationFrameInterval is 0.030
     14cancelAnimationFrame(rAFHandle);
     15PASS internals.isRequestAnimationFrameThrottled() is true
     16PASS internals.requestAnimationFrameInterval is 0.030
     17rAFHandle = requestAnimationFrame(doWork);
     18PASS internals.isRequestAnimationFrameThrottled() is true
     19PASS internals.requestAnimationFrameInterval is 0.030
     20internals.setLowPowerModeEnabled(false);
     21PASS internals.isRequestAnimationFrameThrottled() is false
     22PASS internals.requestAnimationFrameInterval is 0.015
    723PASS successfullyParsed is true
    824
  • trunk/LayoutTests/fast/animation/request-animation-frame-throttling-lowPowerMode.html

    r253299 r253308  
    22<html>
    33<body>
    4     <script src="../../resources/js-test-pre.js"></script>
    5     <script>
    6         description("Test that requestAnimationFrame gets throttled in low power mode.");
     4<script src="../../resources/js-test-pre.js"></script>
     5<script>
     6description("Test that requestAnimationFrame gets throttled in low power mode.");
    77
    8         window.jsTestIsAsync = true;
     8let rAFHandle;
     9let i = 0;
     10function doWork()
     11{
     12    i++;
     13    rAFHandle = requestAnimationFrame(doWork);
     14}
    915
    10         if (window.internals)
    11             internals.setLowPowerModeEnabled(true);
    12 
    13         var start = null;
    14         var farmesPerSecond = 0;
    15         function doWork(timestamp) {
    16             if (!start)
    17                 start = timestamp;
    18             if (timestamp - start < 1000) {
    19                 ++farmesPerSecond;
    20                 window.requestAnimationFrame(doWork);
    21             }
    22             else {
    23                 // The LowPowerMode throttling interval = 30_ms. The frame rate ~= 33.3 fps.
    24                 shouldBeTrue("farmesPerSecond < 35");
    25                 finishJSTest();
    26             }
    27         }
    28         window.requestAnimationFrame(doWork);
    29     </script>
    30     <script src="../../resources/js-test-post.js"></script>
     16shouldBeFalse("internals.isRequestAnimationFrameThrottled()");
     17shouldBe("internals.requestAnimationFrameInterval", "Infinity");
     18evalAndLog("rAFHandle = requestAnimationFrame(doWork);");
     19shouldBeFalse("internals.isRequestAnimationFrameThrottled()");
     20shouldBe("internals.requestAnimationFrameInterval", "0.015");
     21evalAndLog("internals.setLowPowerModeEnabled(true);");
     22shouldBeTrue("internals.isRequestAnimationFrameThrottled()");
     23shouldBe("internals.requestAnimationFrameInterval", "0.030");
     24evalAndLog("cancelAnimationFrame(rAFHandle);");
     25shouldBeTrue("internals.isRequestAnimationFrameThrottled()");
     26shouldBe("internals.requestAnimationFrameInterval", "0.030");
     27evalAndLog("rAFHandle = requestAnimationFrame(doWork);");
     28shouldBeTrue("internals.isRequestAnimationFrameThrottled()");
     29shouldBe("internals.requestAnimationFrameInterval", "0.030");
     30evalAndLog("internals.setLowPowerModeEnabled(false);");
     31shouldBeFalse("internals.isRequestAnimationFrameThrottled()");
     32shouldBe("internals.requestAnimationFrameInterval", "0.015");
     33</script>
     34<script src="../../resources/js-test-post.js"></script>
    3135</body>
    3236</html>
  • trunk/Source/WebCore/ChangeLog

    r253302 r253308  
     12019-12-09  Truitt Savell  <tsavell@apple.com>
     2
     3        Unreviewed, rolling out r253299.
     4
     5        Casued 30+ imported/ test failures on Mac wk2
     6
     7        Reverted changeset:
     8
     9        "Throttling requestAnimationFrame should be controlled by
     10        RenderingUpdateScheduler"
     11        https://bugs.webkit.org/show_bug.cgi?id=204713
     12        https://trac.webkit.org/changeset/253299
     13
    1142019-12-09  Wenson Hsieh  <wenson_hsieh@apple.com>
    215
  • trunk/Source/WebCore/Headers.cmake

    r253299 r253308  
    10121012
    10131013    platform/graphics/ANGLEWebKitBridge.h
    1014     platform/graphics/AnimationFrameRate.h
    10151014    platform/graphics/AudioTrackPrivate.h
    10161015    platform/graphics/BitmapImage.h
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r253299 r253308  
    21212121                72144334223EC91600F12FF7 /* SVGPropertyOwner.h in Headers */ = {isa = PBXBuildFile; fileRef = 55EE5360223B2A2100FBA944 /* SVGPropertyOwner.h */; settings = {ATTRIBUTES = (Private, ); }; };
    21222122                72283F0E230B268C00F5D828 /* ImagePaintingOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 72C18A3F230B04B7006847C7 /* ImagePaintingOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
    2123                 722A815D238FDAF000C00583 /* AnimationFrameRate.h in Headers */ = {isa = PBXBuildFile; fileRef = 722A815C238FD50500C00583 /* AnimationFrameRate.h */; settings = {ATTRIBUTES = (Private, ); }; };
    21242123                724ED3321A3A8B2300F5F13C /* JSEXTBlendMinMax.h in Headers */ = {isa = PBXBuildFile; fileRef = 724ED3301A3A8B2300F5F13C /* JSEXTBlendMinMax.h */; };
    21252124                724EE5501DC80D7F00A91FFB /* ActivityState.h in Headers */ = {isa = PBXBuildFile; fileRef = 724EE54E1DC7F25B00A91FFB /* ActivityState.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    95659564                721443452240C8BA00F12FF7 /* SVGAnimatedValueProperty.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedValueProperty.h; sourceTree = "<group>"; };
    95669565                721443462240CAD200F12FF7 /* SVGValueProperty.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGValueProperty.h; sourceTree = "<group>"; };
    9567                 722A815C238FD50500C00583 /* AnimationFrameRate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AnimationFrameRate.h; sourceTree = "<group>"; };
    95689566                724ED3291A3A7E5400F5F13C /* EXTBlendMinMax.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EXTBlendMinMax.cpp; sourceTree = "<group>"; };
    95699567                724ED32A1A3A7E5400F5F13C /* EXTBlendMinMax.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EXTBlendMinMax.h; sourceTree = "<group>"; };
     
    1675016748                                E4FB4B35239BEB10003C336A /* DisplayInlineContent.cpp */,
    1675116749                                E451C6332394058E00993190 /* DisplayInlineContent.h */,
    16752                                 112FB350239C23C40087054A /* DisplayInlineRect.h */,
    1675316750                                6FB47E612277425A00C7BCB0 /* DisplayLineBox.h */,
    1675416751                                6F77868523491AC6004D9636 /* DisplayPainter.cpp */,
    1675516752                                6F77868723491AD7004D9636 /* DisplayPainter.h */,
    1675616753                                6FD9CD52227E21C800E53957 /* DisplayRect.h */,
     16754                                112FB350239C23C40087054A /* DisplayInlineRect.h */,
    1675716755                                6FCE1A1822618AB3004F0343 /* DisplayRun.h */,
    1675816756                        );
     
    2491624914                                490707E41219C04300D90E51 /* ANGLEWebKitBridge.cpp */,
    2491724915                                490707E51219C04300D90E51 /* ANGLEWebKitBridge.h */,
    24918                                 722A815C238FD50500C00583 /* AnimationFrameRate.h */,
    2491924916                                BEF29EE91715DD0900C4B4C9 /* AudioTrackPrivate.h */,
    2492024917                                A89943270B42338700D7C802 /* BitmapImage.cpp */,
     
    2893328930                                71E2C42621C935280024F8C8 /* AnimationEffectPhase.h in Headers */,
    2893428931                                319848011A1D817B00A13318 /* AnimationEvent.h in Headers */,
    28935                                 722A815D238FDAF000C00583 /* AnimationFrameRate.h in Headers */,
    2893628932                                49E912AD0EFAC906009D0CAF /* AnimationList.h in Headers */,
    2893728933                                714C7C661FDAD2A100F2BEE1 /* AnimationPlaybackEvent.h in Headers */,
     
    2961129607                                1199FA5B208E3C7F002358CC /* DisplayBox.h in Headers */,
    2961229608                                E451C6342394058F00993190 /* DisplayInlineContent.h in Headers */,
    29613                                 112FB352239C23C40087054A /* DisplayInlineRect.h in Headers */,
    29614                                 6FB47E632277425A00C7BCB0 /* DisplayLineBox.h in Headers */,
    2961529609                                0FE5FBD31C3DD51E0007A2CA /* DisplayList.h in Headers */,
    2961629610                                0FE5FBD51C3DD51E0007A2CA /* DisplayListItems.h in Headers */,
     
    3027230266                                6FE7CFA22177EEF2005B1573 /* InlineItem.h in Headers */,
    3027330267                                BCE789161120D6080060ECE5 /* InlineIterator.h in Headers */,
     30268                                6FB47E632277425A00C7BCB0 /* DisplayLineBox.h in Headers */,
    3027430269                                6FE198172178397C00446F08 /* InlineLineBreaker.h in Headers */,
    3027530270                                6F0CD695229ED32700C5994E /* InlineLineBuilder.h in Headers */,
     
    3193331928                                436708C112D9CA4B00044234 /* RenderSVGBlock.h in Headers */,
    3193431929                                436708C312D9CA4B00044234 /* RenderSVGContainer.h in Headers */,
     31930                                112FB352239C23C40087054A /* DisplayInlineRect.h in Headers */,
    3193531931                                2B365C841525119E0091D27B /* RenderSVGEllipse.h in Headers */,
    3193631932                                43C092BC12D9E4EE00A989C3 /* RenderSVGForeignObject.h in Headers */,
  • trunk/Source/WebCore/animation/DocumentTimeline.cpp

    r253299 r253308  
    4545#include <JavaScriptCore/VM.h>
    4646
     47static const Seconds defaultAnimationInterval { 15_ms };
     48static const Seconds throttledAnimationInterval { 30_ms };
     49
    4750namespace WebCore {
    4851
     
    191194}
    192195
     196void DocumentTimeline::updateThrottlingState()
     197{
     198    scheduleAnimationResolution();
     199}
     200
    193201Seconds DocumentTimeline::animationInterval() const
    194202{
    195203    if (!m_document || !m_document->page())
    196204        return Seconds::infinity();
    197     return m_document->page()->preferredRenderingUpdateInterval();
     205    return m_document->page()->isLowPowerModeEnabled() ? throttledAnimationInterval : defaultAnimationInterval;
    198206}
    199207
  • trunk/Source/WebCore/animation/DocumentTimeline.h

    r253299 r253308  
    7474    void updateAnimationsAndSendEvents(DOMHighResTimeStamp timestamp);
    7575
     76    void updateThrottlingState();
    7677    WEBCORE_EXPORT Seconds animationInterval() const;
    7778    WEBCORE_EXPORT void suspendAnimations();
  • trunk/Source/WebCore/dom/Document.cpp

    r253300 r253308  
    64966496            m_scriptedAnimationController->suspend();
    64976497
     6498        if (page() && page()->isLowPowerModeEnabled())
     6499            m_scriptedAnimationController->addThrottlingReason(ScriptedAnimationController::ThrottlingReason::LowPowerMode);
     6500
    64986501        if (!topOrigin().canAccess(securityOrigin()) && !hasHadUserInteraction())
    6499             m_scriptedAnimationController->addThrottlingReason(ThrottlingReason::NonInteractedCrossOriginFrame);
     6502            m_scriptedAnimationController->addThrottlingReason(ScriptedAnimationController::ThrottlingReason::NonInteractedCrossOriginFrame);
    65006503    }
    65016504
     
    67366739    if (static_cast<bool>(time) && m_scriptedAnimationController) {
    67376740        // It's OK to always remove NonInteractedCrossOriginFrame even if this frame isn't cross-origin.
    6738         m_scriptedAnimationController->removeThrottlingReason(ThrottlingReason::NonInteractedCrossOriginFrame);
     6741        m_scriptedAnimationController->removeThrottlingReason(ScriptedAnimationController::ThrottlingReason::NonInteractedCrossOriginFrame);
    67396742    }
    67406743
  • trunk/Source/WebCore/dom/ScriptedAnimationController.cpp

    r253299 r253308  
    11/*
    22 * Copyright (C) 2011 Google Inc. All Rights Reserved.
    3  * Copyright (C) 2019 Apple Inc.  All rights reserved.
    43 *
    54 * Redistribution and use in source and binary forms, with or without
     
    2827#include "ScriptedAnimationController.h"
    2928
     29#include "Chrome.h"
     30#include "ChromeClient.h"
     31#include "CustomHeaderFields.h"
     32#include "DOMWindow.h"
     33#include "Document.h"
     34#include "DocumentLoader.h"
     35#include "Frame.h"
     36#include "FrameView.h"
    3037#include "InspectorInstrumentation.h"
     38#include "Logging.h"
    3139#include "Page.h"
    3240#include "RequestAnimationFrameCallback.h"
    3341#include "Settings.h"
     42#include <algorithm>
     43#include <wtf/Ref.h>
    3444#include <wtf/SystemTracing.h>
     45#include <wtf/text/StringBuilder.h>
     46
     47// Allow a little more than 60fps to make sure we can at least hit that frame rate.
     48static const Seconds fullSpeedAnimationInterval { 15_ms };
     49// Allow a little more than 30fps to make sure we can at least hit that frame rate.
     50static const Seconds halfSpeedThrottlingAnimationInterval { 30_ms };
     51static const Seconds aggressiveThrottlingAnimationInterval { 10_s };
     52
     53#define RELEASE_LOG_IF_ALLOWED(fmt, ...) RELEASE_LOG_IF(page() && page()->isAlwaysOnLoggingAllowed(), PerformanceLogging, "%p - ScriptedAnimationController::" fmt, this, ##__VA_ARGS__)
    3554
    3655namespace WebCore {
     
    3857ScriptedAnimationController::ScriptedAnimationController(Document& document)
    3958    : m_document(makeWeakPtr(document))
     59    , m_animationTimer(*this, &ScriptedAnimationController::animationTimerFired)
    4060{
    4161}
     
    4666{
    4767    return m_document && m_document->settings().requestAnimationFrameEnabled();
    48 }
    49 
    50 Page* ScriptedAnimationController::page() const
    51 {
    52     return m_document ? m_document->page() : nullptr;
    53 }
    54 
    55 Seconds ScriptedAnimationController::interval() const
    56 {
    57     if (auto* page = this->page())
    58         return std::max(preferredFrameInterval(m_throttlingReasons), page->preferredRenderingUpdateInterval());
    59     return preferredFrameInterval(m_throttlingReasons);
    6068}
    6169
     
    7684}
    7785
     86#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) && !RELEASE_LOG_DISABLED
     87
     88static const char* throttlingReasonToString(ScriptedAnimationController::ThrottlingReason reason)
     89{
     90    switch (reason) {
     91    case ScriptedAnimationController::ThrottlingReason::VisuallyIdle:
     92        return "VisuallyIdle";
     93    case ScriptedAnimationController::ThrottlingReason::OutsideViewport:
     94        return "OutsideViewport";
     95    case ScriptedAnimationController::ThrottlingReason::LowPowerMode:
     96        return "LowPowerMode";
     97    case ScriptedAnimationController::ThrottlingReason::NonInteractedCrossOriginFrame:
     98        return "NonInteractiveCrossOriginFrame";
     99    }
     100}
     101
     102static String throttlingReasonsToString(OptionSet<ScriptedAnimationController::ThrottlingReason> reasons)
     103{
     104    if (reasons.isEmpty())
     105        return "[Unthrottled]"_s;
     106
     107    StringBuilder builder;
     108    for (auto reason : reasons) {
     109        if (!builder.isEmpty())
     110            builder.append('|');
     111        builder.append(throttlingReasonToString(reason));
     112    }
     113    return builder.toString();
     114}
     115
     116#endif
     117
     118void ScriptedAnimationController::addThrottlingReason(ThrottlingReason reason)
     119{
     120#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
     121    if (m_throttlingReasons.contains(reason))
     122        return;
     123
     124    m_throttlingReasons.add(reason);
     125
     126    RELEASE_LOG_IF_ALLOWED("addThrottlingReason(%s) -> %s", throttlingReasonToString(reason), throttlingReasonsToString(m_throttlingReasons).utf8().data());
     127
     128    if (m_animationTimer.isActive()) {
     129        m_animationTimer.stop();
     130        scheduleAnimation();
     131    }
     132#else
     133    UNUSED_PARAM(reason);
     134#endif
     135}
     136
     137void ScriptedAnimationController::removeThrottlingReason(ThrottlingReason reason)
     138{
     139#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
     140    if (!m_throttlingReasons.contains(reason))
     141        return;
     142
     143    m_throttlingReasons.remove(reason);
     144
     145    RELEASE_LOG_IF_ALLOWED("removeThrottlingReason(%s) -> %s", throttlingReasonToString(reason), throttlingReasonsToString(m_throttlingReasons).utf8().data());
     146
     147    if (m_animationTimer.isActive()) {
     148        m_animationTimer.stop();
     149        scheduleAnimation();
     150    }
     151#else
     152    UNUSED_PARAM(reason);
     153#endif
     154}
     155
    78156bool ScriptedAnimationController::isThrottled() const
    79157{
    80     auto* page = this->page();
    81     if (!m_throttlingReasons.isEmpty() || (page && page->isRenderingUpdateThrottled())) {
    82         ASSERT(interval() > FullSpeedAnimationInterval);
    83         return true;
    84     }
     158#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
     159    return !m_throttlingReasons.isEmpty();
     160#else
    85161    return false;
     162#endif
    86163}
    87164
    88165ScriptedAnimationController::CallbackId ScriptedAnimationController::registerCallback(Ref<RequestAnimationFrameCallback>&& callback)
    89166{
    90     CallbackId callbackId = ++m_nextCallbackId;
     167    ScriptedAnimationController::CallbackId id = ++m_nextCallbackId;
    91168    callback->m_firedOrCancelled = false;
    92     callback->m_id = callbackId;
     169    callback->m_id = id;
    93170    m_callbacks.append(WTFMove(callback));
    94171
    95172    if (m_document)
    96         InspectorInstrumentation::didRequestAnimationFrame(*m_document, callbackId);
     173        InspectorInstrumentation::didRequestAnimationFrame(*m_document, id);
    97174
    98175    if (!m_suspendCount)
    99176        scheduleAnimation();
    100     return callbackId;
    101 }
    102 
    103 void ScriptedAnimationController::cancelCallback(CallbackId callbackId)
    104 {
    105     bool cancelled = m_callbacks.removeFirstMatching([&](auto& callback) {
    106         if (callback->m_id != callbackId)
    107             return false;
    108         callback->m_firedOrCancelled = true;
    109         return true;
    110     });
    111 
    112     if (cancelled && m_document)
    113         InspectorInstrumentation::didCancelAnimationFrame(*m_document, callbackId);
     177    return id;
     178}
     179
     180void ScriptedAnimationController::cancelCallback(CallbackId id)
     181{
     182    for (size_t i = 0; i < m_callbacks.size(); ++i) {
     183        if (m_callbacks[i]->m_id == id) {
     184            m_callbacks[i]->m_firedOrCancelled = true;
     185            InspectorInstrumentation::didCancelAnimationFrame(*m_document, id);
     186            m_callbacks.remove(i);
     187            return;
     188        }
     189    }
    114190}
    115191
     
    119195        return;
    120196
    121     bool isThrottlingRelativeToPage = page() && page()->preferredRenderingUpdateInterval() < preferredFrameInterval(m_throttlingReasons);
    122     bool canSkipFrame = Seconds(timestamp - m_lastAnimationFrameTimestamp) < preferredFrameInterval(m_throttlingReasons);
    123     if (isThrottlingRelativeToPage && canSkipFrame) {
    124         scheduleAnimation();
    125         return;
    126     }
    127    
    128197    TraceScope tracingScope(RAFCallbackStart, RAFCallbackEnd);
    129198
     
    155224    });
    156225
    157     m_lastAnimationFrameTimestamp = timestamp;
    158 
    159226    if (m_callbacks.size())
    160227        scheduleAnimation();
    161228}
    162229
     230Seconds ScriptedAnimationController::interval() const
     231{
     232#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
     233    if (m_throttlingReasons.contains(ThrottlingReason::VisuallyIdle) || m_throttlingReasons.contains(ThrottlingReason::OutsideViewport))
     234        return aggressiveThrottlingAnimationInterval;
     235
     236    if (m_throttlingReasons.contains(ThrottlingReason::LowPowerMode))
     237        return halfSpeedThrottlingAnimationInterval;
     238
     239    if (m_throttlingReasons.contains(ThrottlingReason::NonInteractedCrossOriginFrame))
     240        return halfSpeedThrottlingAnimationInterval;
     241
     242    ASSERT(m_throttlingReasons.isEmpty());
     243#endif
     244    return fullSpeedAnimationInterval;
     245}
     246
     247Page* ScriptedAnimationController::page() const
     248{
     249    return m_document ? m_document->page() : nullptr;
     250}
     251
    163252void ScriptedAnimationController::scheduleAnimation()
    164253{
     
    166255        return;
    167256
    168     if (auto* page = this->page())
    169         page->renderingUpdateScheduler().scheduleTimedRenderingUpdate();
    170 }
    171 
    172 }
     257#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
     258    if (!m_isUsingTimer && !isThrottled()) {
     259        if (auto* page = this->page()) {
     260            page->renderingUpdateScheduler().scheduleTimedRenderingUpdate();
     261            return;
     262        }
     263
     264        m_isUsingTimer = true;
     265    }
     266#endif
     267    if (m_animationTimer.isActive())
     268        return;
     269
     270    Seconds animationInterval = interval();
     271    Seconds scheduleDelay = std::max(animationInterval - Seconds(m_document->domWindow()->nowTimestamp() - m_lastAnimationFrameTimestamp), 0_s);
     272
     273    if (isThrottled()) {
     274        // FIXME: not ideal to snapshot time both in now() and nowTimestamp(), the latter of which also has reduced resolution.
     275        MonotonicTime now = MonotonicTime::now();
     276
     277        MonotonicTime fireTime = now + scheduleDelay;
     278        Seconds alignmentInterval = 10_ms;
     279        // Snap to the nearest alignmentInterval.
     280        Seconds alignment = (fireTime + alignmentInterval / 2) % alignmentInterval;
     281        MonotonicTime alignedFireTime = fireTime - alignment;
     282        scheduleDelay = alignedFireTime - now;
     283    }
     284
     285    m_animationTimer.startOneShot(scheduleDelay);
     286}
     287
     288void ScriptedAnimationController::animationTimerFired()
     289{
     290    m_lastAnimationFrameTimestamp = m_document->domWindow()->nowTimestamp();
     291    serviceRequestAnimationFrameCallbacks(m_lastAnimationFrameTimestamp);
     292}
     293
     294}
  • trunk/Source/WebCore/dom/ScriptedAnimationController.h

    r253299 r253308  
    11/*
    22 * Copyright (C) 2011 Google Inc. All Rights Reserved.
    3  * Copyright (C) 2019 Apple Inc.  All rights reserved.
    43 *
    54 * Redistribution and use in source and binary forms, with or without
     
    2726#pragma once
    2827
    29 #include "AnimationFrameRate.h"
    3028#include "DOMHighResTimeStamp.h"
     29#include "Timer.h"
    3130#include <wtf/OptionSet.h>
    3231#include <wtf/RefCounted.h>
    3332#include <wtf/RefPtr.h>
    3433#include <wtf/Vector.h>
    35 #include <wtf/WeakPtr.h>
    3634
    3735namespace WebCore {
     
    5149    void clearDocumentPointer() { m_document = nullptr; }
    5250    bool requestAnimationFrameEnabled() const;
    53     WEBCORE_EXPORT Seconds interval() const;
    5451
    5552    typedef int CallbackId;
     
    6158    void suspend();
    6259    void resume();
    63    
    64     void addThrottlingReason(ThrottlingReason reason) { m_throttlingReasons.add(reason); }
    65     void removeThrottlingReason(ThrottlingReason reason) { m_throttlingReasons.remove(reason); }
     60
     61    enum class ThrottlingReason {
     62        VisuallyIdle                    = 1 << 0,
     63        OutsideViewport                 = 1 << 1,
     64        LowPowerMode                    = 1 << 2,
     65        NonInteractedCrossOriginFrame   = 1 << 3,
     66    };
     67    void addThrottlingReason(ThrottlingReason);
     68    void removeThrottlingReason(ThrottlingReason);
     69
    6670    WEBCORE_EXPORT bool isThrottled() const;
     71    WEBCORE_EXPORT Seconds interval() const;
    6772
    6873private:
    6974    ScriptedAnimationController(Document&);
    7075
     76    void scheduleAnimation();
     77    void animationTimerFired();
     78
    7179    Page* page() const;
    72     void scheduleAnimation();
    7380
    74     using CallbackList = Vector<RefPtr<RequestAnimationFrameCallback>>;
     81    typedef Vector<RefPtr<RequestAnimationFrameCallback>> CallbackList;
    7582    CallbackList m_callbacks;
    76     DOMHighResTimeStamp m_lastAnimationFrameTimestamp { 0 };
    7783
    7884    WeakPtr<Document> m_document;
     
    8086    int m_suspendCount { 0 };
    8187
     88    Timer m_animationTimer;
     89    double m_lastAnimationFrameTimestamp { 0 };
     90
     91#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
    8292    OptionSet<ThrottlingReason> m_throttlingReasons;
     93    bool m_isUsingTimer { false };
     94#endif
    8395};
    8496
  • trunk/Source/WebCore/page/FrameView.cpp

    r253299 r253308  
    25252525    if (auto* scriptedAnimationController = document->scriptedAnimationController()) {
    25262526        if (shouldThrottle)
    2527             scriptedAnimationController->addThrottlingReason(ThrottlingReason::OutsideViewport);
     2527            scriptedAnimationController->addThrottlingReason(ScriptedAnimationController::ThrottlingReason::OutsideViewport);
    25282528        else
    2529             scriptedAnimationController->removeThrottlingReason(ThrottlingReason::OutsideViewport);
     2529            scriptedAnimationController->removeThrottlingReason(ScriptedAnimationController::ThrottlingReason::OutsideViewport);
    25302530    }
    25312531
  • trunk/Source/WebCore/page/Page.cpp

    r253299 r253308  
    2323#include "ActivityStateChangeObserver.h"
    2424#include "AlternativeTextClient.h"
    25 #include "AnimationFrameRate.h"
    2625#include "ApplicationCacheStorage.h"
    2726#include "ApplicationStateChangeListener.h"
     
    13711370{
    13721371    m_scriptedAnimationsSuspended = true;
    1373     forEachDocument([&] (Document& document) {
    1374         document.suspendScriptedAnimationControllerCallbacks();
    1375     });
     1372    for (Frame* frame = &mainFrame(); frame; frame = frame->tree().traverseNext()) {
     1373        if (frame->document())
     1374            frame->document()->suspendScriptedAnimationControllerCallbacks();
     1375    }
    13761376}
    13771377
     
    13791379{
    13801380    m_scriptedAnimationsSuspended = false;
    1381     forEachDocument([&] (Document& document) {
    1382         document.resumeScriptedAnimationControllerCallbacks();
    1383     });
    1384 }
    1385 
    1386 Seconds Page::preferredRenderingUpdateInterval() const
    1387 {
    1388     return preferredFrameInterval(m_throttlingReasons);
     1381    for (Frame* frame = &mainFrame(); frame; frame = frame->tree().traverseNext()) {
     1382        if (frame->document())
     1383            frame->document()->resumeScriptedAnimationControllerCallbacks();
     1384    }
     1385}
     1386
     1387enum class ThrottlingReasonOperation { Add, Remove };
     1388static void updateScriptedAnimationsThrottlingReason(Page& page, ThrottlingReasonOperation operation, ScriptedAnimationController::ThrottlingReason reason)
     1389{
     1390    for (Frame* frame = &page.mainFrame(); frame; frame = frame->tree().traverseNext()) {
     1391        auto* document = frame->document();
     1392        if (!document)
     1393            continue;
     1394        auto* scriptedAnimationController = document->scriptedAnimationController();
     1395        if (!scriptedAnimationController)
     1396            continue;
     1397
     1398        if (operation == ThrottlingReasonOperation::Add)
     1399            scriptedAnimationController->addThrottlingReason(reason);
     1400        else
     1401            scriptedAnimationController->removeThrottlingReason(reason);
     1402    }
    13891403}
    13901404
    13911405void Page::setIsVisuallyIdleInternal(bool isVisuallyIdle)
    13921406{
    1393     if (isVisuallyIdle == m_throttlingReasons.contains(ThrottlingReason::VisuallyIdle))
    1394         return;
    1395 
    1396     m_throttlingReasons = m_throttlingReasons ^ ThrottlingReason::VisuallyIdle;
    1397     renderingUpdateScheduler().adjustRenderingUpdateFrequency();
     1407    updateScriptedAnimationsThrottlingReason(*this, isVisuallyIdle ? ThrottlingReasonOperation::Add : ThrottlingReasonOperation::Remove, ScriptedAnimationController::ThrottlingReason::VisuallyIdle);
    13981408}
    13991409
    14001410void Page::handleLowModePowerChange(bool isLowPowerModeEnabled)
    14011411{
    1402     if (isLowPowerModeEnabled == m_throttlingReasons.contains(ThrottlingReason::LowPowerMode))
    1403         return;
    1404 
    1405     m_throttlingReasons = m_throttlingReasons ^ ThrottlingReason::LowPowerMode;
    1406     renderingUpdateScheduler().adjustRenderingUpdateFrequency();
    1407 
    1408     if (!RuntimeEnabledFeatures::sharedFeatures().webAnimationsCSSIntegrationEnabled())
     1412    updateScriptedAnimationsThrottlingReason(*this, isLowPowerModeEnabled ? ThrottlingReasonOperation::Add : ThrottlingReasonOperation::Remove, ScriptedAnimationController::ThrottlingReason::LowPowerMode);
     1413    if (RuntimeEnabledFeatures::sharedFeatures().webAnimationsCSSIntegrationEnabled()) {
     1414        forEachDocument([&] (Document& document) {
     1415            if (auto timeline = document.existingTimeline())
     1416                timeline->updateThrottlingState();
     1417        });
     1418    } else
    14091419        mainFrame().animation().updateThrottlingState();
    1410 
    14111420    updateDOMTimerAlignmentInterval();
    14121421}
  • trunk/Source/WebCore/page/Page.h

    r253299 r253308  
    2222
    2323#include "ActivityState.h"
    24 #include "AnimationFrameRate.h"
    2524#include "DisabledAdaptations.h"
    2625#include "Document.h"
     
    275274
    276275    RenderingUpdateScheduler& renderingUpdateScheduler();
    277     bool isRenderingUpdateThrottled() const { return !m_throttlingReasons.isEmpty(); }
    278276
    279277    ValidationMessageClient* validationMessageClient() const { return m_validationMessageClient.get(); }
     
    716714    WEBCORE_EXPORT void setLowPowerModeEnabledOverrideForTesting(Optional<bool>);
    717715
    718     Seconds preferredRenderingUpdateInterval() const;
    719 
    720716    WEBCORE_EXPORT void applicationWillResignActive();
    721717    WEBCORE_EXPORT void applicationDidEnterBackground();
     
    10131009    bool m_mediaBufferingIsSuspended { false };
    10141010    bool m_inUpdateRendering { false };
    1015     OptionSet<ThrottlingReason> m_throttlingReasons;
    10161011};
    10171012
  • trunk/Source/WebCore/page/RenderingUpdateScheduler.cpp

    r253299 r253308  
    4343}
    4444
    45 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) && PLATFORM(IOS_FAMILY)
    46 void RenderingUpdateScheduler::adjustFramesPerSecond()
    47 {
    48     Seconds interval = m_page.preferredRenderingUpdateInterval();
    49     // CADisplayLink.preferredFramesPerSecond is an integer. So a fraction PreferredFramesPerSecond can't be set.
    50     if (interval < 1_s)
    51         DisplayRefreshMonitorManager::sharedManager().setPreferredFramesPerSecond(*this, preferredFramesPerSecond(interval));
    52 }
    53 #endif
    54 
    55 void RenderingUpdateScheduler::adjustRenderingUpdateFrequency()
    56 {
    57 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) && PLATFORM(IOS_FAMILY)
    58     adjustFramesPerSecond();
    59 #endif
    60     if (isScheduled()) {
    61         clearScheduled();
    62         scheduleTimedRenderingUpdate();
    63     }
    64 }
    65 
    6645void RenderingUpdateScheduler::scheduleTimedRenderingUpdate()
    6746{
     
    7756    tracePoint(ScheduleRenderingUpdate);
    7857
    79     Seconds interval = m_page.preferredRenderingUpdateInterval();
     58#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
     59    if (!DisplayRefreshMonitorManager::sharedManager().scheduleAnimation(*this))
     60#endif
     61        startTimer(Seconds(1.0 / 60));
    8062
    81 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
    82     // CADisplayLink.preferredFramesPerSecond is an integer. Fall back to timer if the PreferredFramesPerSecond is a fraction.
    83     if (interval < 1_s) {
    84 #if PLATFORM(IOS_FAMILY)
    85         if (!m_isMonitorCreated) {
    86             adjustFramesPerSecond();
    87             m_isMonitorCreated = true;
    88         }
    89 #else
    90         if (interval == FullSpeedAnimationInterval)
    91 #endif
    92             m_scheduled = DisplayRefreshMonitorManager::sharedManager().scheduleAnimation(*this);
    93     }
    94 #endif
    95 
    96     if (!isScheduled())
    97         startTimer(interval);
     63    m_scheduled = true;
    9864}
    9965
     
    10975    m_refreshTimer = makeUnique<Timer>(*this, &RenderingUpdateScheduler::displayRefreshFired);
    11076    m_refreshTimer->startOneShot(delay);
    111     m_scheduled = true;
    11277}
    11378
  • trunk/Source/WebCore/page/RenderingUpdateScheduler.h

    r253299 r253308  
    4747
    4848    RenderingUpdateScheduler(Page&);
    49 
    50     void adjustRenderingUpdateFrequency();
    5149    void scheduleTimedRenderingUpdate();
    5250    void scheduleImmediateRenderingUpdate();
     
    5553private:
    5654#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
    57 #if PLATFORM(IOS_FAMILY)
    58     void adjustFramesPerSecond();
    59 #endif
    6055    RefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const final;
    6156    void windowScreenDidChange(PlatformDisplayID);
     
    7065
    7166    Page& m_page;
    72 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) && PLATFORM(IOS_FAMILY)
    73     bool m_isMonitorCreated;
    74 #endif
    7567    bool m_scheduled { false };
    7668    std::unique_ptr<Timer> m_refreshTimer;
  • trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.h

    r253299 r253308  
    2828#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
    2929
    30 #include "AnimationFrameRate.h"
    3130#include "PlatformScreen.h"
    3231#include <wtf/HashSet.h>
     
    4645
    4746    virtual void displayLinkFired() { }
    48 
    49     virtual void setPreferredFramesPerSecond(FramesPerSecond) { }
    5047
    5148    // Return true if callback request was scheduled, false if it couldn't be
  • trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.cpp

    r253299 r253308  
    4343}
    4444
    45 DisplayRefreshMonitor* DisplayRefreshMonitorManager::monitorForClient(DisplayRefreshMonitorClient& client)
     45DisplayRefreshMonitor* DisplayRefreshMonitorManager::createMonitorForClient(DisplayRefreshMonitorClient& client)
    4646{
    47     if (!client.hasDisplayID())
    48         return nullptr;
    49 
    5047    PlatformDisplayID clientDisplayID = client.displayID();
    5148    if (auto* existingMonitor = monitorForDisplayID(clientDisplayID)) {
     
    5855        return nullptr;
    5956
    60     LOG(RequestAnimationFrame, "DisplayRefreshMonitorManager::monitorForClient() - created monitor %p", monitor.get());
     57    LOG(RequestAnimationFrame, "DisplayRefreshMonitorManager::createMonitorForClient() - created monitor %p", monitor.get());
    6158    monitor->addClient(client);
    6259    DisplayRefreshMonitor* result = monitor.get();
    6360    m_monitors.append({ WTFMove(monitor) });
    6461    return result;
     62}
     63
     64void DisplayRefreshMonitorManager::registerClient(DisplayRefreshMonitorClient& client)
     65{
     66    if (!client.hasDisplayID())
     67        return;
     68
     69    createMonitorForClient(client);
    6570}
    6671
     
    8186}
    8287
    83 void DisplayRefreshMonitorManager::setPreferredFramesPerSecond(DisplayRefreshMonitorClient& client, FramesPerSecond preferredFramesPerSecond)
    84 {
    85     if (auto* monitor = monitorForClient(client))
    86         monitor->setPreferredFramesPerSecond(preferredFramesPerSecond);
    87 }
    88 
    8988bool DisplayRefreshMonitorManager::scheduleAnimation(DisplayRefreshMonitorClient& client)
    9089{
    91     if (auto* monitor = monitorForClient(client)) {
    92         client.setIsScheduled(true);
    93         return monitor->requestRefreshCallback();
    94     }
    95     return false;
     90    if (!client.hasDisplayID())
     91        return false;
     92
     93    DisplayRefreshMonitor* monitor = createMonitorForClient(client);
     94    if (!monitor)
     95        return false;
     96
     97    client.setIsScheduled(true);
     98    return monitor->requestRefreshCallback();
    9699}
    97100
     
    114117    unregisterClient(client);
    115118    client.setDisplayID(displayID);
     119    registerClient(client);
    116120    if (client.isScheduled())
    117121        scheduleAnimation(client);
  • trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.h

    r253299 r253308  
    2828#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
    2929
    30 #include "AnimationFrameRate.h"
    3130#include "DisplayRefreshMonitor.h"
    3231#include "PlatformScreen.h"
     
    3938class DisplayRefreshMonitorManager {
    4039    friend class NeverDestroyed<DisplayRefreshMonitorManager>;
    41     friend class DisplayRefreshMonitor;
    4240public:
    4341    WEBCORE_EXPORT static DisplayRefreshMonitorManager& sharedManager();
    44 
     42   
     43    void registerClient(DisplayRefreshMonitorClient&);
    4544    void unregisterClient(DisplayRefreshMonitorClient&);
    4645
    47     void setPreferredFramesPerSecond(DisplayRefreshMonitorClient&, FramesPerSecond);
    4846    bool scheduleAnimation(DisplayRefreshMonitorClient&);
    4947    void windowScreenDidChange(PlatformDisplayID, DisplayRefreshMonitorClient&);
    5048
    5149    WEBCORE_EXPORT void displayWasUpdated(PlatformDisplayID);
    52 
     50   
    5351private:
    54     DisplayRefreshMonitorManager() = default;
     52    friend class DisplayRefreshMonitor;
     53    void displayDidRefresh(DisplayRefreshMonitor&);
     54   
     55    DisplayRefreshMonitorManager() { }
    5556    virtual ~DisplayRefreshMonitorManager();
    56 
    57     void displayDidRefresh(DisplayRefreshMonitor&);
    5857
    5958    size_t findMonitorForDisplayID(PlatformDisplayID) const;
    6059    DisplayRefreshMonitor* monitorForDisplayID(PlatformDisplayID) const;
    61     DisplayRefreshMonitor* monitorForClient(DisplayRefreshMonitorClient&);
     60
     61    DisplayRefreshMonitor* createMonitorForClient(DisplayRefreshMonitorClient&);
    6262
    6363    struct DisplayRefreshMonitorWrapper {
  • trunk/Source/WebCore/platform/graphics/GraphicsLayerUpdater.cpp

    r253299 r253308  
    3636    : m_client(client)
    3737{
     38    DisplayRefreshMonitorManager::sharedManager().registerClient(*this);
    3839    DisplayRefreshMonitorManager::sharedManager().windowScreenDidChange(displayID, *this);
    3940    DisplayRefreshMonitorManager::sharedManager().scheduleAnimation(*this);
  • trunk/Source/WebCore/platform/graphics/ios/DisplayRefreshMonitorIOS.mm

    r253299 r253308  
    4141
    4242- (id)initWithMonitor:(DisplayRefreshMonitorIOS*)monitor;
    43 - (void)setPreferredFramesPerSecond:(NSInteger)preferredFramesPerSecond;
    4443- (void)handleDisplayLink:(CADisplayLink *)sender;
    4544- (void)invalidate;
     
    6564    ASSERT(!m_displayLink); // -invalidate should have been called already.
    6665    [super dealloc];
    67 }
    68 
    69 - (void)setPreferredFramesPerSecond:(NSInteger)preferredFramesPerSecond
    70 {
    71     m_displayLink.preferredFramesPerSecond = preferredFramesPerSecond;
    7266}
    7367
  • trunk/Source/WebKit/ChangeLog

    r253304 r253308  
     12019-12-09  Truitt Savell  <tsavell@apple.com>
     2
     3        Unreviewed, rolling out r253299.
     4
     5        Casued 30+ imported/ test failures on Mac wk2
     6
     7        Reverted changeset:
     8
     9        "Throttling requestAnimationFrame should be controlled by
     10        RenderingUpdateScheduler"
     11        https://bugs.webkit.org/show_bug.cgi?id=204713
     12        https://trac.webkit.org/changeset/253299
     13
    1142019-12-09  Chris Dumez  <cdumez@apple.com>
    215
  • trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h

    r253299 r253308  
    2929#include "RemoteLayerTreeHost.h"
    3030#include "TransactionID.h"
    31 #include <WebCore/AnimationFrameRate.h>
    3231#include <WebCore/FloatPoint.h>
    3332#include <WebCore/IntPoint.h>
     
    9998
    10099    // Message handlers
    101     void setPreferredFramesPerSecond(WebCore::FramesPerSecond);
    102100    void willCommitLayerTree(TransactionID);
    103101    void commitLayerTree(const RemoteLayerTreeTransaction&, const RemoteScrollingCoordinatorTransaction&);
  • trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in

    r253299 r253308  
    2222
    2323messages -> RemoteLayerTreeDrawingAreaProxy : DrawingAreaProxy NotRefCounted {
    24     void SetPreferredFramesPerSecond(unsigned preferredFramesPerSecond)
    2524    void WillCommitLayerTree(WebKit::TransactionID transactionID)
    2625    void CommitLayerTree(WebKit::RemoteLayerTreeTransaction layerTreeTransaction, WebKit::RemoteScrollingCoordinatorTransaction scrollingTreeTransaction)
  • trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm

    r253299 r253308  
    5050
    5151- (id)initWithDrawingAreaProxy:(WebKit::RemoteLayerTreeDrawingAreaProxy*)drawingAreaProxy;
    52 - (void)setPreferredFramesPerSecond:(NSInteger)preferredFramesPerSecond;
    5352- (void)displayLinkFired:(CADisplayLink *)sender;
    5453- (void)invalidate;
     
    7877}
    7978
    80 - (void)setPreferredFramesPerSecond:(NSInteger)preferredFramesPerSecond
    81 {
    82     _displayLink.preferredFramesPerSecond = preferredFramesPerSecond;
    83 }
    84 
    8579- (void)displayLinkFired:(CADisplayLink *)sender
    8680{
     
    188182    send(Messages::DrawingArea::UpdateGeometry(m_size, false /* flushSynchronously */, MachSendRight()));
    189183    m_isWaitingForDidUpdateGeometry = true;
    190 }
    191 
    192 void RemoteLayerTreeDrawingAreaProxy::setPreferredFramesPerSecond(FramesPerSecond preferredFramesPerSecond)
    193 {
    194 #if PLATFORM(IOS_FAMILY)
    195     [displayLinkHandler() setPreferredFramesPerSecond:preferredFramesPerSecond];
    196 #else
    197     UNUSED_PARAM(preferredFramesPerSecond);
    198 #endif
    199184}
    200185
  • trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h

    r253299 r253308  
    2929
    3030#include "RemoteLayerTreeDrawingArea.h"
    31 #include <WebCore/AnimationFrameRate.h>
    3231#include <WebCore/DisplayRefreshMonitor.h>
    3332
     
    4342    virtual ~RemoteLayerTreeDisplayRefreshMonitor();
    4443
    45     void setPreferredFramesPerSecond(WebCore::FramesPerSecond) override;
    4644    bool requestRefreshCallback() override;
    4745
  • trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm

    r253299 r253308  
    4444}
    4545
    46 void RemoteLayerTreeDisplayRefreshMonitor::setPreferredFramesPerSecond(FramesPerSecond preferredFramesPerSecond)
    47 {
    48     if (m_drawingArea)
    49         m_drawingArea->setPreferredFramesPerSecond(preferredFramesPerSecond);
    50 }
    51 
    5246bool RemoteLayerTreeDisplayRefreshMonitor::requestRefreshCallback()
    5347{
  • trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h

    r253299 r253308  
    3030#include "GraphicsLayerCARemote.h"
    3131#include "RemoteLayerTreeTransaction.h"
    32 #include <WebCore/AnimationFrameRate.h>
    3332#include <WebCore/GraphicsLayerClient.h>
    3433#include <WebCore/Timer.h>
     
    7574    RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(WebCore::PlatformDisplayID) override;
    7675    void willDestroyDisplayRefreshMonitor(WebCore::DisplayRefreshMonitor*);
    77     void setPreferredFramesPerSecond(WebCore::FramesPerSecond);
    7876
    7977    bool shouldUseTiledBackingForFrameView(const WebCore::FrameView&) override;
  • trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm

    r253299 r253308  
    127127}
    128128
    129 void RemoteLayerTreeDrawingArea::setPreferredFramesPerSecond(FramesPerSecond preferredFramesPerSecond)
    130 {
    131     send(Messages::RemoteLayerTreeDrawingAreaProxy::SetPreferredFramesPerSecond(preferredFramesPerSecond));
    132 }
    133 
    134129void RemoteLayerTreeDrawingArea::updateRootLayers()
    135130{
Note: See TracChangeset for help on using the changeset viewer.