History

merge from upstream

Seth Alves committed 8 years ago

Commit 64a46bf2 parents 98e0e66 b97c938107 files · +1462 −601Browse files

Showing the changes to interface/src/Application.cpp (1 of 107 files). Show all

Unified · Split

interface/src/Application.cpp+32−5
@@ -68,6 +68,7 @@ · 67 unmodified lines
6868 #include <Midi.h>
6969 #include <AudioInjectorManager.h>
7070 #include <AvatarBookmarks.h>
71+#include <AvatarEntitiesBookmarks.h>
7172 #include <CursorManager.h>
7273 #include <DebugDraw.h>
7374 #include <DeferredLightingEffect.h>
@@ -148,6 +149,7 @@ · 74 unmodified lines
148149 #include "avatar/AvatarManager.h"
149150 #include "avatar/MyHead.h"
150151 #include "CrashHandler.h"
152+#include "Crashpad.h"
151153 #include "devices/DdeFaceTracker.h"
152154 #include "DiscoverabilityManager.h"
153155 #include "GLCanvas.h"
@@ -395,6 +397,7 @@ public: · 241 unmodified lines
395397 setObjectName("Deadlock Watchdog");
396398 // Give the heartbeat an initial value
397399 _heartbeat = usecTimestampNow();
400+ _paused = false;
398401 connect(qApp, &QCoreApplication::aboutToQuit, [this] {
399402 _quit = true;
400403 });
@@ -412,11 +415,20 @@ public: · 11 unmodified lines
412415 *crashTrigger = 0xDEAD10CC;
413416 }
414417
418+ static void pause() {
419+ _paused = true;
420+ }
421+
422+ static void resume() {
423+ _paused = false;
424+ updateHeartbeat();
425+ }
426+
415427 void run() override {
416428 while (!_quit) {
417429 QThread::sleep(HEARTBEAT_UPDATE_INTERVAL_SECS);
418430 // Don't do heartbeat detection under nsight
419− if (nsightActive()) {
431+ if (nsightActive() || _paused) {
420432 continue;
421433 }
422434 uint64_t lastHeartbeat = _heartbeat; // sample atomic _heartbeat, because we could context switch away and have it updated on us
@@ -472,6 +484,7 @@ public: · 49 unmodified lines
472484 }
473485 }
474486
487+ static std::atomic<bool> _paused;
475488 static std::atomic<uint64_t> _heartbeat;
476489 static std::atomic<uint64_t> _maxElapsed;
477490 static std::atomic<int> _maxElapsedAverage;
@@ -480,6 +493,7 @@ public: · 2 unmodified lines
480493 bool _quit { false };
481494 };
482495
496+std::atomic<bool> DeadlockWatchdogThread::_paused;
483497 std::atomic<uint64_t> DeadlockWatchdogThread::_heartbeat;
484498 std::atomic<uint64_t> DeadlockWatchdogThread::_maxElapsed;
485499 std::atomic<int> DeadlockWatchdogThread::_maxElapsedAverage;
@@ -655,8 +669,6 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { · 169 unmodified lines
655669 }
656670 #endif
657671
658− Setting::init();
659−
660672 // Tell the plugin manager about our statically linked plugins
661673 auto pluginManager = PluginManager::getInstance();
662674 pluginManager->setInputPluginProvider([] { return getInputPlugins(); });
@@ -763,6 +775,7 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { · 100 unmodified lines
763775 DependencyManager::set<GooglePolyScriptingInterface>();
764776 DependencyManager::set<OctreeStatsProvider>(nullptr, qApp->getOcteeSceneStats());
765777 DependencyManager::set<AvatarBookmarks>();
778+ DependencyManager::set<AvatarEntitiesBookmarks>();
766779 DependencyManager::set<LocationBookmarks>();
767780 DependencyManager::set<Snapshot>();
768781 DependencyManager::set<CloseEventSender>();
@@ -907,6 +920,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 138 unmodified lines
907920
908921 _logger->setSessionID(accountManager->getSessionID());
909922
923+ setCrashAnnotation("metaverse_session_id", accountManager->getSessionID().toString().toStdString());
924+
910925 if (steamClient) {
911926 qCDebug(interfaceapp) << "[VERSION] SteamVR buildID:" << steamClient->getSteamVRBuildID();
912927 }
@@ -1906,7 +1921,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 993 unmodified lines
19061921 entityResult.distance = pickResult->distance;
19071922 entityResult.surfaceNormal = pickResult->surfaceNormal;
19081923 entityResult.entityID = pickResult->objectID;
1909− entityResult.entity = DependencyManager::get<EntityTreeRenderer>()->getTree()->findEntityByID(entityResult.entityID);
1924+ entityResult.extraInfo = pickResult->extraInfo;
19101925 }
19111926 }
19121927 return entityResult;
@@ -2267,6 +2282,11 @@ void Application::initializeGL() { · 354 unmodified lines
22672282 initDisplay();
22682283 qCDebug(interfaceapp, "Initialized Display.");
22692284
2285+#ifdef Q_OS_OSX
2286+ // FIXME: on mac os the shaders take up to 1 minute to compile, so we pause the deadlock watchdog thread.
2287+ DeadlockWatchdogThread::pause();
2288+#endif
2289+
22702290 // Set up the render engine
22712291 render::CullFunctor cullFunctor = LODManager::shouldRender;
22722292 static const QString RENDER_FORWARD = "HIFI_RENDER_FORWARD";
@@ -2275,6 +2295,11 @@ void Application::initializeGL() { · 2 unmodified lines
22752295 _renderEngine->addJob<SecondaryCameraRenderTask>("SecondaryCameraJob", cullFunctor, !DISABLE_DEFERRED);
22762296 #endif
22772297 _renderEngine->addJob<RenderViewTask>("RenderMainView", cullFunctor, !DISABLE_DEFERRED, render::ItemKey::TAG_BITS_0, render::ItemKey::TAG_BITS_0);
2298+
2299+#ifdef Q_OS_OSX
2300+ DeadlockWatchdogThread::resume();
2301+#endif
2302+
22782303 _renderEngine->load();
22792304 _renderEngine->registerScene(_main3DScene);
22802305
@@ -2443,6 +2468,7 @@ void Application::initializeUi() { · 162 unmodified lines
24432468 surfaceContext->setContextProperty("Settings", SettingsScriptingInterface::getInstance());
24442469 surfaceContext->setContextProperty("ScriptDiscoveryService", DependencyManager::get<ScriptEngines>().data());
24452470 surfaceContext->setContextProperty("AvatarBookmarks", DependencyManager::get<AvatarBookmarks>().data());
2471+ surfaceContext->setContextProperty("AvatarEntitiesBookmarks", DependencyManager::get<AvatarEntitiesBookmarks>().data());
24462472 surfaceContext->setContextProperty("LocationBookmarks", DependencyManager::get<LocationBookmarks>().data());
24472473
24482474 // Caches
@@ -5851,6 +5877,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEnginePointe · 3402 unmodified lines
58515877 scriptEngine->registerGlobalObject("AudioStats", DependencyManager::get<AudioClient>()->getStats().data());
58525878 scriptEngine->registerGlobalObject("AudioScope", DependencyManager::get<AudioScope>().data());
58535879 scriptEngine->registerGlobalObject("AvatarBookmarks", DependencyManager::get<AvatarBookmarks>().data());
5880+ scriptEngine->registerGlobalObject("AvatarEntitiesBookmarks", DependencyManager::get<AvatarEntitiesBookmarks>().data());
58545881 scriptEngine->registerGlobalObject("LocationBookmarks", DependencyManager::get<LocationBookmarks>().data());
58555882
58565883 scriptEngine->registerGlobalObject("RayPick", DependencyManager::get<RayPickScriptingInterface>().data());
@@ -6268,7 +6295,7 @@ void Application::showAssetServerWidget(QString filePath) { · 411 unmodified lines
62686295 if (!hmd->getShouldShowTablet() && !isHMDMode()) {
62696296 DependencyManager::get<OffscreenUi>()->show(url, "AssetServer", startUpload);
62706297 } else {
6271− static const QUrl url("../dialogs/TabletAssetServer.qml");
6298+ static const QUrl url("hifi/dialogs/TabletAssetServer.qml");
62726299 tablet->pushOntoStack(url);
62736300 }
62746301 }