Creating "basic waveform" Oscillator nodes is not efficient
https://bugs.webkit.org/show_bug.cgi?id=93194
Patch by Raymond Toy <rtoy@google.com> on 2012-08-08
Reviewed by Chris Rogers.
Source/WebCore:
Cache the wavetables for the basic types so they don't have to be
recomputed every time.
Also fix a bug where oscillator type was always set to CUSTOM
instead of the specified oscillator type. Test added for this.
Test: webaudio/oscillator-basic.html
* Modules/webaudio/Oscillator.cpp:
(WebCore):
(WebCore::Oscillator::setType): Use cached wavetables; fix bug in
setting the oscillator type.
* Modules/webaudio/Oscillator.h:
(Oscillator): Define static variables to hold cached wavetables.
LayoutTests:
Add test to verify that the returned oscillator type is the same
as what was set.
* webaudio/oscillator-basic-expected.txt: Added.
* webaudio/oscillator-basic.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125122
268f45cc-cd09-0410-ab3c-
d52691b4dbfc