Title: [273773] trunk
Revision
273773
Author
[email protected]
Date
2021-03-02 16:39:40 -0800 (Tue, 02 Mar 2021)

Log Message

Rename ForcePageRenderingUpdatesAt60FPSEnabled preference to PreferPageRenderingUpdatesNear60FPSEnabled
https://bugs.webkit.org/show_bug.cgi?id=222580.

Reviewed by Tim Horton.

Source/WebCore:

The new setting has the inverse sense of the (confusingly named) older one.

Keep the setting off for now to avoid a behavior change.

* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::preferredScriptedAnimationInterval const): Use new Setting name.
* page/Page.cpp:
(WebCore::Page::preferredRenderingUpdateInterval const): If the pref is set, pass in the actual display FPS
so the code uses that in its fps computation (potentially reducing, say, 144fps to 72fps).
* page/RenderingUpdateScheduler.cpp:
(WebCore::RenderingUpdateScheduler::adjustRenderingUpdateFrequency): Renamed preferredFramesPerSecond() to preferredFramesPerSecondFromInterval()
(WebCore::RenderingUpdateScheduler::scheduleRenderingUpdate):
* platform/graphics/AnimationFrameRate.h:
(WebCore::preferredFramesPerSecondFromInterval): Renamed to avoid future name collisions.
(WebCore::preferredFramesPerSecond): Deleted.
* platform/graphics/mac/DisplayRefreshMonitorMac.h:

Source/WTF:

PreferPageRenderingUpdatesNear60FPSEnabled is a better description of what the preference does.

* Scripts/Preferences/WebPreferencesInternal.yaml:

Tools:

* TestWebKitAPI/Tests/WebCore/AnimationFrameRate.cpp:
(TestWebKitAPI::TEST): Function rename.

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (273772 => 273773)


--- trunk/Source/WTF/ChangeLog	2021-03-03 00:38:17 UTC (rev 273772)
+++ trunk/Source/WTF/ChangeLog	2021-03-03 00:39:40 UTC (rev 273773)
@@ -1,3 +1,14 @@
+2021-03-02  Simon Fraser  <[email protected]>
+
+        Rename ForcePageRenderingUpdatesAt60FPSEnabled preference to PreferPageRenderingUpdatesNear60FPSEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=222580.
+
+        Reviewed by Tim Horton.
+
+        PreferPageRenderingUpdatesNear60FPSEnabled is a better description of what the preference does.
+
+        * Scripts/Preferences/WebPreferencesInternal.yaml:
+
 2021-03-02  Youenn Fablet  <[email protected]>
 
         Enable MEDIA_SOURCE in IOS Simulator

Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml (273772 => 273773)


--- trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml	2021-03-03 00:38:17 UTC (rev 273772)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml	2021-03-03 00:39:40 UTC (rev 273773)
@@ -268,18 +268,6 @@
     WebKit:
       default: true
 
-ForcePageRenderingUpdatesAt60FPSEnabled:
-  type: bool
-  humanReadableName: "Force Page Rendering Updates at 60fps"
-  humanReadableDescription: "Force the rate for updates to software Web Animations, requestAnimationFrame() and anything triggering the page rendering steps to 60 frames per second rather than use the display's refresh rate"
-  defaultValue:
-    WebKitLegacy:
-      default: false
-    WebKit:
-      default: false
-    WebCore:
-      default: false
-
 # FIXME: This should be reconciled with 'FrameFlattening' in WebPreferences.yaml .
 FrameFlatteningEnabled:
   type: bool
@@ -598,6 +586,18 @@
       "PLATFORM(IOS_FAMILY) && !PLATFORM(WATCHOS)": true
       default: false
 
+PreferPageRenderingUpdatesNear60FPSEnabled:
+  type: bool
+  humanReadableName: "Prefer Page Rendering Updates near 60fps"
+  humanReadableDescription: "Prefer page rendering updates near 60 frames per second rather than use the display's refresh rate"
+  defaultValue:
+    WebKitLegacy:
+      default: false
+    WebKit:
+      default: false
+    WebCore:
+      default: false
+
 PrefixedWebAudioEnabled:
   type: bool
   humanReadableName: "Prefixed WebAudio API"

Modified: trunk/Source/WebCore/ChangeLog (273772 => 273773)


