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

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

Issue 20300002: Fix trailing whitespace in .cpp, .h, and .idl files (ex. Source/core) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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/modules/webaudio/OfflineAudioDestinationNode.h ('k') | Source/modules/webaudio/OscillatorNode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/OfflineAudioDestinationNode.cpp
diff --git a/Source/modules/webaudio/OfflineAudioDestinationNode.cpp b/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
index 4cc77ffed90b6107229f11a81e7f675b1fc1eaec..f5b574596fc6cbce78180a3f7090c7eb4a694e20 100644
--- a/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
+++ b/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
@@ -35,10 +35,10 @@
#include "wtf/MainThread.h"
using namespace std;
-
+
namespace WebCore {
-
-const size_t renderQuantumSize = 128;
+
+const size_t renderQuantumSize = 128;
OfflineAudioDestinationNode::OfflineAudioDestinationNode(AudioContext* context, AudioBuffer* renderTarget)
: AudioDestinationNode(context, renderTarget->sampleRate())
@@ -81,7 +81,7 @@ void OfflineAudioDestinationNode::startRendering()
ASSERT(m_renderTarget.get());
if (!m_renderTarget.get())
return;
-
+
if (!m_startedRendering) {
m_startedRendering = true;
ref(); // See corresponding deref() call in notifyCompleteDispatch().
@@ -103,26 +103,26 @@ void OfflineAudioDestinationNode::offlineRender()
ASSERT(m_renderBus.get());
if (!m_renderBus.get())
return;
-
+
bool channelsMatch = m_renderBus->numberOfChannels() == m_renderTarget->numberOfChannels();
ASSERT(channelsMatch);
if (!channelsMatch)
return;
-
+
bool isRenderBusAllocated = m_renderBus->length() >= renderQuantumSize;
ASSERT(isRenderBusAllocated);
if (!isRenderBusAllocated)
return;
-
+
// Synchronize with HRTFDatabaseLoader.
// The database must be loaded before we can proceed.
HRTFDatabaseLoader* loader = context()->hrtfDatabaseLoader();
ASSERT(loader);
if (!loader)
return;
-
+
loader->waitForLoaderThreadCompletion();
-
+
// Break up the render target into smaller "render quantize" sized pieces.
// Render until we're finished.
size_t framesToProcess = m_renderTarget->length();
@@ -132,19 +132,19 @@ void OfflineAudioDestinationNode::offlineRender()
while (framesToProcess > 0) {
// Render one render quantum.
render(0, m_renderBus.get(), renderQuantumSize);
-
+
size_t framesAvailableToCopy = min(framesToProcess, renderQuantumSize);
-
+
for (unsigned channelIndex = 0; channelIndex < numberOfChannels; ++channelIndex) {
const float* source = m_renderBus->channel(channelIndex)->data();
float* destination = m_renderTarget->getChannelData(channelIndex)->data();
memcpy(destination + n, source, sizeof(float) * framesAvailableToCopy);
}
-
+
n += framesAvailableToCopy;
framesToProcess -= framesAvailableToCopy;
}
-
+
// Our work is done. Let the AudioContext know.
callOnMainThread(notifyCompleteDispatch, this);
}
« no previous file with comments | « Source/modules/webaudio/OfflineAudioDestinationNode.h ('k') | Source/modules/webaudio/OscillatorNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698