diff options
author | Glenn Kasten <gkasten@google.com> | 2012-02-03 07:46:42 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-02-03 07:46:42 -0800 |
commit | 87f155d6655b2d3b27e69281a29e85c6407e4d26 (patch) | |
tree | 65032f39295f3fd280d8478bdc25a14b5362847d /services/audioflinger/AudioFlinger.cpp | |
parent | f81e97e4ec8b01965a5b36987f886cf5001f71ff (diff) | |
parent | d05397144be774f2f3623c754e865f51753e4e31 (diff) | |
download | frameworks_av-87f155d6655b2d3b27e69281a29e85c6407e4d26.zip frameworks_av-87f155d6655b2d3b27e69281a29e85c6407e4d26.tar.gz frameworks_av-87f155d6655b2d3b27e69281a29e85c6407e4d26.tar.bz2 |
Merge "For performance, return large objects by reference"
Diffstat (limited to 'services/audioflinger/AudioFlinger.cpp')
-rw-r--r-- | services/audioflinger/AudioFlinger.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp index b31040c..1a2fa66 100644 --- a/services/audioflinger/AudioFlinger.cpp +++ b/services/audioflinger/AudioFlinger.cpp @@ -7561,7 +7561,8 @@ void AudioFlinger::EffectChain::setEffectSuspendedAll_l(bool suspend) ALOGV("setEffectSuspendedAll_l() add entry for 0"); } if (desc->mRefCount++ == 0) { - Vector< sp<EffectModule> > effects = getSuspendEligibleEffects(); + Vector< sp<EffectModule> > effects; + getSuspendEligibleEffects(effects); for (size_t i = 0; i < effects.size(); i++) { setEffectSuspended_l(&effects[i]->desc().type, true); } @@ -7612,16 +7613,14 @@ bool AudioFlinger::EffectChain::isEffectEligibleForSuspend(const effect_descript return true; } -Vector< sp<AudioFlinger::EffectModule> > AudioFlinger::EffectChain::getSuspendEligibleEffects() +void AudioFlinger::EffectChain::getSuspendEligibleEffects(Vector< sp<AudioFlinger::EffectModule> > &effects) { - Vector< sp<EffectModule> > effects; + effects.clear(); for (size_t i = 0; i < mEffects.size(); i++) { - if (!isEffectEligibleForSuspend(mEffects[i]->desc())) { - continue; + if (isEffectEligibleForSuspend(mEffects[i]->desc())) { + effects.add(mEffects[i]); } - effects.add(mEffects[i]); } - return effects; } sp<AudioFlinger::EffectModule> AudioFlinger::EffectChain::getEffectIfEnabled( |