--- trunk/Source/WebCore/ChangeLog	2021-03-03 00:38:17 UTC (rev 273772)
+++ trunk/Source/WebCore/ChangeLog	2021-03-03 00:39:40 UTC (rev 273773)
@@ -1,3 +1,27 @@
+2021-03-02  Simon Fraser  <[email protected]>
+
+        Rename ForcePageRenderingUpdatesAt60FPSEnabled preference to PreferPageRenderingUpdatesNear60FPSEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=222580.
+
+        Reviewed by Tim Horton.
+
+        The new setting has the inverse sense of the (confusingly named) older one.
+
+        Keep the setting off for now to avoid a behavior change.
+
+        * dom/ScriptedAnimationController.cpp:
+        (WebCore::ScriptedAnimationController::preferredScriptedAnimationInterval const): Use new Setting name.
+        * page/Page.cpp:
+        (WebCore::Page::preferredRenderingUpdateInterval const): If the pref is set, pass in the actual display FPS
+        so the code uses that in its fps computation (potentially reducing, say, 144fps to 72fps).
+        * page/RenderingUpdateScheduler.cpp:
+        (WebCore::RenderingUpdateScheduler::adjustRenderingUpdateFrequency): Renamed preferredFramesPerSecond() to preferredFramesPerSecondFromInterval()
+        (WebCore::RenderingUpdateScheduler::scheduleRenderingUpdate):
+        * platform/graphics/AnimationFrameRate.h:
+        (WebCore::preferredFramesPerSecondFromInterval): Renamed to avoid future name collisions.
+        (WebCore::preferredFramesPerSecond): Deleted.
+        * platform/graphics/mac/DisplayRefreshMonitorMac.h:
+
 2021-03-02  Devin Rousso  <[email protected]>
 
         Allow IDL `Date` to be parsed from a string in addition to a number and actual JS `Date`

Modified: trunk/Source/WebCore/dom/ScriptedAnimationController.cpp (273772 => 273773)


