summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-09-28 16:22:20 -0500
committerDave Parks <davep@lindenlab.com>2011-09-28 16:22:20 -0500
commit4dd533a5871fd5bbb0ea084679da9f0a856d41c5 (patch)
treeaa77924d9aeb109e45c7ce55138384c43e04abf8 /indra/newview
parentf657f5a428e47fc9963cc4eb943062216443673f (diff)
SH-2276 Update window often during login to avoid windows TDR events
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llstartup.cpp132
1 files changed, 116 insertions, 16 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 11a4c96f14..8876d6fa16 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -733,8 +733,11 @@ bool idle_startup()
// this startup phase more than once.
if (gLoginMenuBarView == NULL)
{
- initialize_edit_menu();
+ display_startup();
+ initialize_edit_menu();
+ display_startup();
init_menus();
+ display_startup();
}
if (show_connect_box)
@@ -743,23 +746,28 @@ bool idle_startup()
// NOTE: Hits "Attempted getFields with no login view shown" warning, since we don't
// show the login view until login_show() is called below.
if (gUserCredential.isNull())
- {
+ {
+ display_startup();
gUserCredential = gLoginHandler.initializeLoginInfo();
+ display_startup();
}
if (gHeadlessClient)
{
LL_WARNS("AppInit") << "Waiting at connection box in headless client. Did you mean to add autologin params?" << LL_ENDL;
}
// Make sure the process dialog doesn't hide things
+ display_startup();
gViewerWindow->setShowProgress(FALSE);
-
+ display_startup();
// Show the login dialog
login_show();
+ display_startup();
// connect dialog is already shown, so fill in the names
if (gUserCredential.notNull())
{
LLPanelLogin::setFields( gUserCredential, gRememberPassword);
}
+ display_startup();
LLPanelLogin::giveFocus();
LLStartUp::setStartupState( STATE_LOGIN_WAIT ); // Wait for user input
@@ -770,14 +778,19 @@ bool idle_startup()
LLStartUp::setStartupState( STATE_LOGIN_CLEANUP );
}
+ display_startup();
gViewerWindow->setNormalControlsVisible( FALSE );
+ display_startup();
gLoginMenuBarView->setVisible( TRUE );
+ display_startup();
gLoginMenuBarView->setEnabled( TRUE );
+ display_startup();
show_debug_menus();
+ display_startup();
// Hide the splash screen
LLSplashScreen::hide();
-
+ display_startup();
// Push our window frontmost
gViewerWindow->getWindow()->show();
display_startup();
@@ -786,7 +799,10 @@ bool idle_startup()
// first made visible.
#ifdef _WIN32
MSG msg;
- while( PeekMessage( &msg, /*All hWnds owned by this thread */ NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE ) );
+ while( PeekMessage( &msg, /*All hWnds owned by this thread */ NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE ) )
+ {
+ display_startup();
+ }
#endif
timeout.reset();
return FALSE;
@@ -801,7 +817,7 @@ bool idle_startup()
// Don't do anything. Wait for the login view to call the login_callback,
// which will push us to the next state.
-
+ display_startup();
// Sleep so we don't spin the CPU
ms_sleep(1);
return FALSE;
@@ -1169,37 +1185,51 @@ bool idle_startup()
// Finish agent initialization. (Requires gSavedSettings, builds camera)
gAgent.init();
+ display_startup();
gAgentCamera.init();
+ display_startup();
set_underclothes_menu_options();
+ display_startup();
// Since we connected, save off the settings so the user doesn't have to
// type the name/password again if we crash.
gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE);
LLUIColorTable::instance().saveUserSettings();
+ display_startup();
+
//
// Initialize classes w/graphics stuff.
//
gTextureList.doPrefetchImages();
+ display_startup();
+
LLSurface::initClasses();
+ display_startup();
+
LLFace::initClass();
+ display_startup();
LLDrawable::initClass();
+ display_startup();
// init the shader managers
LLPostProcess::initClass();
+ display_startup();
LLViewerObject::initVOClasses();
+ display_startup();
// Initialize all our tools. Must be done after saved settings loaded.
// NOTE: This also is where gToolMgr used to be instantiated before being turned into a singleton.
LLToolMgr::getInstance()->initTools();
+ display_startup();
// Pre-load floaters, like the world map, that are slow to spawn
// due to XML complexity.
gViewerWindow->initWorldUI();
-
+
display_startup();
// This is where we used to initialize gWorldp. Original comment said:
@@ -1207,24 +1237,26 @@ bool idle_startup()
// User might have overridden far clip
LLWorld::getInstance()->setLandFarClip(gAgentCamera.mDrawDistance);
-
+ display_startup();
// Before we create the first region, we need to set the agent's mOriginGlobal
// This is necessary because creating objects before this is set will result in a
// bad mPositionAgent cache.
gAgent.initOriginGlobal(from_region_handle(gFirstSimHandle));
+ display_startup();
LLWorld::getInstance()->addRegion(gFirstSimHandle, gFirstSim);
+ display_startup();
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(gFirstSimHandle);
LL_INFOS("AppInit") << "Adding initial simulator " << regionp->getOriginGlobal() << LL_ENDL;
regionp->setSeedCapability(gFirstSimSeedCap);
LL_DEBUGS("AppInit") << "Waiting for seed grant ...." << LL_ENDL;
-
+ display_startup();
// Set agent's initial region to be the one we just created.
gAgent.setRegion(regionp);
-
+ display_startup();
// Set agent's initial position, which will be read by LLVOAvatar when the avatar
// object is created. I think this must be done after setting the region. JC
gAgent.setPositionAgent(agent_start_position_region);
@@ -1244,6 +1276,7 @@ bool idle_startup()
{
LLStartUp::multimediaInit();
LLStartUp::setStartupState( STATE_FONT_INIT );
+ display_startup();
return FALSE;
}
@@ -1252,6 +1285,7 @@ bool idle_startup()
{
LLStartUp::fontInit();
LLStartUp::setStartupState( STATE_SEED_GRANTED_WAIT );
+ display_startup();
return FALSE;
}
@@ -1279,6 +1313,7 @@ bool idle_startup()
set_startup_status(0.4f, LLTrans::getString("LoginRequestSeedCapGrant"), gAgent.mMOTD);
}
}
+ display_startup();
return FALSE;
}
@@ -1289,7 +1324,9 @@ bool idle_startup()
//---------------------------------------------------------------------
if (STATE_SEED_CAP_GRANTED == LLStartUp::getStartupState())
{
+ display_startup();
update_texture_fetch();
+ display_startup();
if ( gViewerWindow != NULL)
{ // This isn't the first logon attempt, so show the UI
@@ -1297,12 +1334,15 @@ bool idle_startup()
}
gLoginMenuBarView->setVisible( FALSE );
gLoginMenuBarView->setEnabled( FALSE );
+ display_startup();
// direct logging to the debug console's line buffer
LLError::logToFixedBuffer(gDebugView->mDebugConsolep);
+ display_startup();
// set initial visibility of debug console
gDebugView->mDebugConsolep->setVisible(gSavedSettings.getBOOL("ShowDebugConsole"));
+ display_startup();
//
// Set message handlers
@@ -1311,22 +1351,28 @@ bool idle_startup()
// register callbacks for messages. . . do this after initial handshake to make sure that we don't catch any unwanted
register_viewer_callbacks(gMessageSystem);
+ display_startup();
// Debugging info parameters
gMessageSystem->setMaxMessageTime( 0.5f ); // Spam if decoding all msgs takes more than 500 ms
+ display_startup();
#ifndef LL_RELEASE_FOR_DOWNLOAD
gMessageSystem->setTimeDecodes( TRUE ); // Time the decode of each msg
gMessageSystem->setTimeDecodesSpamThreshold( 0.05f ); // Spam if a single msg takes over 50ms to decode
#endif
+ display_startup();
gXferManager->registerCallbacks(gMessageSystem);
+ display_startup();
LLStartUp::initNameCache();
+ display_startup();
// update the voice settings *after* gCacheName initialization
// so that we can construct voice UI that relies on the name cache
LLVoiceClient::getInstance()->updateSettings();
+ display_startup();
//gCacheName is required for nearby chat history loading
//so I just moved nearby history loading a few states further
@@ -1335,12 +1381,14 @@ bool idle_startup()
LLNearbyChat* nearby_chat = LLNearbyChat::getInstance();
if (nearby_chat) nearby_chat->loadHistory();
}
+ display_startup();
// *Note: this is where gWorldMap used to be initialized.
// register null callbacks for audio until the audio system is initialized
gMessageSystem->setHandlerFuncFast(_PREHASH_SoundTrigger, null_message_callback, NULL);
gMessageSystem->setHandlerFuncFast(_PREHASH_AttachedSound, null_message_callback, NULL);
+ display_startup();
//reset statistics
LLViewerStats::getInstance()->resetStats();
@@ -1370,6 +1418,7 @@ bool idle_startup()
LLViewerCamera::getInstance()->setAspect(gViewerWindow->getWorldViewAspectRatio());
// Initialize FOV
LLViewerCamera::getInstance()->setDefaultFOV(gSavedSettings.getF32("CameraAngle"));
+ display_startup();
// Move agent to starting location. The position handed to us by
// the space server is in global coordinates, but the agent frame
@@ -1380,6 +1429,7 @@ bool idle_startup()
gAgent.resetAxes(gAgentStartLookAt);
gAgentCamera.stopCameraAnimation();
gAgentCamera.resetCamera();
+ display_startup();
// Initialize global class data needed for surfaces (i.e. textures)
LL_DEBUGS("AppInit") << "Initializing sky..." << LL_ENDL;
@@ -1392,6 +1442,8 @@ bool idle_startup()
LLGLState::checkStates();
LLGLState::checkTextureChannels();
+ display_startup();
+
LL_DEBUGS("AppInit") << "Decoding images..." << LL_ENDL;
// For all images pre-loaded into viewer cache, decode them.
// Need to do this AFTER we init the sky
@@ -1405,6 +1457,8 @@ bool idle_startup()
}
LLStartUp::setStartupState( STATE_WORLD_WAIT );
+ display_startup();
+
// JC - Do this as late as possible to increase likelihood Purify
// will run.
LLMessageSystem* msg = gMessageSystem;
@@ -1432,6 +1486,7 @@ bool idle_startup()
NULL);
timeout.reset();
+ display_startup();
return FALSE;
}
@@ -1450,8 +1505,10 @@ bool idle_startup()
LLMessageSystem* msg = gMessageSystem;
while (msg->checkAllMessages(gFrameCount, gServicePump))
{
+ display_startup();
}
msg->processAcks();
+ display_startup();
return FALSE;
}
@@ -1462,6 +1519,7 @@ bool idle_startup()
{
LL_DEBUGS("AppInit") << "Connecting to region..." << LL_ENDL;
set_startup_status(0.60f, LLTrans::getString("LoginConnectingToRegion"), gAgent.mMOTD);
+ display_startup();
// register with the message system so it knows we're
// expecting this message
LLMessageSystem* msg = gMessageSystem;
@@ -1477,6 +1535,7 @@ bool idle_startup()
msg->newMessageFast(_PREHASH_EconomyDataRequest);
gAgent.sendReliableMessage();
}
+ display_startup();
// Create login effect
// But not on first login, because you can't see your avatar then
@@ -1491,6 +1550,7 @@ bool idle_startup()
LLStartUp::setStartupState( STATE_AGENT_WAIT ); // Go to STATE_AGENT_WAIT
timeout.reset();
+ display_startup();
return FALSE;
}
@@ -1515,14 +1575,17 @@ bool idle_startup()
LL_DEBUGS("AppInit") << "Awaiting AvatarInitComplete, got "
<< msg->getMessageName() << LL_ENDL;
}
+ display_startup();
}
msg->processAcks();
+ display_startup();
+
if (gAgentMovementCompleted)
{
LLStartUp::setStartupState( STATE_INVENTORY_SEND );
}
-
+ display_startup();
return FALSE;
}
@@ -1531,9 +1594,10 @@ bool idle_startup()
//---------------------------------------------------------------------
if (STATE_INVENTORY_SEND == LLStartUp::getStartupState())
{
+ display_startup();
// Inform simulator of our language preference
LLAgentLanguage::update();
-
+ display_startup();
// unpack thin inventory
LLSD response = LLLoginInstance::getInstance()->getResponse();
//bool dump_buffer = false;
@@ -1548,6 +1612,7 @@ bool idle_startup()
gInventory.setLibraryRootFolderID(id.asUUID());
}
}
+ display_startup();
LLSD inv_lib_owner = response["inventory-lib-owner"];
if(inv_lib_owner.isDefined())
@@ -1559,6 +1624,7 @@ bool idle_startup()
gInventory.setLibraryOwnerID( LLUUID(id.asUUID()));
}
}
+ display_startup();
LLSD inv_skel_lib = response["inventory-skel-lib"];
if(inv_skel_lib.isDefined() && gInventory.getLibraryOwnerID().notNull())
@@ -1568,6 +1634,7 @@ bool idle_startup()
LL_WARNS("AppInit") << "Problem loading inventory-skel-lib" << LL_ENDL;
}
}
+ display_startup();
LLSD inv_skeleton = response["inventory-skeleton"];
if(inv_skeleton.isDefined())
@@ -1577,6 +1644,7 @@ bool idle_startup()
LL_WARNS("AppInit") << "Problem loading inventory-skel-targets" << LL_ENDL;
}
}
+ display_startup();
LLSD inv_basic = response["inventory-basic"];
if(inv_basic.isDefined())
@@ -1614,6 +1682,7 @@ bool idle_startup()
list[agent_id] = new LLRelationship(given_rights, has_rights, false);
}
LLAvatarTracker::instance().addBuddyList(list);
+ display_startup();
}
bool show_hud = false;
@@ -1641,6 +1710,8 @@ bool idle_startup()
//}
}
}
+ display_startup();
+
// Either we want to show tutorial because this is the first login
// to a Linden Help Island or the user quit with the tutorial
// visible. JC
@@ -1648,22 +1719,26 @@ bool idle_startup()
{
LLFloaterReg::showInstance("hud", LLSD(), FALSE);
}
+ display_startup();
LLSD event_notifications = response["event_notifications"];
if(event_notifications.isDefined())
{
gEventNotifier.load(event_notifications);
}
+ display_startup();
LLSD classified_categories = response["classified_categories"];
if(classified_categories.isDefined())
{
LLClassifiedInfo::loadCategories(classified_categories);
}
+ display_startup();
// This method MUST be called before gInventory.findCategoryUUIDForType because of
// gInventory.mIsAgentInvUsable is set to true in the gInventory.buildParentChildMap.
gInventory.buildParentChildMap();
+ display_startup();
//all categories loaded. lets create "My Favorites" category
gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE,true);
@@ -1677,24 +1752,26 @@ bool idle_startup()
LLAvatarTracker::instance().registerCallbacks(msg);
llinfos << " Landmark" << llendl;
LLLandmark::registerCallbacks(msg);
+ display_startup();
// request mute list
llinfos << "Requesting Mute List" << llendl;
LLMuteList::getInstance()->requestFromServer(gAgent.getID());
-
+ display_startup();
// Get L$ and ownership credit information
llinfos << "Requesting Money Balance" << llendl;
LLStatusBar::sendMoneyBalanceRequest();
-
+ display_startup();
// request all group information
llinfos << "Requesting Agent Data" << llendl;
gAgent.sendAgentDataUpdateRequest();
-
+ display_startup();
// Create the inventory views
llinfos << "Creating Inventory Views" << llendl;
LLFloaterReg::getInstance("inventory");
-
+ display_startup();
LLStartUp::setStartupState( STATE_MISC );
+ display_startup();
return FALSE;
}
@@ -1743,17 +1820,23 @@ bool idle_startup()
gSavedSettings.setBOOL("ShowStartLocation", TRUE);
}
+ display_startup();
+
if (gSavedSettings.getBOOL("HelpFloaterOpen"))
{
// show default topic
LLViewerHelp::instance().showTopic("");
}
+ display_startup();
+
// We're successfully logged in.
gSavedSettings.setBOOL("FirstLoginThisInstall", FALSE);
LLFloaterReg::showInitialVisibleInstances();
+ display_startup();
+
// based on the comments, we've successfully logged in so we can delete the 'forced'
// URL that the updater set in settings.ini (in a mostly paranoid fashion)
std::string nextLoginLocation = gSavedSettings.getString( "NextLoginLocation" );
@@ -1767,8 +1850,10 @@ bool idle_startup()
LLUIColorTable::instance().saveUserSettings();
};
+ display_startup();
// JC: Initializing audio requests many sounds for download.
init_audio();
+ display_startup();
// JC: Initialize "active" gestures. This may also trigger
// many gesture downloads, if this is the user's first
@@ -1806,6 +1891,7 @@ bool idle_startup()
LLGestureMgr::instance().startFetch();
}
gDisplaySwapBuffers = TRUE;
+ display_startup();
LLMessageSystem* msg = gMessageSystem;
msg->setHandlerFuncFast(_PREHASH_SoundTrigger, process_sound_trigger);
@@ -1880,8 +1966,10 @@ bool idle_startup()
}
}
+ display_startup();
//DEV-17797. get null folder. Any items found here moved to Lost and Found
LLInventoryModelBackgroundFetch::instance().findLostItems();
+ display_startup();
LLStartUp::setStartupState( STATE_PRECACHE );
timeout.reset();
@@ -1890,6 +1978,7 @@ bool idle_startup()
if (STATE_PRECACHE == LLStartUp::getStartupState())
{
+ display_startup();
F32 timeout_frac = timeout.getElapsedTimeF32()/PRECACHING_DELAY;
// We now have an inventory skeleton, so if this is a user's first
@@ -1906,6 +1995,8 @@ bool idle_startup()
LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender );
}
+ display_startup();
+
// wait precache-delay and for agent's avatar or a lot longer.
if(((timeout_frac > 1.f) && isAgentAvatarValid())
|| (timeout_frac > 3.f))
@@ -1947,6 +2038,8 @@ bool idle_startup()
return TRUE;
}
+ display_startup();
+
if (wearables_time > MAX_WEARABLES_TIME)
{
LLNotificationsUtil::add("ClothingLoading");
@@ -1978,16 +2071,20 @@ bool idle_startup()
}
}
+ display_startup();
update_texture_fetch();
+ display_startup();
set_startup_status(0.9f + 0.1f * wearables_time / MAX_WEARABLES_TIME,
LLTrans::getString("LoginDownloadingClothing").c_str(),
gAgent.mMOTD.c_str());
+ display_startup();
return TRUE;
}
if (STATE_CLEANUP == LLStartUp::getStartupState())
{
set_startup_status(1.0, "", "");
+ display_startup();
// Let the map know about the inventory.
LLFloaterWorldMap* floater_world_map = LLFloaterWorldMap::getInstance();
@@ -2003,6 +2100,7 @@ bool idle_startup()
//gViewerWindow->revealIntroPanel();
gViewerWindow->setStartupComplete();
gViewerWindow->setProgressCancelButtonVisible(FALSE);
+ display_startup();
// We're not away from keyboard, even though login might have taken
// a while. JC
@@ -2038,6 +2136,7 @@ bool idle_startup()
// LLUserAuth::getInstance()->reset();
LLStartUp::setStartupState( STATE_STARTED );
+ display_startup();
// Unmute audio if desired and setup volumes.
// Unmute audio if desired and setup volumes.
@@ -2062,6 +2161,7 @@ bool idle_startup()
LLAgentPicksInfo::getInstance()->requestNumberOfPicks();
LLIMFloater::initIMFloater();
+ display_startup();
return TRUE;
}