Chromium Code Reviews| Index: third_party/WebKit/Source/modules/webaudio/PannerNode.cpp |
| diff --git a/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp b/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp |
| index 3318bed2d9b4e11b88722f0b46198ec5a42707a6..44ccd79bcc05a664090b230599995d2bc951e867 100644 |
| --- a/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp |
| +++ b/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp |
| @@ -31,6 +31,7 @@ |
| #include "modules/webaudio/AudioBufferSourceNode.h" |
| #include "modules/webaudio/AudioNodeInput.h" |
| #include "modules/webaudio/AudioNodeOutput.h" |
| +#include "platform/Histogram.h" |
| #include "platform/audio/HRTFPanner.h" |
| #include "wtf/MathExtras.h" |
| @@ -52,7 +53,6 @@ PannerHandler::PannerHandler( |
| AudioParamHandler& orientationZ) |
| : AudioHandler(NodeTypePanner, node, sampleRate) |
| , m_listener(node.context()->listener()) |
| - , m_panningModel(Panner::PanningModelEqualPower) |
| , m_distanceModel(DistanceEffect::ModelInverse) |
| , m_isAzimuthElevationDirty(true) |
| , m_isDistanceConeGainDirty(true) |
| @@ -79,6 +79,10 @@ PannerHandler::PannerHandler( |
| m_channelCountMode = ClampedMax; |
| m_channelInterpretation = AudioBus::Speakers; |
| + // Explicitly set the default panning model here so that the histograms |
| + // include the default value. |
| + setPanningModel("equalpower"); |
| + |
| initialize(); |
| } |
| @@ -284,6 +288,10 @@ void PannerHandler::setPanningModel(const String& model) |
| bool PannerHandler::setPanningModel(unsigned model) |
| { |
| + DEFINE_STATIC_LOCAL(EnumerationHistogram, panningModelHistogram, |
| + ("WebAudio.PannerNode.PanningModel", 2)); |
| + panningModelHistogram.count(model); |
|
Mark P
2016/06/03 19:52:37
Please put a comment in
third_party/WebKit/Source/
Raymond Toy
2016/06/09 19:17:10
Done.
|
| + |
| switch (model) { |
| case Panner::PanningModelEqualPower: |
| case Panner::PanningModelHRTF: |