--- trunk/Source/WebCore/dom/ScriptedAnimationController.cpp	2021-03-03 00:38:17 UTC (rev 273772)
+++ trunk/Source/WebCore/dom/ScriptedAnimationController.cpp	2021-03-03 00:39:40 UTC (rev 273773)
@@ -81,7 +81,7 @@
 {
     Optional<FramesPerSecond> preferredFPS;
     if (auto* page = this->page()) {
-        if (!page->settings().forcePageRenderingUpdatesAt60FPSEnabled())
+        if (page->settings().preferPageRenderingUpdatesNear60FPSEnabled())
             preferredFPS = page->displayNominalFramesPerSecond();
     }
     return preferredFrameInterval(m_throttlingReasons, preferredFPS);

Modified: trunk/Source/WebCore/page/Page.cpp (273772 => 273773)


--- trunk/Source/WebCore/page/Page.cpp	2021-03-03 00:38:17 UTC (rev 273772)
+++ trunk/Source/WebCore/page/Page.cpp	2021-03-03 00:39:40 UTC (rev 273773)
@@ -1744,9 +1744,9 @@
 
 Seconds Page::preferredRenderingUpdateInterval() const
 {
-    if (settings().forcePageRenderingUpdatesAt60FPSEnabled())
-        return preferredFrameInterval(m_throttlingReasons, WTF::nullopt);
-    return preferredFrameInterval(m_throttlingReasons, m_displayNominalFramesPerSecond);
+    if (!settings().preferPageRenderingUpdatesNear60FPSEnabled())
+        return preferredFrameInterval(m_throttlingReasons, m_displayNominalFramesPerSecond);
+    return preferredFrameInterval(m_throttlingReasons, WTF::nullopt);
 }
 
 void Page::setIsVisuallyIdleInternal(bool isVisuallyIdle)

Modified: trunk/Source/WebCore/page/RenderingUpdateScheduler.cpp (273772 => 273773)


--- trunk/Source/WebCore/page/RenderingUpdateScheduler.cpp	2021-03-03 00:38:17 UTC (rev 273772)
+++ trunk/Source/WebCore/page/RenderingUpdateScheduler.cpp	2021-03-03 00:39:40 UTC (rev 273773)
@@ -73,7 +73,7 @@
 
     // PreferredFramesPerSecond is an integer and should be > 0.
     if (interval <= 1_s)
-        setPreferredFramesPerSecond(preferredFramesPerSecond(interval));
+        setPreferredFramesPerSecond(preferredFramesPerSecondFromInterval(interval));
 
     if (isScheduled()) {
         clearScheduled();
@@ -100,7 +100,7 @@
 
     // PreferredFramesPerSecond is an integer and should be > 0.
     if (interval <= 1_s)
-        m_scheduled = scheduleAnimation(preferredFramesPerSecond(interval));
+        m_scheduled = scheduleAnimation(preferredFramesPerSecondFromInterval(interval));
 
     if (!isScheduled())
         startTimer(interval);

Modified: trunk/Source/WebCore/platform/graphics/AnimationFrameRate.cpp (273772 => 273773)


--- trunk/Source/WebCore/platform/graphics/AnimationFrameRate.cpp	2021-03-03 00:38:17 UTC (rev 273772)
+++ trunk/Source/WebCore/platform/graphics/AnimationFrameRate.cpp	2021-03-03 00:39:40 UTC (rev 273773)
@@ -62,7 +62,7 @@
     return interval;
 }
 
-FramesPerSecond preferredFramesPerSecond(Seconds preferredFrameInterval)
+FramesPerSecond preferredFramesPerSecondFromInterval(Seconds preferredFrameInterval)
 {
     if (preferredFrameInterval == FullSpeedAnimationInterval)
         return FullSpeedFramesPerSecond;

Modified: trunk/Source/WebCore/platform/graphics/AnimationFrameRate.h (273772 => 273773)


--- trunk/Source/WebCore/platform/graphics/AnimationFrameRate.h	2021-03-03 00:38:17 UTC (rev 273772)
+++ trunk/Source/WebCore/platform/graphics/AnimationFrameRate.h	2021-03-03 00:39:40 UTC (rev 273773)
@@ -52,7 +52,7 @@
 
 WEBCORE_EXPORT FramesPerSecond framesPerSecondNearestFullSpeed(FramesPerSecond);
 WEBCORE_EXPORT Seconds preferredFrameInterval(const OptionSet<ThrottlingReason>&, Optional<FramesPerSecond> nominalFramesPerSecond);
-WEBCORE_EXPORT FramesPerSecond preferredFramesPerSecond(Seconds);
+WEBCORE_EXPORT FramesPerSecond preferredFramesPerSecondFromInterval(Seconds);
 
 WEBCORE_EXPORT TextStream& operator<<(TextStream&, const OptionSet<ThrottlingReason>&);
 

Modified: trunk/Source/WebCore/platform/graphics/mac/DisplayRefreshMonitorMac.h (273772 => 273773)


--- trunk/Source/WebCore/platform/graphics/mac/DisplayRefreshMonitorMac.h	2021-03-03 00:38:17 UTC (rev 273772)
+++ trunk/Source/WebCore/platform/graphics/mac/DisplayRefreshMonitorMac.h	2021-03-03 00:39:40 UTC (rev 273773)
@@ -43,9 +43,9 @@
     
     virtual ~DisplayRefreshMonitorMac();
 
-    void displayLinkFired() override;
-    bool requestRefreshCallback() override;
-    void stop() override;
+    void displayLinkFired() final;
+    bool requestRefreshCallback() final;
+    void stop() final;
 
 private:
     explicit DisplayRefreshMonitorMac(PlatformDisplayID);

Modified: trunk/Tools/ChangeLog (273772 => 273773)


--- trunk/Tools/ChangeLog	2021-03-03 00:38:17 UTC (rev 273772)
+++ trunk/Tools/ChangeLog	2021-03-03 00:39:40 UTC (rev 273773)
@@ -1,3 +1,13 @@
+2021-03-02  Simon Fraser  <[email protected]>
+
+        Rename ForcePageRenderingUpdatesAt60FPSEnabled preference to PreferPageRenderingUpdatesNear60FPSEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=222580.
+
+        Reviewed by Tim Horton.
+
+        * TestWebKitAPI/Tests/WebCore/AnimationFrameRate.cpp:
+        (TestWebKitAPI::TEST): Function rename.
+
 2021-03-02  Jonathan Bedard  <[email protected]>
 
         [webkitscmpy] Add UUID

Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/AnimationFrameRate.cpp (273772 => 273773)


--- trunk/Tools/TestWebKitAPI/Tests/WebCore/AnimationFrameRate.cpp	2021-03-03 00:38:17 UTC (rev 273772)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/AnimationFrameRate.cpp	2021-03-03 00:39:40 UTC (rev 273773)
@@ -117,9 +117,9 @@
 
 TEST(AnimationFrameRate, preferredFramesPerSecond)
 {
-    ASSERT_EQ(preferredFramesPerSecond(FullSpeedAnimationInterval), FullSpeedFramesPerSecond);
-    ASSERT_EQ(preferredFramesPerSecond(HalfSpeedThrottlingAnimationInterval), HalfSpeedThrottlingFramesPerSecond);
-    ASSERT_EQ(preferredFramesPerSecond(Seconds(1.0 / 60)), FramesPerSecond(60));
+    ASSERT_EQ(preferredFramesPerSecondFromInterval(FullSpeedAnimationInterval), FullSpeedFramesPerSecond);
+    ASSERT_EQ(preferredFramesPerSecondFromInterval(HalfSpeedThrottlingAnimationInterval), HalfSpeedThrottlingFramesPerSecond);
+    ASSERT_EQ(preferredFramesPerSecondFromInterval(Seconds(1.0 / 60)), FramesPerSecond(60));
 }
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to