diff options
| author | Erik Kundiman <erik@megapahit.org> | 2025-09-29 16:29:19 +0800 | 
|---|---|---|
| committer | Erik Kundiman <erik@megapahit.org> | 2025-10-01 16:56:56 +0800 | 
| commit | a954d290674db08ecaf3c1e6484a0cb6647b88b5 (patch) | |
| tree | 3b672bac3e7d6807cd485ad5f041f69a5c729f46 /indra/newview/llappviewer.cpp | |
| parent | e6eaa7e29990431b5207dbb4f8ae5560cf884acb (diff) | |
| parent | a6d4c1d394eef2cea41f6c6bcd751fec746ec17d (diff) | |
Merge tag 'Second_Life_Release#a6d4c1d3-2025.07' into 2025.07
Diffstat (limited to 'indra/newview/llappviewer.cpp')
| -rw-r--r-- | indra/newview/llappviewer.cpp | 79 | 
1 files changed, 45 insertions, 34 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 98a1fd740b..6422d1befa 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1388,6 +1388,7 @@ bool LLAppViewer::doFrame()  #endif      LL_RECORD_BLOCK_TIME(FTM_FRAME); +    LL_PROFILE_GPU_ZONE("Frame");      {      // and now adjust the visuals from previous frame.      if(LLPerfStats::tunables.userAutoTuneEnabled && LLPerfStats::tunables.tuningFlag != LLPerfStats::Tunables::Nothing) @@ -1477,24 +1478,26 @@ bool LLAppViewer::doFrame()          if (!LLApp::isExiting())          { -            LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df JoystickKeyboard"); -            pingMainloopTimeout("Main:JoystickKeyboard"); - -            // Scan keyboard for movement keys.  Command keys and typing -            // are handled by windows callbacks.  Don't do this until we're -            // done initializing.  JC -            if (gViewerWindow -                && (gHeadlessClient || gViewerWindow->getWindow()->getVisible()) -                && gViewerWindow->getActive() -                && !gViewerWindow->getWindow()->getMinimized() -                && LLStartUp::getStartupState() == STATE_STARTED -                && (gHeadlessClient || !gViewerWindow->getShowProgress()) -                && !gFocusMgr.focusLocked())              { -                LLPerfStats::RecordSceneTime T (LLPerfStats::StatType_t::RENDER_IDLE); -                joystick->scanJoystick(); -                gKeyboard->scanKeyboard(); -                gViewerInput.scanMouse(); +                LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df JoystickKeyboard"); +                pingMainloopTimeout("Main:JoystickKeyboard"); + +                // Scan keyboard for movement keys.  Command keys and typing +                // are handled by windows callbacks.  Don't do this until we're +                // done initializing.  JC +                if (gViewerWindow +                    && (gHeadlessClient || gViewerWindow->getWindow()->getVisible()) +                    && gViewerWindow->getActive() +                    && !gViewerWindow->getWindow()->getMinimized() +                    && LLStartUp::getStartupState() == STATE_STARTED +                    && (gHeadlessClient || !gViewerWindow->getShowProgress()) +                    && !gFocusMgr.focusLocked()) +                { +                    LLPerfStats::RecordSceneTime T(LLPerfStats::StatType_t::RENDER_IDLE); +                    joystick->scanJoystick(); +                    gKeyboard->scanKeyboard(); +                    gViewerInput.scanMouse(); +                }              }              // Update state based on messages, user input, object idle. @@ -3230,17 +3233,6 @@ bool LLAppViewer::initWindow()      LLNotificationsUI::LLNotificationManager::getInstance(); - -#ifdef LL_DARWIN -    //Satisfy both MAINT-3135 (OSX 10.6 and earlier) MAINT-3288 (OSX 10.7 and later) -    LLOSInfo& os_info = LLOSInfo::instance(); -    if (os_info.mMajorVer == 10 && os_info.mMinorVer < 7) -    { -        if ( os_info.mMinorVer == 6 && os_info.mBuild < 8 ) -            gViewerWindow->getWindow()->setOldResize(true); -    } -#endif -      if (gSavedSettings.getBOOL("WindowMaximized"))      {          gViewerWindow->getWindow()->maximize(); @@ -3355,6 +3347,11 @@ LLSD LLAppViewer::getViewerInfo() const      info["VIEWER_VERSION_STR"] = versionInfo.getVersion();      info["CHANNEL"] = versionInfo.getChannel();      info["ADDRESS_SIZE"] = ADDRESS_SIZE; +#if LL_ARM64 +    info["ARCHITECTURE"] = "ARM"; +#else +    info["ARCHITECTURE"] = "x86"; +#endif      std::string build_config = versionInfo.getBuildConfig();      if (build_config != "Release")      { @@ -4490,6 +4487,9 @@ bool LLAppViewer::initCache()      const U32 CACHE_NUMBER_OF_REGIONS_FOR_OBJECTS = 128;      LLVOCache::getInstance()->initCache(LL_PATH_CACHE, CACHE_NUMBER_OF_REGIONS_FOR_OBJECTS, getObjectCacheVersion()); +    // Remove old, stale CEF cache folders +    purgeCefStaleCaches(); +      return true;  } @@ -4514,18 +4514,27 @@ void LLAppViewer::loadKeyBindings()      LLUrlRegistry::instance().setKeybindingHandler(&gViewerInput);  } +// As per GHI #4498, remove old, stale CEF cache folders from previous sessions +void LLAppViewer::purgeCefStaleCaches() +{ +    // TODO: we really shouldn't use a hard coded name for the cache folder here... +    const std::string browser_parent_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "cef_cache"); +    if (LLFile::isdir(browser_parent_cache)) +    { +        // This is a sledgehammer approach - nukes the cef_cache dir entirely +        // which is then recreated the first time a CEF instance creates an +        // individual cache folder. If we ever decide to retain some folders +        // e.g. Search UI cache - then we will need a more granular approach. +        gDirUtilp->deleteDirAndContents(browser_parent_cache); +    } +} +  void LLAppViewer::purgeCache()  {      LL_INFOS("AppCache") << "Purging Cache and Texture Cache..." << LL_ENDL;      LLAppViewer::getTextureCache()->purgeCache(LL_PATH_CACHE);      LLVOCache::getInstance()->removeCache(LL_PATH_CACHE);      LLViewerShaderMgr::instance()->clearShaderCache(); -    std::string browser_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "cef_cache"); -    if (LLFile::isdir(browser_cache)) -    { -        // cef does not support clear_cache and clear_cookies, so clear what we can manually. -        gDirUtilp->deleteDirAndContents(browser_cache); -    }      gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""), "*");  } @@ -5712,6 +5721,8 @@ void LLAppViewer::forceErrorBreakpoint()      DebugBreak();  #elif __i386__ || __x86_64__      asm ("int $3"); +#else +    __builtin_trap();  #endif      return;  }  | 
