Title: [267435] trunk
Revision
267435
Author
[email protected]
Date
2020-09-22 13:13:41 -0700 (Tue, 22 Sep 2020)

Log Message

AudioParam.setValueCurveAtTime() should have an implicit call to setValueAtTime() at the end
https://bugs.webkit.org/show_bug.cgi?id=216839

Reviewed by Eric Carlson.

Source/WebCore:

AudioParam.setValueCurveAtTime() should have an implicit call to setValueAtTime() at the end,
as specified here:
- https://www.w3.org/TR/webaudio/#dom-audioparam-setvaluecurveattime

"""
An implicit call to setValueAtTime() is made at time 𝑇0+𝑇𝐷 with value 𝑉[𝑁−1] so that
following automations will start from the end of the setValueCurveAtTime() event.
"""

No new tests, rebaselined existing test.

* Modules/webaudio/AudioParamTimeline.cpp:
(WebCore::AudioParamTimeline::setValueCurveAtTime):

LayoutTests:

Rebaseline test that is now passing.

* webaudio/AudioParam/audioparam-setValueCurve-end-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (267434 => 267435)


--- trunk/LayoutTests/ChangeLog	2020-09-22 20:07:19 UTC (rev 267434)
+++ trunk/LayoutTests/ChangeLog	2020-09-22 20:13:41 UTC (rev 267435)
@@ -1,5 +1,16 @@
 2020-09-22  Chris Dumez  <[email protected]>
 
+        AudioParam.setValueCurveAtTime() should have an implicit call to setValueAtTime() at the end
+        https://bugs.webkit.org/show_bug.cgi?id=216839
+
+        Reviewed by Eric Carlson.
+
+        Rebaseline test that is now passing.
+
+        * webaudio/AudioParam/audioparam-setValueCurve-end-expected.txt:
+
+2020-09-22  Chris Dumez  <[email protected]>
+
         AudioParams with automations must process timelines
         https://bugs.webkit.org/show_bug.cgi?id=216837
 

Modified: trunk/LayoutTests/webaudio/AudioParam/audioparam-setValueCurve-end-expected.txt (267434 => 267435)


--- trunk/LayoutTests/webaudio/AudioParam/audioparam-setValueCurve-end-expected.txt	2020-09-22 20:07:19 UTC (rev 267434)
+++ trunk/LayoutTests/webaudio/AudioParam/audioparam-setValueCurve-end-expected.txt	2020-09-22 20:13:41 UTC (rev 267435)
@@ -8,22 +8,22 @@
 PASS Executing "5: setTargetAtTime" 
 PASS Audit report 
 PASS > [0: linearRampToValueAtTime]  
-FAIL X setValueCurve(..., 0, 0.01).linearRampToValueAtTime(2, 0.02): value at time 0.01 is not close to 0.3 within a relative error of 3.9737e-8 (RelErr=2.3333333333333335). Got 1. assert_true: expected true got false
-FAIL < [0: linearRampToValueAtTime] 1 out of 1 assertions were failed. assert_true: expected true got false
+PASS   setValueCurve(..., 0, 0.01).linearRampToValueAtTime(2, 0.02): value at time 0.01 is 0.3 within an error of 3.9737e-8. 
+PASS < [0: linearRampToValueAtTime] All assertions passed. (total 1 assertions) 
 PASS > [1: linearRampToValueAtTime]  
-FAIL X setValueCurve(..., 0, 0.0100390625).linearRampToValueAtTime(2, 0.02): value at time 0.010078125 is not close to 0.3066666666666668 within a relative error of 1.8141e-8 (RelErr=2.2863451086956506). Got 1.0078125. assert_true: expected true got false
-FAIL < [1: linearRampToValueAtTime] 1 out of 1 assertions were failed. assert_true: expected true got false
+PASS   setValueCurve(..., 0, 0.0100390625).linearRampToValueAtTime(2, 0.02): value at time 0.010078125 is 0.3066666666666668 within an error of 1.8141e-8. 
+PASS < [1: linearRampToValueAtTime] All assertions passed. (total 1 assertions) 
 PASS > [2: exponentialRampToValueAtTime]  
-FAIL X setValueCurve(..., 0, 0.01).exponentialRampToValueAtTime(2, 0.02): value at time 0.01 is not close to 0.3 within a relative error of 3.9737e-8 (RelErr=1). Got 0. assert_true: expected true got false
-FAIL < [2: exponentialRampToValueAtTime] 1 out of 1 assertions were failed. assert_true: expected true got false
+PASS   setValueCurve(..., 0, 0.01).exponentialRampToValueAtTime(2, 0.02): value at time 0.01 is 0.3 within an error of 3.9737e-8. 
+PASS < [2: exponentialRampToValueAtTime] All assertions passed. (total 1 assertions) 
 PASS > [3: exponentialRampToValueAtTime]  
