Merge pull request #12835 from NissimHadar/speedUp1

ktxInitialDataRequestFinished call to qcDebug(networking) - only in DEBUG
This commit is contained in:
Sam Gateau 2018-04-12 11:48:09 -07:00 committed by GitHub
commit 77a27b2be7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 0 deletions

View file

@ -156,3 +156,7 @@ void TestScriptingInterface::profileRange(const QString& name, QScriptValue fn)
fn.call(); fn.call();
} }
void TestScriptingInterface::clearCaches() {
qApp->reloadResourceCaches();
}

View file

@ -78,6 +78,11 @@ public slots:
Q_INVOKABLE void profileRange(const QString& name, QScriptValue function); Q_INVOKABLE void profileRange(const QString& name, QScriptValue function);
/**jsdoc
* Clear all caches (menu command Reload Content)
*/
void clearCaches();
private: private:
bool waitForCondition(qint64 maxWaitMs, std::function<bool()> condition); bool waitForCondition(qint64 maxWaitMs, std::function<bool()> condition);
}; };

View file

@ -642,8 +642,12 @@ void NetworkTexture::ktxInitialDataRequestFinished() {
} }
if (result == ResourceRequest::Success) { if (result == ResourceRequest::Success) {
// This is an expensive operation that we do not want in release.
#ifdef DEBUG
auto extraInfo = _url == _activeUrl ? "" : QString(", %1").arg(_activeUrl.toDisplayString()); auto extraInfo = _url == _activeUrl ? "" : QString(", %1").arg(_activeUrl.toDisplayString());
qCDebug(networking).noquote() << QString("Request finished for %1%2").arg(_url.toDisplayString(), extraInfo); qCDebug(networking).noquote() << QString("Request finished for %1%2").arg(_url.toDisplayString(), extraInfo);
#endif
_ktxHeaderData = _ktxHeaderRequest->getData(); _ktxHeaderData = _ktxHeaderRequest->getData();
_ktxHighMipData = _ktxMipRequest->getData(); _ktxHighMipData = _ktxMipRequest->getData();