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

Changeset 267435 in webkit


Ignore:
Timestamp:
Sep 22, 2020, 1:13:41 PM (6 years ago)
Author:
Chris Dumez
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:

"""
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:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r267432 r267435  
     12020-09-22  Chris Dumez  <cdumez@apple.com>
     2
     3        AudioParam.setValueCurveAtTime() should have an implicit call to setValueAtTime() at the end
     4        https://bugs.webkit.org/show_bug.cgi?id=216839
     5
     6        Reviewed by Eric Carlson.
     7
     8        Rebaseline test that is now passing.
     9
     10        * webaudio/AudioParam/audioparam-setValueCurve-end-expected.txt:
     11
    1122020-09-22  Chris Dumez  <cdumez@apple.com>
    213
  • trunk/LayoutTests/webaudio/AudioParam/audioparam-setValueCurve-end-expected.txt

    r267367 r267435  
    99PASS Audit report
    1010PASS > [0: linearRampToValueAtTime] 
    11 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
    12 FAIL < [0: linearRampToValueAtTime] 1 out of 1 assertions were failed. assert_true: expected true got false
     11PASS   setValueCurve(..., 0, 0.01).linearRampToValueAtTime(2, 0.02): value at time 0.01 is 0.3 within an error of 3.9737e-8.
     12PASS < [0: linearRampToValueAtTime] All assertions passed. (total 1 assertions)
    1313PASS > [1: linearRampToValueAtTime] 
    14 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
    15 FAIL < [1: linearRampToValueAtTime] 1 out of 1 assertions were failed. assert_true: expected true got false
     14PASS   setValueCurve(..., 0, 0.0100390625).linearRampToValueAtTime(2, 0.02): value at time 0.010078125 is 0.3066666666666668 within an error of 1.8141e-8.
     15PASS < [1: linearRampToValueAtTime] All assertions passed. (total 1 assertions)
    1616PASS > [2: exponentialRampToValueAtTime] 
    17 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
    18 FAIL < [2: exponentialRampToValueAtTime] 1 out of 1 assertions were failed. assert_true: expected true got false
     17PASS   setValueCurve(..., 0, 0.01).exponentialRampToValueAtTime(2, 0.02): value at time 0.01 is 0.3 within an error of 3.9737e-8.
     18PASS < [2: exponentialRampToValueAtTime] All assertions passed. (total 1 assertions)
    1919PASS > [3: exponentialRampToValueAtTime] 
    20 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
    21 FAIL < [3: exponentialRampToValueAtTime] 1 out of 1 assertions were failed. assert_true: expected true got false
     20PASS   setValueCurve(..., 0, 0.0100390625).exponentialRampToValueAtTime(2, 0.02): value at time 0.010078125 is 0.30224022883150364 within an error of 7.8294e-8.
     21PASS < [3: exponentialRampToValueAtTime] All assertions passed. (total 1 assertions)
    2222PASS > [4: setTargetAtTime] 
    2323PASS   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.
    2424PASS < [4: setTargetAtTime] All assertions passed. (total 1 assertions)
    2525PASS > [5: setTargetAtTime] 
    26 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
    27 FAIL < [5: setTargetAtTime] 1 out of 1 assertions were failed. assert_true: expected true got false
    28 FAIL # AUDIT TASK RUNNER FINISHED: 5 out of 6 tasks were failed. assert_true: expected true got false
     26PASS   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.
     27PASS < [5: setTargetAtTime] All assertions passed. (total 1 assertions)
     28PASS # AUDIT TASK RUNNER FINISHED: 6 tasks ran successfully.
    2929
  • trunk/Source/WebCore/ChangeLog

    r267434 r267435  
     12020-09-22  Chris Dumez  <cdumez@apple.com>
     2
     3        AudioParam.setValueCurveAtTime() should have an implicit call to setValueAtTime() at the end
     4        https://bugs.webkit.org/show_bug.cgi?id=216839
     5
     6        Reviewed by Eric Carlson.
     7
     8        AudioParam.setValueCurveAtTime() should have an implicit call to setValueAtTime() at the end,
     9        as specified here:
     10        - https://www.w3.org/TR/webaudio/#dom-audioparam-setvaluecurveattime
     11
     12        """
     13        An implicit call to setValueAtTime() is made at time 𝑇0+𝑇𝐷 with value 𝑉[𝑁−1] so that
     14        following automations will start from the end of the setValueCurveAtTime() event.
     15        """
     16
     17        No new tests, rebaselined existing test.
     18
     19        * Modules/webaudio/AudioParamTimeline.cpp:
     20        (WebCore::AudioParamTimeline::setValueCurveAtTime):
     21
    1222020-09-22  Zalan Bujtas  <zalan@apple.com>
    223
  • trunk/Source/WebCore/Modules/webaudio/AudioParamTimeline.cpp

    r267413 r267435  
    104104{
    105105    auto locker = holdLock(m_eventsMutex);
    106     return insertEvent(ParamEvent::createSetValueCurveEvent(WTFMove(curve), time, duration));
     106
     107    float curveEndValue = curve.last();
     108    auto result = insertEvent(ParamEvent::createSetValueCurveEvent(WTFMove(curve), time, duration));
     109    if (result.hasException())
     110        return result.releaseException();
     111
     112    // The specification says an implicit call to setValueAtTime() is made at time T0+TD with value V[N-1]
     113    // so that following automations will start from the end of the setValueCurveAtTime() event.
     114    return insertEvent(ParamEvent::createSetValueEvent(curveEndValue, time + duration));
    107115}
    108116
Note: See TracChangeset for help on using the changeset viewer.