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

Unified Diff: Source/modules/webaudio/AudioBuffer.cpp

Issue 1180023002: Inline the only callers of TypedArrayBase::{setRange,zeroRange} (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | « Source/core/dom/DOMTypedArray.h ('k') | Source/wtf/ArrayBufferView.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/AudioBuffer.cpp
diff --git a/Source/modules/webaudio/AudioBuffer.cpp b/Source/modules/webaudio/AudioBuffer.cpp
index 54612e86bec61f079a18752d9fe652fee8b38a2a..a3462590825de07f0a8a177e07bdca7ac40b3f3a 100644
--- a/Source/modules/webaudio/AudioBuffer.cpp
+++ b/Source/modules/webaudio/AudioBuffer.cpp
@@ -176,7 +176,9 @@ AudioBuffer::AudioBuffer(AudioBus* bus)
return;
channelDataArray->setNeuterable(false);
- channelDataArray->setRange(bus->channel(i)->data(), m_length, 0);
+ const float* src = bus->channel(i)->data();
+ float* dst = channelDataArray->data();
+ memmove(dst, src, m_length * sizeof(*dst));
adamk 2015/06/12 17:59:25 For WebAudio reviewers: this memmove is from the o
Raymond Toy 2015/06/12 18:05:50 If the original did this, I'm happy with leaving i
adamk 2015/06/12 18:14:28 The destination of this memmove was just created w
m_channels.append(channelDataArray);
}
}
@@ -317,8 +319,10 @@ void AudioBuffer::copyToChannel(DOMFloat32Array* source, long channelNumber, uns
void AudioBuffer::zero()
{
for (unsigned i = 0; i < m_channels.size(); ++i) {
- if (getChannelData(i))
- getChannelData(i)->zeroRange(0, length());
+ if (DOMFloat32Array* array = getChannelData(i)) {
+ float* data = array->data();
+ memset(data, 0, length() * sizeof(*data));
Raymond Toy 2015/06/12 18:05:50 The original had some checks on the parameters. Ar
adamk 2015/06/12 18:14:28 Same as above, all the channel data arrays have th
+ }
}
}
« no previous file with comments | « Source/core/dom/DOMTypedArray.h ('k') | Source/wtf/ArrayBufferView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698