Title: [266762] trunk/Source/WebCore
- Revision
- 266762
- Author
- [email protected]
- Date
- 2020-09-08 17:16:16 -0700 (Tue, 08 Sep 2020)
Log Message
Drop unnecessary AudioParam::m_smoothingConstant data member
https://bugs.webkit.org/show_bug.cgi?id=216291
Reviewed by Geoffrey Garen.
Drop unnecessary AudioParam::m_smoothingConstant data member. This constant is never changed.
No new tests, no web-facing behavior change.
* Modules/webaudio/AudioParam.cpp:
(WebCore::AudioParam::AudioParam):
(WebCore::AudioParam::smooth):
* Modules/webaudio/AudioParam.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (266761 => 266762)
--- trunk/Source/WebCore/ChangeLog 2020-09-08 23:47:17 UTC (rev 266761)
+++ trunk/Source/WebCore/ChangeLog 2020-09-09 00:16:16 UTC (rev 266762)
@@ -1,3 +1,19 @@
+2020-09-08 Chris Dumez <[email protected]>
+
+ Drop unnecessary AudioParam::m_smoothingConstant data member
+ https://bugs.webkit.org/show_bug.cgi?id=216291
+
+ Reviewed by Geoffrey Garen.
+
+ Drop unnecessary AudioParam::m_smoothingConstant data member. This constant is never changed.
+
+ No new tests, no web-facing behavior change.
+
+ * Modules/webaudio/AudioParam.cpp:
+ (WebCore::AudioParam::AudioParam):
+ (WebCore::AudioParam::smooth):
+ * Modules/webaudio/AudioParam.h:
+
2020-09-08 Sam Weinig <[email protected]>
[WebIDL] Add support for partial interface mixins
Modified: trunk/Source/WebCore/Modules/webaudio/AudioParam.cpp (266761 => 266762)
--- trunk/Source/WebCore/Modules/webaudio/AudioParam.cpp 2020-09-08 23:47:17 UTC (rev 266761)
+++ trunk/Source/WebCore/Modules/webaudio/AudioParam.cpp 2020-09-09 00:16:16 UTC (rev 266762)
@@ -39,9 +39,6 @@
namespace WebCore {
-const double AudioParam::DefaultSmoothingConstant = 0.05;
-const double AudioParam::SnapThreshold = 0.001;
-
AudioParam::AudioParam(BaseAudioContext& context, const String& name, float defaultValue, float minValue, float maxValue, AutomationRate automationRate, AutomationRateMode automationRateMode)
: AudioSummingJunction(context)
, m_name(name)
@@ -52,7 +49,6 @@
, m_automationRate(automationRate)
, m_automationRateMode(automationRateMode)
, m_smoothedValue(defaultValue)
- , m_smoothingConstant(DefaultSmoothingConstant)
#if !RELEASE_LOG_DISABLED
, m_logger(context.logger())
, m_logIdentifier(context.nextAudioParameterLogIdentifier())
@@ -128,7 +124,7 @@
m_smoothedValue = m_value;
else {
// Dezipper - exponential approach.
- m_smoothedValue += (m_value - m_smoothedValue) * m_smoothingConstant;
+ m_smoothedValue += (m_value - m_smoothedValue) * SmoothingConstant;
// If we get close enough then snap to actual value.
if (fabs(m_smoothedValue - m_value) < SnapThreshold) // FIXME: the threshold needs to be adjustable depending on range - but this is OK general purpose value.
Modified: trunk/Source/WebCore/Modules/webaudio/AudioParam.h (266761 => 266762)
--- trunk/Source/WebCore/Modules/webaudio/AudioParam.h 2020-09-08 23:47:17 UTC (rev 266761)
+++ trunk/Source/WebCore/Modules/webaudio/AudioParam.h 2020-09-09 00:16:16 UTC (rev 266762)
@@ -53,8 +53,8 @@
#endif
{
public:
- static const double DefaultSmoothingConstant;
- static const double SnapThreshold;
+ static constexpr double SmoothingConstant = 0.05;
+ static constexpr double SnapThreshold = 0.001;
static Ref<AudioParam> create(BaseAudioContext& context, const String& name, float defaultValue, float minValue, float maxValue, AutomationRate automationRate, AutomationRateMode automationRateMode = AutomationRateMode::Variable)
{
@@ -99,7 +99,6 @@
bool smooth();
void resetSmoothedValue() { m_smoothedValue = m_value; }
- void setSmoothingConstant(float k) { m_smoothingConstant = k; }
// Parameter automation.
ExceptionOr<AudioParam&> setValueAtTime(float value, double startTime);
@@ -145,7 +144,6 @@
// Smoothing (de-zippering)
float m_smoothedValue;
- float m_smoothingConstant;
AudioParamTimeline m_timeline;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes