Backed out changeset 187fa323cec6 (bug 997870)
authorPaul Adenot <paul@paul.cx>
Mon, 05 Jan 2015 16:04:34 +0100
changeset 247849 7978b241bf5ee96d2291fbd85506b9c034a556d5
parent 247848 12b91d597b5496472458e4512cf7c46d5e5573c0
child 247850 9d72b8315f6552d8b100087fc805f6c70b9ffdd6
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs997870
milestone37.0a1
backs out187fa323cec69d9406514e11ebe1c1f3b9a18661
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 187fa323cec6 (bug 997870)
dom/media/webaudio/OscillatorNode.cpp
--- a/dom/media/webaudio/OscillatorNode.cpp
+++ b/dom/media/webaudio/OscillatorNode.cpp
@@ -146,25 +146,25 @@ public:
       mPhase -= mPhaseWrap;
     }
   }
 
   void UpdateParametersIfNeeded(StreamTime ticks, size_t count)
   {
     double frequency, detune;
 
+    bool simpleFrequency = mFrequency.HasSimpleValue();
+    bool simpleDetune = mDetune.HasSimpleValue();
+
     // Shortcut if frequency-related AudioParam are not automated, and we
     // already have computed the frequency information and related parameters.
-    if (!ParametersMayNeedUpdate()) {
+    if (simpleFrequency && simpleDetune && !mRecomputeParameters) {
       return;
     }
 
-    bool simpleFrequency = mFrequency.HasSimpleValue();
-    bool simpleDetune = mDetune.HasSimpleValue();
-
     if (simpleFrequency) {
       frequency = mFrequency.GetValue();
     } else {
       frequency = mFrequency.GetValueAtTime(ticks, count);
     }
     if (simpleDetune) {
       detune = mDetune.GetValue();
     } else {
@@ -207,23 +207,16 @@ public:
       UpdateParametersIfNeeded(ticks, i);
 
       aOutput[i] = sin(mPhase);
 
       IncrementPhase();
     }
   }
 
-  bool ParametersMayNeedUpdate()
-  {
-    return mDetune.HasSimpleValue() ||
-           mFrequency.HasSimpleValue() ||
-           mRecomputeParameters;
-  }
-
   void ComputeCustom(float* aOutput,
                      StreamTime ticks,
                      uint32_t aStart,
                      uint32_t aEnd)
   {
     MOZ_ASSERT(mPeriodicWave, "No custom waveform data");
 
     uint32_t periodicWaveSize = mPeriodicWave->periodicWaveSize();
@@ -233,32 +226,22 @@ public:
                "periodicWaveSize must be power of 2");
     float* higherWaveData = nullptr;
     float* lowerWaveData = nullptr;
     float tableInterpolationFactor;
     // Phase increment at frequency of 1 Hz.
     // mPhase runs [0,periodicWaveSize) here instead of [0,2*M_PI).
     float basePhaseIncrement = mPeriodicWave->rateScale();
 
-    bool parametersMayNeedUpdate = ParametersMayNeedUpdate();
-    if (!parametersMayNeedUpdate) {
+    for (uint32_t i = aStart; i < aEnd; ++i) {
+      UpdateParametersIfNeeded(ticks, i);
       mPeriodicWave->waveDataForFundamentalFrequency(mFinalFrequency,
                                                      lowerWaveData,
                                                      higherWaveData,
                                                      tableInterpolationFactor);
-    }
-
-    for (uint32_t i = aStart; i < aEnd; ++i) {
-      if (parametersMayNeedUpdate) {
-        mPeriodicWave->waveDataForFundamentalFrequency(mFinalFrequency,
-                                                       lowerWaveData,
-                                                       higherWaveData,
-                                                       tableInterpolationFactor);
-        UpdateParametersIfNeeded(ticks, i);
-      }
       // Bilinear interpolation between adjacent samples in each table.
       float floorPhase = floorf(mPhase);
       uint32_t j1 = floorPhase;
       j1 &= indexMask;
       uint32_t j2 = j1 + 1;
       j2 &= indexMask;
 
       float sampleInterpolationFactor = mPhase - floorPhase;