зеркало из https://github.com/mozilla/gecko-dev.git
Bug 851949 - Avoid setting AudioParam values needlessly; r=roc
This commit is contained in:
Родитель
eb7288536a
Коммит
6ab726ea62
|
@ -64,6 +64,10 @@ public:
|
||||||
// sure that the callback is called every time that this object gets mutated.
|
// sure that the callback is called every time that this object gets mutated.
|
||||||
void SetValue(float aValue)
|
void SetValue(float aValue)
|
||||||
{
|
{
|
||||||
|
// Optimize away setting the same value on an AudioParam
|
||||||
|
if (HasSimpleValue() && fabsf(GetValue() - aValue) < 1e-7) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
AudioParamTimeline::SetValue(aValue);
|
AudioParamTimeline::SetValue(aValue);
|
||||||
mCallback(mNode);
|
mCallback(mNode);
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче