diff options
Diffstat (limited to 'indra')
22 files changed, 247 insertions, 79 deletions
diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index f72f47723f..bcb00e6afd 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -1892,7 +1892,10 @@ LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name,                  image_raw->copyUnscaledAlphaMask(alpha_image_raw, LLColor4U::black);              } -            tex->createGLTexture(0, image_raw, 0, true, LLGLTexture::LOCAL); +            if (!tex->createGLTexture(0, image_raw, 0, true, LLGLTexture::LOCAL)) +            { +                LL_WARNS() << "Failed to create GL texture for image: " << file_name << LL_ENDL; +            }              gGL.getTexUnit(0)->bind(tex);              tex->setAddressMode(LLTexUnit::TAM_CLAMP); diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp index 30551c115d..dd2499cf37 100644 --- a/indra/llappearance/lltexlayerparams.cpp +++ b/indra/llappearance/lltexlayerparams.cpp @@ -338,7 +338,10 @@ bool LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)                  // Create the GL texture, and then hang onto it for future use.                  if (mNeedsCreateTexture)                  { -                    mCachedProcessedTexture->createGLTexture(0, mStaticImageRaw); +                    if (!mCachedProcessedTexture->createGLTexture(0, mStaticImageRaw)) +                    { +                        LL_WARNS() << "Failed to create GL texture for image: " << mCachedProcessedTexture->getID() << LL_ENDL; +                    }                      mNeedsCreateTexture = false;                      gGL.getTexUnit(0)->bind(mCachedProcessedTexture);                      mCachedProcessedTexture->setAddressMode(LLTexUnit::TAM_CLAMP); diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp index d6ab52a17a..3deee2fb3e 100644 --- a/indra/llplugin/llpluginprocessparent.cpp +++ b/indra/llplugin/llpluginprocessparent.cpp @@ -985,15 +985,18 @@ void LLPluginProcessParent::poll(F64 timeout)          }      } -    // Remove instances in the done state from the sInstances map. -    LLCoros::LockType lock(*sInstancesMutex); -    mapInstances_t::iterator itClean = sInstances.begin(); -    while (itClean != sInstances.end()) +    if (sInstancesMutex)      { -        if ((*itClean).second->isDone()) -            itClean = sInstances.erase(itClean); -        else -            ++itClean; +        // Remove instances in the done state from the sInstances map. +        LLCoros::LockType lock(*sInstancesMutex); +        mapInstances_t::iterator itClean = sInstances.begin(); +        while (itClean != sInstances.end()) +        { +            if ((*itClean).second->isDone()) +                itClean = sInstances.erase(itClean); +            else +                ++itClean; +        }      }  } diff --git a/indra/llrender/llcubemap.cpp b/indra/llrender/llcubemap.cpp index 53691bafe2..c52f68d298 100644 --- a/indra/llrender/llcubemap.cpp +++ b/indra/llrender/llcubemap.cpp @@ -86,7 +86,10 @@ void LLCubeMap::initGL()              #endif                  mImages[i]->setTarget(mTargets[i], LLTexUnit::TT_CUBE_MAP);                  mRawImages[i] = new LLImageRaw(RESOLUTION, RESOLUTION, 4); -                mImages[i]->createGLTexture(0, mRawImages[i], texname); +                if (!mImages[i]->createGLTexture(0, mRawImages[i], texname)) +                { +                    LL_WARNS() << "Failed to create GL texture for environment cubemap face " << i << LL_ENDL; +                }                  gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_CUBE_MAP, texname);                  mImages[i]->setAddressMode(LLTexUnit::TAM_CLAMP); @@ -203,7 +206,10 @@ void LLCubeMap::initEnvironmentMap(const std::vector<LLPointer<LLImageRaw> >& ra          mImages[i] = new LLImageGL(resolution, resolution, components, true);          mImages[i]->setTarget(mTargets[i], LLTexUnit::TT_CUBE_MAP);          mRawImages[i] = rawimages[i]; -        mImages[i]->createGLTexture(0, mRawImages[i], texname); +        if (!mImages[i]->createGLTexture(0, mRawImages[i], texname)) +        { +            LL_WARNS() << "Failed to create GL texture for environment cubemap face " << i << LL_ENDL; +        }          gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_CUBE_MAP, texname);          mImages[i]->setAddressMode(LLTexUnit::TAM_CLAMP); diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp index d453ad0c7b..7c2481a94c 100644 --- a/indra/llwebrtc/llwebrtc.cpp +++ b/indra/llwebrtc/llwebrtc.cpp @@ -588,14 +588,20 @@ void LLWebRTCImpl::workerDeployDevices()  void LLWebRTCImpl::setCaptureDevice(const std::string &id)  { -    mRecordingDevice = id; -    deployDevices(); +    if (mRecordingDevice != id) +    { +        mRecordingDevice = id; +        deployDevices(); +    }  }  void LLWebRTCImpl::setRenderDevice(const std::string &id)  { -    mPlayoutDevice = id; -    deployDevices(); +    if (mPlayoutDevice != id) +    { +        mPlayoutDevice = id; +        deployDevices(); +    }  }  // updateDevices needs to happen on the worker thread. diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 1cd58b7101..abea7926ee 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -167,7 +167,7 @@ std::map<S32, std::string> LLTeleportRequest::sTeleportStatusName = { { kPending  class LLTeleportRequestViaLandmark : public LLTeleportRequest  {  public: -    LLTeleportRequestViaLandmark(const LLUUID &pLandmarkId); +    LLTeleportRequestViaLandmark(const LLUUID &pLandmarkId, bool log = true);      virtual ~LLTeleportRequestViaLandmark();      virtual void toOstream(std::ostream& os) const; @@ -179,6 +179,7 @@ public:  protected:      inline const LLUUID &getLandmarkId() const {return mLandmarkId;}; +    bool mLogOnDestruction = true;  private:      LLUUID mLandmarkId; @@ -5022,16 +5023,25 @@ void LLTeleportRequest::toOstream(std::ostream& os) const  //-----------------------------------------------------------------------------  // LLTeleportRequestViaLandmark  //----------------------------------------------------------------------------- -LLTeleportRequestViaLandmark::LLTeleportRequestViaLandmark(const LLUUID &pLandmarkId) -    : LLTeleportRequest(), -    mLandmarkId(pLandmarkId) +LLTeleportRequestViaLandmark::LLTeleportRequestViaLandmark(const LLUUID &pLandmarkId, bool log) +    : LLTeleportRequest() +    , mLandmarkId(pLandmarkId) +    , mLogOnDestruction(true)  { -    LL_INFOS("Teleport") << "LLTeleportRequestViaLandmark created, " << *this << LL_ENDL; +    if (log) +    { +        // Workaround to not log twice for LLTeleportRequestViaLure, besides this wouldn't have logged fully. +        LL_INFOS("Teleport") << "LLTeleportRequestViaLandmark created, " << *this << LL_ENDL; +    }  }  LLTeleportRequestViaLandmark::~LLTeleportRequestViaLandmark()  { -    LL_INFOS("Teleport") << "~LLTeleportRequestViaLandmark, " << *this << LL_ENDL; +    if (mLogOnDestruction) +    { +        // Workaround to not crash on toOstream for derived classes and to not log twice. +        LL_INFOS("Teleport") << "~LLTeleportRequestViaLandmark, " << *this << LL_ENDL; +    }  }  void LLTeleportRequestViaLandmark::toOstream(std::ostream& os) const @@ -5061,16 +5071,20 @@ void LLTeleportRequestViaLandmark::restartTeleport()  // LLTeleportRequestViaLure  //----------------------------------------------------------------------------- -LLTeleportRequestViaLure::LLTeleportRequestViaLure(const LLUUID &pLureId, bool pIsLureGodLike) -    : LLTeleportRequestViaLandmark(pLureId), +LLTeleportRequestViaLure::LLTeleportRequestViaLure(const LLUUID& pLureId, bool pIsLureGodLike) +    : LLTeleportRequestViaLandmark(pLureId, false),      mIsLureGodLike(pIsLureGodLike)  { -    LL_INFOS("Teleport") << "LLTeleportRequestViaLure created" << LL_ENDL; +    LL_INFOS("Teleport") << "LLTeleportRequestViaLure created: " << *this << LL_ENDL;  }  LLTeleportRequestViaLure::~LLTeleportRequestViaLure()  { -    LL_INFOS("Teleport") << "~LLTeleportRequestViaLure" << LL_ENDL; +    if (mLogOnDestruction) +    { +        LL_INFOS("Teleport") << "~LLTeleportRequestViaLure: " << *this << LL_ENDL; +        mLogOnDestruction = false; +    }  }  void LLTeleportRequestViaLure::toOstream(std::ostream& os) const diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index c9470fe977..ea2bc74daa 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -802,7 +802,10 @@ void LLBumpImageList::onSourceStandardLoaded( bool success, LLViewerFetchedTextu          }          src_vi->setExplicitFormat(GL_RGBA, GL_RGBA);          { -            src_vi->createGLTexture(src_vi->getDiscardLevel(), nrm_image); +            if (!src_vi->createGLTexture(src_vi->getDiscardLevel(), nrm_image)) +            { +                LL_WARNS() << "Failed to create bump image texture for image " << src_vi->getID() << LL_ENDL; +            }          }      }  } @@ -896,7 +899,10 @@ void LLBumpImageList::onSourceUpdated(LLViewerTexture* src, EBumpEffect bump_cod          LLImageGL* src_img = src->getGLTexture();          LLImageGL* dst_img = bump->getGLTexture(); -        dst_img->setSize(src->getWidth(), src->getHeight(), 4, 0); +        if (!dst_img->setSize(src->getWidth(), src->getHeight(), 4, 0)) +        { +            LL_WARNS() << "Failed to setSize for image " << bump->getID() << LL_ENDL; +        }          dst_img->setUseMipMaps(true);          dst_img->setDiscardLevel(0);          dst_img->createGLTexture(); diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 2bbe5e90c6..b7ad8f21d9 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -465,7 +465,7 @@ bool LLFeatureManager::loadGPUClass()          }      #if LL_WINDOWS -        const F32Gigabytes MIN_PHYSICAL_MEMORY(2); +        const F32Gigabytes MIN_PHYSICAL_MEMORY(8);          LLMemory::updateMemoryInfo();          F32Gigabytes physical_mem = LLMemory::getMaxMemKB(); diff --git a/indra/newview/llfloateravatarwelcomepack.cpp b/indra/newview/llfloateravatarwelcomepack.cpp index 82e44d1398..be384bf4d1 100644 --- a/indra/newview/llfloateravatarwelcomepack.cpp +++ b/indra/newview/llfloateravatarwelcomepack.cpp @@ -28,8 +28,10 @@  #include "llviewerprecompiledheaders.h"  #include "llfloateravatarwelcomepack.h" -#include "lluictrlfactory.h"  #include "llmediactrl.h" +#include "lluictrlfactory.h" +#include "llviewercontrol.h" +#include "llweb.h"  LLFloaterAvatarWelcomePack::LLFloaterAvatarWelcomePack(const LLSD& key)      :   LLFloater(key) @@ -52,6 +54,10 @@ bool LLFloaterAvatarWelcomePack::postBuild()      if (mAvatarPicker)      {          mAvatarPicker->clearCache(); +        mAvatarPicker->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL")); +        std::string url = gSavedSettings.getString("AvatarWelcomePack"); +        url = LLWeb::expandURLSubstitutions(url, LLSD()); +        mAvatarPicker->navigateTo(url, HTTP_CONTENT_TEXT_HTML);      }      return true; diff --git a/indra/newview/llfloaterdestinations.cpp b/indra/newview/llfloaterdestinations.cpp index fad9693e8f..84fc4afcdd 100644 --- a/indra/newview/llfloaterdestinations.cpp +++ b/indra/newview/llfloaterdestinations.cpp @@ -28,7 +28,10 @@  #include "llviewerprecompiledheaders.h"  #include "llfloaterdestinations.h" +#include "llmediactrl.h"  #include "lluictrlfactory.h" +#include "llviewercontrol.h" +#include "llweb.h"  LLFloaterDestinations::LLFloaterDestinations(const LLSD& key) @@ -43,6 +46,15 @@ LLFloaterDestinations::~LLFloaterDestinations()  bool LLFloaterDestinations::postBuild()  {      enableResizeCtrls(true, true, false); +    LLMediaCtrl* destinations = getChild<LLMediaCtrl>("destination_guide_contents"); +    destinations->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL")); +    std::string url = gSavedSettings.getString("DestinationGuideURL"); +    url = LLWeb::expandURLSubstitutions(url, LLSD()); +    destinations->navigateTo(url, HTTP_CONTENT_TEXT_HTML); + +    // If cookie is there, will set it now. Otherwise will have to wait for login completion +    // which will also update destinations instance if it already exists. +    LLViewerMedia::getInstance()->getOpenIDCookie(destinations);      return true;  } diff --git a/indra/newview/llfloatermarketplace.cpp b/indra/newview/llfloatermarketplace.cpp index 4abea64302..d626786591 100644 --- a/indra/newview/llfloatermarketplace.cpp +++ b/indra/newview/llfloatermarketplace.cpp @@ -49,6 +49,13 @@ bool LLFloaterMarketplace::postBuild()      LLFloaterWebContent::postBuild();      mWebBrowser = getChild<LLMediaCtrl>("marketplace_contents");      mWebBrowser->addObserver(this); +    mWebBrowser->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL")); +    std::string url = gSavedSettings.getString("MarketplaceURL"); +    mWebBrowser->navigateTo(url, HTTP_CONTENT_TEXT_HTML); + +    // If cookie is there, will set it now, Otherwise will have to wait for login completion +    // which will also update marketplace instance if it already exists. +    LLViewerMedia::getInstance()->getOpenIDCookie(mWebBrowser);      return true;  } diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index 7ee1b88f05..ec9af865cf 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -170,6 +170,12 @@ bool LLFloaterSearch::postBuild()      LLFloaterWebContent::postBuild();      mWebBrowser = getChild<LLMediaCtrl>("search_contents");      mWebBrowser->addObserver(this); +    mWebBrowser->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL")); + +    // If cookie is there, will set it now, Otherwise will have to wait for login completion +    // which will also update search instance if it already exists. +    LLViewerMedia::getInstance()->getOpenIDCookie(mWebBrowser); +      getChildView("address")->setEnabled(false);      getChildView("popexternal")->setEnabled(false); diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index a99c9df0ff..6e56aac270 100644 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -219,7 +219,10 @@ bool LLLocalBitmap::updateSelf(EUpdateType optional_firstupdate)                      LLPointer<LLViewerFetchedTexture> texture = new LLViewerFetchedTexture                          ("file://"+mFilename, FTT_LOCAL_FILE, mWorldID, LL_LOCAL_USE_MIPMAPS); -                    texture->createGLTexture(LL_LOCAL_DISCARD_LEVEL, raw_image); +                    if (!texture->createGLTexture(LL_LOCAL_DISCARD_LEVEL, raw_image)) +                    { +                        LL_WARNS() << "Failed to create GL texture for local bitmap: " << mFilename << " " << mWorldID << LL_ENDL; +                    }                      texture->ref();                      gTextureList.addImage(texture, TEX_LIST_STANDARD); diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index e171136ffa..758e91f6c9 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -2073,7 +2073,6 @@ bool LLSelectMgr::selectionSetGLTFMaterial(const LLUUID& mat_id)              objectp->clearTEWaterExclusion(te);              // Blank out most override data on the object and send to server -            objectp->setRenderMaterialID(te, asset_id);              if (should_preserve_transforms && preserved_override)              {                  // Apply material with preserved transforms diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index d0c0bdb5ce..f78ff2226c 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -1537,7 +1537,7 @@ void LLToolDragAndDrop::dropMaterialAllFaces(LLViewerObject* hit_obj,              }              else              { -                hit_obj->setRenderMaterialID(te, asset_id, false, true); +                hit_obj->setRenderMaterialID(te, asset_id);              }          }      } diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 4a4a43c2b9..314e32bffd 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -240,8 +240,11 @@ void display_stats()      if (gRecentFPSTime.getElapsedTimeF32() >= FPS_LOG_FREQUENCY)      {          LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("DS - FPS"); +        LLTrace::Recording& recording = LLTrace::get_frame_recording().getLastRecording(); +        F64 normalized_session_jitter = recording.getLastValue(LLStatViewer::NOTRMALIZED_FRAMETIME_JITTER_SESSION); +        F64 normalized_period_jitter = recording.getLastValue(LLStatViewer::NORMALIZED_FRAMTIME_JITTER_PERIOD);          F32 fps = gRecentFrameCount / FPS_LOG_FREQUENCY; -        LL_INFOS() << llformat("FPS: %.02f", fps) << LL_ENDL; +        LL_INFOS() << llformat("FPS: %.02f SESSION JITTER: %.4f PERIOD JITTER: %.4f", fps, normalized_session_jitter, normalized_period_jitter) << LL_ENDL;          gRecentFrameCount = 0;          gRecentFPSTime.reset();      } diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 10a29f3fb2..acf584616c 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -83,6 +83,8 @@ extern bool gCubeSnapshot;  // *TODO: Consider enabling mipmaps (they have been disabled for a long time). Likely has a significant performance impact for tiled/high texture repeat media. Mip generation in a shader may also be an option if necessary.  constexpr bool USE_MIPMAPS = false; +constexpr S32 MAX_MEDIA_INSTANCES_DEFAULT = 8; +constexpr S32 MEDIA_INSTANCES_MIN_LIMIT = 6; // 4 'permanent' floaters plus reserve for dynamic ones  void init_threaded_picker_load_dialog(LLPluginClassMedia* plugin, LLFilePicker::ELoadFilter filter, bool get_multiple)  { @@ -214,6 +216,7 @@ static bool sViewerMediaMuteListObserverInitialized = false;  LLViewerMedia::LLViewerMedia():  mAnyMediaShowing(false),  mAnyMediaPlaying(false), +mMaxIntances(MAX_MEDIA_INSTANCES_DEFAULT),  mSpareBrowserMediaSource(NULL)  {  } @@ -222,6 +225,7 @@ LLViewerMedia::~LLViewerMedia()  {      gIdleCallbacks.deleteFunction(LLViewerMedia::onIdle, NULL);      mTeleportFinishConnection.disconnect(); +    mMaxInstancesConnection.disconnect();      if (mSpareBrowserMediaSource != NULL)      {          delete mSpareBrowserMediaSource; @@ -235,6 +239,35 @@ void LLViewerMedia::initSingleton()      gIdleCallbacks.addFunction(LLViewerMedia::onIdle, NULL);      mTeleportFinishConnection = LLViewerParcelMgr::getInstance()->          setTeleportFinishedCallback(boost::bind(&LLViewerMedia::onTeleportFinished, this)); + +    LLControlVariable* ctrl = gSavedSettings.getControl("PluginInstancesTotal"); +    if (ctrl) +    { +        setMaxInstances(ctrl->getValue().asInteger()); +        mMaxInstancesConnection = ctrl->getSignal()->connect([this](LLControlVariable* control, const LLSD& new_val, const LLSD& old_val) +        { +            setMaxInstances(new_val.asInteger()); +        }); +    } +    else +    { +        setMaxInstances(MAX_MEDIA_INSTANCES_DEFAULT); +    } +} + +void LLViewerMedia::setMaxInstances(S32 max_instances) +{ +    const F32Gigabytes MIN_PHYSICAL_MEMORY(8); +    LLMemory::updateMemoryInfo(); +    F32Gigabytes physical_mem = LLMemory::getMaxMemKB(); +    if (MIN_PHYSICAL_MEMORY > physical_mem) +    { +        mMaxIntances = llmax(max_instances - 2, MEDIA_INSTANCES_MIN_LIMIT); +    } +    else +    { +        mMaxIntances = llmax(max_instances, MEDIA_INSTANCES_MIN_LIMIT); +    }  }  ////////////////////////////////////////////////////////////////////////////////////////// @@ -688,7 +721,6 @@ void LLViewerMedia::updateMedia(void *dummy_arg)      static LLCachedControl<bool> inworld_media_enabled(gSavedSettings, "AudioStreamingMedia", true);      static LLCachedControl<bool> inworld_audio_enabled(gSavedSettings, "AudioStreamingMusic", true); -    static LLCachedControl<U32> max_instances(gSavedSettings, "PluginInstancesTotal", 8);      static LLCachedControl<U32> max_normal(gSavedSettings, "PluginInstancesNormal", 2);      static LLCachedControl<U32> max_low(gSavedSettings, "PluginInstancesLow", 4);      static LLCachedControl<F32> max_cpu(gSavedSettings, "PluginInstancesCPULimit", 0.9); @@ -709,7 +741,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg)              LLPluginClassMedia::EPriority new_priority = LLPluginClassMedia::PRIORITY_NORMAL; -            if(pimpl->isForcedUnloaded() || (impl_count_total >= (int)max_instances)) +            if(pimpl->isForcedUnloaded() || (impl_count_total >= mMaxIntances))              {                  // Never load muted or failed impls.                  // Hard limit on the number of instances that will be loaded at one time @@ -869,7 +901,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg)      sLowestLoadableImplInterest = 0.0f;      // Only do this calculation if we've hit the impl count limit -- up until that point we always need to load media data. -    if(lowest_interest_loadable && (impl_count_total >= (int)max_instances)) +    if(lowest_interest_loadable && (impl_count_total >= mMaxIntances))      {          // Get the interest value of this impl's object for use by isInterestingEnough          LLVOVolume *object = lowest_interest_loadable->getSomeObject(); @@ -1201,6 +1233,54 @@ LLCore::HttpHeaders::ptr_t LLViewerMedia::getHttpHeaders()      return headers;  } +bool LLViewerMedia::getOpenIDCookie(LLMediaCtrl* media_instance) const +{ +    if (mOpenIDCookie.empty()) +    { +        return false; +    } + +    std::string authority = mOpenIDURL.mAuthority; +    std::string::size_type hostStart = authority.find('@'); +    if (hostStart == std::string::npos) +    { +        // no username/password +        hostStart = 0; +    } +    else +    { +        // Hostname starts after the @. +        // (If the hostname part is empty, this may put host_start at the end of the string.  In that case, it will end up passing through an empty hostname, which is correct.) +        ++hostStart; +    } +    std::string::size_type hostEnd = authority.rfind(':'); +    if ((hostEnd == std::string::npos) || (hostEnd < hostStart)) +    { +        // no port +        hostEnd = authority.size(); +    } + +    std::string cookie_host = authority.substr(hostStart, hostEnd - hostStart); +    std::string cookie_name = ""; +    std::string cookie_value = ""; +    std::string cookie_path = ""; +    bool httponly = true; +    bool secure = true; +    if (!parseRawCookie(mOpenIDCookie, cookie_name, cookie_value, cookie_path, httponly, secure)) +    { +        return false; +    } +    std::string cefUrl(std::string(mOpenIDURL.mURI) + "://" + std::string(mOpenIDURL.mAuthority)); +    if (media_instance && media_instance->getMediaPlugin()) +    { +        media_instance->getMediaPlugin()->setCookie(cefUrl, cookie_name, cookie_value, cookie_host, +            cookie_path, httponly, secure); + +        media_instance->getMediaPlugin()->storeOpenIDCookie(cefUrl, cookie_name, cookie_value, +            cookie_host, cookie_path, httponly, secure); +    } +    return true; +}  /////////////////////////////////////////////////////////////////////////////////////////  void LLViewerMedia::setOpenIDCookie(const std::string& url) @@ -1267,7 +1347,7 @@ void LLViewerMedia::getOpenIDCookieCoro(std::string url)                  bool secure = true;                  LLViewerMedia* inst = getInstance(); -                if (inst->parseRawCookie(inst->mOpenIDCookie, cookie_name, cookie_value, cookie_path, httponly, secure)) +                if (parseRawCookie(inst->mOpenIDCookie, cookie_name, cookie_value, cookie_path, httponly, secure))                  {                      // MAINT-5711 - inexplicably, the CEF setCookie function will no longer set the cookie if the                      // url and domain are not the same. This used to be my.sl.com and id.sl.com respectively and worked. @@ -1290,14 +1370,18 @@ void LLViewerMedia::getOpenIDCookieCoro(std::string url)                      };                      for (MediaCookieInstance mci : media_cookie_instances)                      { -                        LLMediaCtrl* media_instance = LLFloaterReg::getInstance(mci.floater_name)->getChild<LLMediaCtrl>(mci.browser_name); -                        if (media_instance && media_instance->getMediaPlugin()) +                        LLFloater *floaterp = LLFloaterReg::findInstance(mci.floater_name); +                        if (floaterp)                          { -                            media_instance->getMediaPlugin()->setCookie(cefUrl, cookie_name, cookie_value, cookie_host, -                                cookie_path, httponly, secure); - -                            media_instance->getMediaPlugin()->storeOpenIDCookie(cefUrl, cookie_name, cookie_value, -                                cookie_host, cookie_path, httponly, secure); +                            LLMediaCtrl* media_instance = floaterp->getChild<LLMediaCtrl>(mci.browser_name); +                            if (media_instance && media_instance->getMediaPlugin()) +                            { +                                media_instance->getMediaPlugin()->setCookie(cefUrl, cookie_name, cookie_value, cookie_host, +                                    cookie_path, httponly, secure); + +                                media_instance->getMediaPlugin()->storeOpenIDCookie(cefUrl, cookie_name, cookie_value, +                                    cookie_host, cookie_path, httponly, secure); +                            }                          }                      }                  } @@ -3018,7 +3102,10 @@ void LLViewerMediaImpl::doMediaTexUpdate(LLViewerMediaTexture* media_tex, U8* da      // -Cosmic,2023-04-04      // Allocate GL texture based on LLImageRaw but do NOT copy to GL      LLGLuint tex_name = 0; -    media_tex->createGLTexture(0, raw, 0, true, LLGLTexture::OTHER, true, &tex_name); +    if (!media_tex->createGLTexture(0, raw, 0, true, LLGLTexture::OTHER, true, &tex_name)) +    { +        LL_WARNS("Media") << "Failed to create media texture" << LL_ENDL; +    }      // copy just the subimage covered by the image raw to GL      media_tex->setSubImage(data, data_width, data_height, x_pos, y_pos, width, height, tex_name); @@ -3087,7 +3174,10 @@ LLViewerMediaTexture* LLViewerMediaImpl::updateMediaImage()              mMediaSource->getTextureFormatSwapBytes());          int discard_level = 0; -        media_tex->createGLTexture(discard_level, raw); +        if (!media_tex->createGLTexture(discard_level, raw)) +        { +            LL_WARNS("Media") << "Failed to create media texture" << LL_ENDL; +        }          // MEDIAOPT: set this dynamically on play/stop          // FIXME diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index c17cf59815..1fc5bbc9e0 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -69,6 +69,7 @@ private:  };  class LLViewerMediaImpl; +class LLMediaCtrl;  class LLViewerMedia: public LLSingleton<LLViewerMedia>  { @@ -162,22 +163,26 @@ public:      LLSD getHeaders();      LLCore::HttpHeaders::ptr_t getHttpHeaders(); +    bool getOpenIDCookie(LLMediaCtrl* media_instance) const;  private:      void onAuthSubmit(const LLSD& notification, const LLSD& response); -    bool parseRawCookie(const std::string raw_cookie, std::string& name, std::string& value, std::string& path, bool& httponly, bool& secure); +    static bool parseRawCookie(const std::string raw_cookie, std::string& name, std::string& value, std::string& path, bool& httponly, bool& secure);      void setOpenIDCookie(const std::string& url);      void onTeleportFinished();      static void openIDSetupCoro(std::string openidUrl, std::string openidToken);      static void getOpenIDCookieCoro(std::string url); +    void setMaxInstances(S32 max_instances);      bool mAnyMediaShowing;      bool mAnyMediaPlaying; +    S32 mMaxIntances = 8;      LLURL mOpenIDURL;      std::string mOpenIDCookie;      LLPluginClassMedia* mSpareBrowserMediaSource;      boost::signals2::connection mTeleportFinishConnection; +    boost::signals2::connection mMaxInstancesConnection;  };  // Implementation functions not exported into header file diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index cd6cf869ae..c54feba06b 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3159,7 +3159,10 @@ void process_crossed_region(LLMessageSystem* msg, void**)          return;      }      LL_INFOS("Messaging") << "process_crossed_region()" << LL_ENDL; -    gAgentAvatarp->resetRegionCrossingTimer(); +    if (isAgentAvatarValid()) +    { +        gAgentAvatarp->resetRegionCrossingTimer(); +    }      U32 sim_ip;      msg->getIPAddrFast(_PREHASH_RegionData, _PREHASH_SimIP, sim_ip); diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index 011269d7ee..1ac8b2f66b 100644 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -229,6 +229,9 @@ extern LLTrace::EventStatHandle<F64Seconds >    AVATAR_EDIT_TIME,  extern LLTrace::EventStatHandle<LLUnit<F32, LLUnits::Percent> > OBJECT_CACHE_HIT_RATE; +extern LLTrace::SampleStatHandle<F64> NOTRMALIZED_FRAMETIME_JITTER_SESSION; +extern LLTrace::SampleStatHandle<F64> NORMALIZED_FRAMTIME_JITTER_PERIOD; +  }  class LLViewerStats : public LLSingleton<LLViewerStats> diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index b669ec2c31..c7513ded62 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -406,7 +406,10 @@ void LLViewerTextureManager::init()              }          }      } -    imagep->createGLTexture(0, image_raw); +    if (!imagep->createGLTexture(0, image_raw)) +    { +        LL_WARNS() << "Failed to create default texture " << IMG_DEFAULT << LL_ENDL; +    }      image_raw = NULL;  #else      LLViewerFetchedTexture::sDefaultImagep = LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT, true, LLGLTexture::BOOST_UI); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index bcd6ba4ec2..ef24bcf598 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2324,36 +2324,23 @@ void LLViewerWindow::initWorldUI()          gToolBarView->setVisible(true);      } -    if (!gNonInteractive) +    // Don't preload cef instances on low end hardware +    const F32Gigabytes MIN_PHYSICAL_MEMORY(8); +    F32Gigabytes physical_mem = LLMemory::getMaxMemKB(); +    if (physical_mem <= 0)      { -        LLMediaCtrl* destinations = LLFloaterReg::getInstance("destinations")->getChild<LLMediaCtrl>("destination_guide_contents"); -        if (destinations) -        { -            destinations->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL")); -            std::string url = gSavedSettings.getString("DestinationGuideURL"); -            url = LLWeb::expandURLSubstitutions(url, LLSD()); -            destinations->navigateTo(url, HTTP_CONTENT_TEXT_HTML); -        } -        LLMediaCtrl* avatar_welcome_pack = LLFloaterReg::getInstance("avatar_welcome_pack")->findChild<LLMediaCtrl>("avatar_picker_contents"); -        if (avatar_welcome_pack) -        { -            avatar_welcome_pack->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL")); -            std::string url = gSavedSettings.getString("AvatarWelcomePack"); -            url = LLWeb::expandURLSubstitutions(url, LLSD()); -            avatar_welcome_pack->navigateTo(url, HTTP_CONTENT_TEXT_HTML); -        } -        LLMediaCtrl* search = LLFloaterReg::getInstance("search")->findChild<LLMediaCtrl>("search_contents"); -        if (search) -        { -            search->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL")); -        } -        LLMediaCtrl* marketplace = LLFloaterReg::getInstance("marketplace")->getChild<LLMediaCtrl>("marketplace_contents"); -        if (marketplace) -        { -            marketplace->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL")); -            std::string url = gSavedSettings.getString("MarketplaceURL"); -            marketplace->navigateTo(url, HTTP_CONTENT_TEXT_HTML); -        } +        LLMemory::updateMemoryInfo(); +        physical_mem = LLMemory::getMaxMemKB(); +    } + +    if (!gNonInteractive && physical_mem > MIN_PHYSICAL_MEMORY) +    { +        LL_INFOS() << "Preloading cef instances" << LL_ENDL; + +        LLFloaterReg::getInstance("destinations"); +        LLFloaterReg::getInstance("avatar_welcome_pack"); +        LLFloaterReg::getInstance("search"); +        LLFloaterReg::getInstance("marketplace");      }  }  | 
