Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(581)

Unified Diff: third_party/WebKit/LayoutTests/webaudio/Panner/panner-distance-clamping.html

Issue 2859143004: Correctly clamp in distance formulas (Closed)
Patch Set: Address review comments. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/resources/panner-formulas.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/webaudio/Panner/panner-distance-clamping.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/Panner/panner-distance-clamping.html b/third_party/WebKit/LayoutTests/webaudio/Panner/panner-distance-clamping.html
index 78bc17efb3adb2c1d5a5ad92466cf9508f41974c..edea8d6dcbb58dacb0f5c7a23522a2da9dc60839 100644
--- a/third_party/WebKit/LayoutTests/webaudio/Panner/panner-distance-clamping.html
+++ b/third_party/WebKit/LayoutTests/webaudio/Panner/panner-distance-clamping.html
@@ -189,16 +189,20 @@
// destination.
var merger = new ChannelMergerNode(context, {numberOfInputs: 2});
- src.connect(pannerTest).connect(splitTest).connect(merger, 0, 0);;
+ src.connect(pannerTest).connect(splitTest).connect(merger, 0, 0);
src.connect(pannerRef).connect(splitRef).connect(merger, 0, 1);
merger.connect(context.destination);
// Move the panner some distance away. Arbitrarily select the x
- // direction. For the reference panner, manually clamp the distance to
- // lie between refDistance and maxDistance.
- var xRef = Math.min(Math.max(options.distance, pannerRef.refDistance),
- pannerRef.maxDistance);
+ // direction. For the reference panner, manually clamp the distance.
+ // All models clamp the distance to a minimum of refDistance. Only the
+ // linear model also clamps to a maximum of maxDistance.
+ var xRef = Math.max(options.distance, pannerRef.refDistance);
+
+ if (pannerRef.distanceModel === "linear") {
+ xRef = Math.min(xRef, pannerRef.maxDistance);
+ }
var xTest = options.distance;
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/resources/panner-formulas.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698