summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntti Määttä <antti.maatta@qt.io>2019-09-17 13:48:26 +0300
committerAntti Määttä <antti.maatta@qt.io>2019-09-19 12:47:22 +0300
commit0ab6e1fb491cbc9aa821e11a1ee78915f61ee499 (patch)
tree252a6ea2d2ab65cbe113f64dc1c14b4e1814412b
parente401b037bcc6e5599fe55d04627143df3c62a271 (diff)
Fix loading subpresentations in preloadSlidev2.5.0-beta1
Subpresentations were not loaded when calling preloadSlide. Add subpresentation loading handling into loadComponentSlideResources, which gets called when preloadSlide is called. Change-Id: I7bc8c5a799214534370af19e6e104e2846f38743 Reviewed-by: Janne Kangas <janne.kangas@qt.io> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Antti Määttä <antti.maatta@qt.io>
-rw-r--r--src/runtime/Qt3DSApplication.cpp38
1 files changed, 37 insertions, 1 deletions
diff --git a/src/runtime/Qt3DSApplication.cpp b/src/runtime/Qt3DSApplication.cpp
index 46f6a19..abe93c8 100644
--- a/src/runtime/Qt3DSApplication.cpp
+++ b/src/runtime/Qt3DSApplication.cpp
@@ -1226,6 +1226,42 @@ struct SApp : public IApplication
m_uploadRenderTask->add(m_resourceCounter.createSet, wait);
else
m_createSet.unite(m_resourceCounter.createSet);
+
+ QVector<QString> newAssets;
+
+ getComponentSlideAssets(newAssets, presentation, component, index);
+ if (newAssets.size())
+ qCInfo(PERF_INFO) << "Slide assets: " << newAssets;
+ for (QT3DSU32 idx = 0, end = m_OrderedAssets.size(); idx < end; ++idx) {
+ QString assetId = QString::fromUtf8(m_OrderedAssets[idx].first.c_str());
+ if (newAssets.contains(assetId) && !GetPresentationById(qUtf8Printable(assetId))) {
+ SAssetValue &theAsset = *m_OrderedAssets[idx].second;
+ switch (theAsset.getType()) {
+ case AssetValueTypes::Presentation: {
+ AssetHandlers::handlePresentation(*this, theAsset);
+ SPresentationAsset &thePresentationAsset
+ = *theAsset.getDataPtr<SPresentationAsset>();
+ CPresentation *thePresentation = thePresentationAsset.m_Presentation;
+ if (thePresentation) {
+ SStackPerfTimer __loadTimer(m_CoreFactory->GetPerfTimer(),
+ "Application: SetActivityZone");
+ thePresentation->SetActivityZone(
+ &m_ActivityZoneManager->CreateActivityZone(*thePresentation));
+ thePresentation->SetActive(thePresentationAsset.m_Active);
+ }
+ } break;
+ case AssetValueTypes::Behavior: {
+ AssetHandlers::handleBehavior(*this, theAsset);
+ } break;
+ case AssetValueTypes::QmlPresentation: {
+ AssetHandlers::handleQmlPresentation(*m_RuntimeFactory, theAsset);
+ } break;
+ // SCXML, NoAssetValue do not need processing here
+ default:
+ break;
+ }
+ }
+ }
}
}
@@ -2068,7 +2104,7 @@ struct SXMLLoader : public IAppLoadContext
if (!delayedLoading || (m_App.m_OrderedAssets.size() > 1 && initialAssets.size() > 0)) {
for (QT3DSU32 idx = 0, end = m_App.m_OrderedAssets.size(); idx < end; ++idx) {
- QString assetId = QString::fromLatin1(m_App.m_OrderedAssets[idx].first.c_str());
+ QString assetId = QString::fromUtf8(m_App.m_OrderedAssets[idx].first.c_str());
if (m_App.m_OrderedAssets[idx].first != initialStr
&& (initialAssets.contains(assetId) || !delayedLoading)) {
SAssetValue &theAsset = *m_App.m_OrderedAssets[idx].second;