OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, Google Inc. All rights reserved. | 2 * Copyright (C) 2011, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 exceptionState.throwDOMException( | 85 exceptionState.throwDOMException( |
86 InvalidAccessError, | 86 InvalidAccessError, |
87 ExceptionMessages::indexExceedsMinimumBound<unsigned>("curve length", | 87 ExceptionMessages::indexExceedsMinimumBound<unsigned>("curve length", |
88 curveLength, 2)); | 88 curveLength, 2)); |
89 return; | 89 return; |
90 } | 90 } |
91 | 91 |
92 getWaveShaperProcessor()->setCurve(curveData, curveLength); | 92 getWaveShaperProcessor()->setCurve(curveData, curveLength); |
93 } | 93 } |
94 | 94 |
95 void WaveShaperNode::setCurve(DOMFloat32Array* curve, | 95 void WaveShaperNode::setCurve(const NotShared<DOMFloat32Array>& curve, |
96 ExceptionState& exceptionState) { | 96 ExceptionState& exceptionState) { |
97 DCHECK(isMainThread()); | 97 DCHECK(isMainThread()); |
98 | 98 |
99 if (curve) | 99 if (curve.view()) |
100 setCurveImpl(curve->data(), curve->length(), exceptionState); | 100 setCurveImpl(curve.view()->data(), curve.view()->length(), exceptionState); |
101 else | 101 else |
102 setCurveImpl(nullptr, 0, exceptionState); | 102 setCurveImpl(nullptr, 0, exceptionState); |
103 } | 103 } |
104 | 104 |
105 void WaveShaperNode::setCurve(const Vector<float>& curve, | 105 void WaveShaperNode::setCurve(const Vector<float>& curve, |
106 ExceptionState& exceptionState) { | 106 ExceptionState& exceptionState) { |
107 DCHECK(isMainThread()); | 107 DCHECK(isMainThread()); |
108 | 108 |
109 setCurveImpl(curve.data(), curve.size(), exceptionState); | 109 setCurveImpl(curve.data(), curve.size(), exceptionState); |
110 } | 110 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 return "2x"; | 152 return "2x"; |
153 case WaveShaperProcessor::OverSample4x: | 153 case WaveShaperProcessor::OverSample4x: |
154 return "4x"; | 154 return "4x"; |
155 default: | 155 default: |
156 ASSERT_NOT_REACHED(); | 156 ASSERT_NOT_REACHED(); |
157 return "none"; | 157 return "none"; |
158 } | 158 } |
159 } | 159 } |
160 | 160 |
161 } // namespace blink | 161 } // namespace blink |
OLD | NEW |