Creating "basic waveform" Oscillator nodes is not efficient
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Aug 2012 00:18:23 +0000 (00:18 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Aug 2012 00:18:23 +0000 (00:18 +0000)
commitc8140cad4d867b45e43691f999e4972c85a25aed
treeae65e5096a0da2cbd180566344e2f89bad02a042
parent4cf2079cfc445603e1e3c24dcee38562033d8969
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
LayoutTests/ChangeLog
LayoutTests/webaudio/oscillator-basic-expected.txt [new file with mode: 0644]
LayoutTests/webaudio/oscillator-basic.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/webaudio/Oscillator.cpp
Source/WebCore/Modules/webaudio/Oscillator.h