Changeset View
Changeset View
Standalone View
Standalone View
effects.cpp
Show First 20 Lines • Show All 1304 Lines • ▼ Show 20 Line(s) | 1304 | if (isEffectLoaded(name)) | |||
---|---|---|---|---|---|
1305 | unloadEffect(name); | 1305 | unloadEffect(name); | ||
1306 | else | 1306 | else | ||
1307 | loadEffect(name); | 1307 | loadEffect(name); | ||
1308 | } | 1308 | } | ||
1309 | 1309 | | |||
1310 | QStringList EffectsHandlerImpl::loadedEffects() const | 1310 | QStringList EffectsHandlerImpl::loadedEffects() const | ||
1311 | { | 1311 | { | ||
1312 | QStringList listModules; | 1312 | QStringList listModules; | ||
1313 | for (QVector< EffectPair >::const_iterator it = loaded_effects.constBegin(); it != loaded_effects.constEnd(); ++it) { | 1313 | listModules.reserve(loaded_effects.count()); | ||
1314 | listModules << (*it).first; | 1314 | std::transform(loaded_effects.constBegin(), loaded_effects.constEnd(), | ||
1315 | } | 1315 | std::back_inserter(listModules), | ||
1316 | [](const EffectPair &pair) { return pair.first; }); | ||||
1316 | return listModules; | 1317 | return listModules; | ||
1317 | } | 1318 | } | ||
1318 | 1319 | | |||
1319 | QStringList EffectsHandlerImpl::listOfEffects() const | 1320 | QStringList EffectsHandlerImpl::listOfEffects() const | ||
1320 | { | 1321 | { | ||
1321 | return m_effectLoader->listOfKnownEffects(); | 1322 | return m_effectLoader->listOfKnownEffects(); | ||
1322 | } | 1323 | } | ||
1323 | 1324 | | |||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | 1379 | { | |||
1384 | // next checks might require a context | 1385 | // next checks might require a context | ||
1385 | makeOpenGLContextCurrent(); | 1386 | makeOpenGLContextCurrent(); | ||
1386 | m_compositor->addRepaintFull(); | 1387 | m_compositor->addRepaintFull(); | ||
1387 | 1388 | | |||
1388 | return m_effectLoader->isEffectSupported(name); | 1389 | return m_effectLoader->isEffectSupported(name); | ||
1389 | 1390 | | |||
1390 | } | 1391 | } | ||
1391 | 1392 | | |||
1392 | QList< bool > EffectsHandlerImpl::areEffectsSupported(const QStringList &names) | 1393 | QList<bool> EffectsHandlerImpl::areEffectsSupported(const QStringList &names) | ||
1393 | { | 1394 | { | ||
1394 | QList< bool > retList; | 1395 | QList<bool> retList; | ||
1395 | for (const QString &name : names) { | 1396 | retList.reserve(names.count()); | ||
1396 | retList << isEffectSupported(name); | 1397 | std::transform(names.constBegin(), names.constEnd(), | ||
1397 | } | 1398 | std::back_inserter(retList), | ||
1399 | [this](const QString &name) { | ||||
1400 | return isEffectSupported(name); | ||||
1401 | }); | ||||
1398 | return retList; | 1402 | return retList; | ||
1399 | } | 1403 | } | ||
1400 | 1404 | | |||
1401 | void EffectsHandlerImpl::reloadEffect(Effect *effect) | 1405 | void EffectsHandlerImpl::reloadEffect(Effect *effect) | ||
1402 | { | 1406 | { | ||
1403 | QString effectName; | 1407 | QString effectName; | ||
1404 | for (QVector< EffectPair >::const_iterator it = loaded_effects.constBegin(); it != loaded_effects.constEnd(); ++it) { | 1408 | for (QVector< EffectPair >::const_iterator it = loaded_effects.constBegin(); it != loaded_effects.constEnd(); ++it) { | ||
1405 | if ((*it).second == effect) { | 1409 | if ((*it).second == effect) { | ||
▲ Show 20 Lines • Show All 660 Lines • Show Last 20 Lines |