-FAIL X setValueCurve(..., 0, 0.0100390625).exponentialRampToValueAtTime(2, 0.02): value at time 0.010078125 is not close to 0.30224022883150364 within a relative error of 7.8294e-8 (RelErr=1). Got 0. assert_true: expected true got false
-FAIL < [3: exponentialRampToValueAtTime] 1 out of 1 assertions were failed. assert_true: expected true got false
+PASS   setValueCurve(..., 0, 0.0100390625).exponentialRampToValueAtTime(2, 0.02): value at time 0.010078125 is 0.30224022883150364 within an error of 7.8294e-8. 
+PASS < [3: exponentialRampToValueAtTime] All assertions passed. (total 1 assertions) 
 PASS > [4: setTargetAtTime]  
 PASS   setValueCurve(..., 0, 0.01).setTargetAtTime(2, 0.02, 0.01): value at time 0.01 is 0.30000000000000004 within an error of 1.5895e-7. 
 PASS < [4: setTargetAtTime] All assertions passed. (total 1 assertions) 
 PASS > [5: setTargetAtTime]  
-FAIL X setValueCurve(..., 0, 0.0100390625).setTargetAtTime(2, 0.02, 0.01): value at time 0.010078125 is not close to 0.30662767190080054 within a relative error of 1.3278e-7 (RelErr=0.04297713875809369). Got 0.31980565190315247. assert_true: expected true got false
-FAIL < [5: setTargetAtTime] 1 out of 1 assertions were failed. assert_true: expected true got false
-FAIL # AUDIT TASK RUNNER FINISHED: 5 out of 6 tasks were failed. assert_true: expected true got false
+PASS   setValueCurve(..., 0, 0.0100390625).setTargetAtTime(2, 0.02, 0.01): value at time 0.010078125 is 0.30662767190080054 within an error of 1.3278e-7. 
+PASS < [5: setTargetAtTime] All assertions passed. (total 1 assertions) 
+PASS # AUDIT TASK RUNNER FINISHED: 6 tasks ran successfully. 
 

Modified: trunk/Source/WebCore/ChangeLog (267434 => 267435)


--- trunk/Source/WebCore/ChangeLog	2020-09-22 20:07:19 UTC (rev 267434)
+++ trunk/Source/WebCore/ChangeLog	2020-09-22 20:13:41 UTC (rev 267435)
@@ -1,3 +1,24 @@
+2020-09-22  Chris Dumez  <[email protected]>
+
+        AudioParam.setValueCurveAtTime() should have an implicit call to setValueAtTime() at the end
+        https://bugs.webkit.org/show_bug.cgi?id=216839
+
+        Reviewed by Eric Carlson.
+
+        AudioParam.setValueCurveAtTime() should have an implicit call to setValueAtTime() at the end,
+        as specified here:
+        - https://www.w3.org/TR/webaudio/#dom-audioparam-setvaluecurveattime
+
+        """
+        An implicit call to setValueAtTime() is made at time 𝑇0+𝑇𝐷 with value 𝑉[𝑁−1] so that
+        following automations will start from the end of the setValueCurveAtTime() event.
+        """
+
+        No new tests, rebaselined existing test.
+
+        * Modules/webaudio/AudioParamTimeline.cpp:
+        (WebCore::AudioParamTimeline::setValueCurveAtTime):
+
 2020-09-22  Zalan Bujtas  <[email protected]>
 
         [LFC][IFC] Add support for multiline inline box geometry.

Modified: trunk/Source/WebCore/Modules/webaudio/AudioParamTimeline.cpp (267434 => 267435)


--- trunk/Source/WebCore/Modules/webaudio/AudioParamTimeline.cpp	2020-09-22 20:07:19 UTC (rev 267434)
+++ trunk/Source/WebCore/Modules/webaudio/AudioParamTimeline.cpp	2020-09-22 20:13:41 UTC (rev 267435)
@@ -103,7 +103,15 @@
 ExceptionOr<void> AudioParamTimeline::setValueCurveAtTime(Vector<float>&& curve, Seconds time, Seconds duration)
 {
     auto locker = holdLock(m_eventsMutex);
-    return insertEvent(ParamEvent::createSetValueCurveEvent(WTFMove(curve), time, duration));
+
+    float curveEndValue = curve.last();
+    auto result = insertEvent(ParamEvent::createSetValueCurveEvent(WTFMove(curve), time, duration));
+    if (result.hasException())
+        return result.releaseException();
+
+    // The specification says an implicit call to setValueAtTime() is made at time T0+TD with value V[N-1]
+    // so that following automations will start from the end of the setValueCurveAtTime() event.
+    return insertEvent(ParamEvent::createSetValueEvent(curveEndValue, time + duration));
 }
 
 static bool isValidNumber(float x)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to