Merge viewer-neko

master
Ansariel 2018-03-13 19:48:24 +01:00
commit bcb8dcee52
13 changed files with 113 additions and 47 deletions

View File

@ -199,13 +199,21 @@ void LLAvatarNameCache::requestAvatarNameCache_(std::string url, std::vector<LLU
LL_DEBUGS("AvNameCache") << "Entering coroutine " << LLCoros::instance().getName()
<< " with url '" << url << "', requesting " << agentIds.size() << " Agent Ids" << LL_ENDL;
// Check pointer that can be cleaned up by cleanupClass()
if (!sHttpRequest || !sHttpOptions || !sHttpHeaders)
{
LL_WARNS("AvNameCache") << " Trying to request name cache when http pointers are not initialized." << LL_ENDL;
return;
}
LLSD httpResults;
try
{
bool success = true;
LLCoreHttpUtil::HttpCoroutineAdapter httpAdapter("NameCache", LLAvatarNameCache::sHttpPolicy);
LLSD results = httpAdapter.getAndSuspend(sHttpRequest, url);
LLSD httpResults;
LL_DEBUGS() << results << LL_ENDL;
@ -244,6 +252,7 @@ void LLAvatarNameCache::requestAvatarNameCache_(std::string url, std::vector<LLU
{
LOG_UNHANDLED_EXCEPTION(STRINGIZE("coroutine " << LLCoros::instance().getName()
<< "('" << url << "', " << agentIds.size()
<< " http result: " << httpResults.asString()
<< " Agent Ids)"));
throw;
}
@ -354,6 +363,11 @@ void LLAvatarNameCache::handleAgentError(const LLUUID& agent_id)
void LLAvatarNameCache::processName(const LLUUID& agent_id, const LLAvatarName& av_name)
{
if (agent_id.isNull())
{
return;
}
// Add to the cache
sCache[agent_id] = av_name;

View File

@ -49,6 +49,7 @@ public:
enum EBoostLevel
{
BOOST_NONE = 0,
BOOST_ALM , //acts like NONE when ALM is on, max discard when ALM is off
BOOST_AVATAR_BAKED ,
BOOST_AVATAR ,
BOOST_CLOUDS ,

View File

@ -162,9 +162,9 @@ LLFloaterReporter::LLFloaterReporter(const LLSD& key)
mPosition(),
mCopyrightWarningSeen( FALSE ),
mResourceDatap(new LLResourceData()),
mAvatarNameCacheConnection(),
mSnapshotTimer()
mAvatarNameCacheConnection()
{
gIdleCallbacks.addFunction(onIdle, this);
}
// virtual
@ -228,6 +228,7 @@ LLFloaterReporter::~LLFloaterReporter()
{
mAvatarNameCacheConnection.disconnect();
}
gIdleCallbacks.deleteFunction(onIdle, this);
// child views automatically deleted
mObjectID = LLUUID::null;
@ -245,18 +246,19 @@ LLFloaterReporter::~LLFloaterReporter()
delete mResourceDatap;
}
// virtual
void LLFloaterReporter::draw()
void LLFloaterReporter::onIdle(void* user_data)
{
LLFloater::draw();
static LLCachedControl<F32> screenshot_delay(gSavedSettings, "AbuseReportScreenshotDelay");
if (mSnapshotTimer.getStarted() && mSnapshotTimer.getElapsedTimeF32() > screenshot_delay)
LLFloaterReporter* floater_reporter = (LLFloaterReporter*)user_data;
if (floater_reporter)
{
mSnapshotTimer.stop();
// <FS:Ansariel> Refresh screenshot button
//takeNewSnapshot();
takeNewSnapshot(false);
// </FS:Ansariel>
static LLCachedControl<F32> screenshot_delay(gSavedSettings, "AbuseReportScreenshotDelay");
if (floater_reporter->mSnapshotTimer.getStarted() && floater_reporter->mSnapshotTimer.getElapsedTimeF32() > screenshot_delay)
{
floater_reporter->mSnapshotTimer.stop();
// <FS:Ansariel> Refresh screenshot button
//floater_reporter->takeNewSnapshot();
floater_reporter->takeNewSnapshot(false);
// </FS:Ansariel>
}
}

View File

@ -83,7 +83,8 @@ public:
/*virtual*/ BOOL postBuild();
/*virtual*/ void onOpen(const LLSD& key);
/*virtual*/ void onClose(bool app_quitting);
virtual void draw();
static void onIdle(void* user_data);
void setReportType(EReportType type) { mReportType = type; }

View File

@ -364,17 +364,27 @@ LLViewerInventoryCategory* LLInventoryModel::getCategory(const LLUUID& id) const
bool LLInventoryModel::isCategoryHidden(const LLUUID& id) const
{
bool res = false;
const LLViewerInventoryCategory* category = getCategory(id);
if (category)
{
LLFolderType::EType cat_type = category->getPreferredType();
// <FS:Ansariel> Show inbox folder depending on FSShowInboxFolder setting
//return (cat_type == LLFolderType::FT_INBOX || cat_type == LLFolderType::FT_OUTBOX);
static LLCachedControl<bool> fsShowInboxFolder(gSavedSettings, "FSShowInboxFolder");
return ((cat_type == LLFolderType::FT_INBOX && !fsShowInboxFolder) || cat_type == LLFolderType::FT_OUTBOX);
// </FS:Ansariel>
switch (cat_type)
{
case LLFolderType::FT_INBOX:
// <FS:Ansariel> Show inbox folder depending on FSShowInboxFolder setting
static LLCachedControl<bool> fsShowInboxFolder(gSavedSettings, "FSShowInboxFolder");
return !fsShowIndoxFolder;
// </FS:Ansariel>
case LLFolderType::FT_OUTBOX:
case LLFolderType::FT_MARKETPLACE_LISTINGS:
res = true;
break;
default:
break;
}
}
return false;
return res;
}
S32 LLInventoryModel::getItemCount() const

View File

@ -407,7 +407,11 @@ bool LLPanelWearing::isActionEnabled(const LLSD& userdata)
}
else
{
return mTempItemsList->hasSelectedItem();
LLScrollListItem* item = mTempItemsList->getFirstSelected();
if (item && item->getUUID().notNull())
{
return true;
}
}
}
@ -600,7 +604,7 @@ void LLPanelWearing::onEditAttachment()
void LLPanelWearing::onRemoveAttachment()
{
LLScrollListItem* item = mTempItemsList->getFirstSelected();
if (item)
if (item && item->getUUID().notNull())
{
LLSelectMgr::getInstance()->deselectAll();
LLSelectMgr::getInstance()->selectObjectAndFamily(mAttachmentsMap[item->getUUID()]);

View File

@ -173,9 +173,9 @@ void LLTextureBar::draw()
{
color = LLColor4::green4;
}
else if (mImagep->getBoostLevel() > LLGLTexture::BOOST_NONE)
else if (mImagep->getBoostLevel() > LLGLTexture::BOOST_ALM)
{
color = LLColor4::magenta;
color = LLColor4::magenta; // except none and alm
}
else if (mImagep->getDecodePriority() <= 0.0f)
{

View File

@ -4504,10 +4504,10 @@ void LLViewerObject::setTE(const U8 te, const LLTextureEntry &texture_entry)
if (getTE(te)->getMaterialParams().notNull())
{
const LLUUID& norm_id = getTE(te)->getMaterialParams()->getNormalID();
mTENormalMaps[te] = LLViewerTextureManager::getFetchedTexture(norm_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
mTENormalMaps[te] = LLViewerTextureManager::getFetchedTexture(norm_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_ALM, LLViewerTexture::LOD_TEXTURE);
const LLUUID& spec_id = getTE(te)->getMaterialParams()->getSpecularID();
mTESpecularMaps[te] = LLViewerTextureManager::getFetchedTexture(spec_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
mTESpecularMaps[te] = LLViewerTextureManager::getFetchedTexture(spec_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_ALM, LLViewerTexture::LOD_TEXTURE);
}
}
@ -4631,14 +4631,14 @@ S32 LLViewerObject::setTETexture(const U8 te, const LLUUID& uuid)
S32 LLViewerObject::setTENormalMap(const U8 te, const LLUUID& uuid)
{
LLViewerFetchedTexture *image = (uuid == LLUUID::null) ? NULL : LLViewerTextureManager::getFetchedTexture(
uuid, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, LLHost());
uuid, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_ALM, LLViewerTexture::LOD_TEXTURE, 0, 0, LLHost());
return setTENormalMapCore(te, image);
}
S32 LLViewerObject::setTESpecularMap(const U8 te, const LLUUID& uuid)
{
LLViewerFetchedTexture *image = (uuid == LLUUID::null) ? NULL : LLViewerTextureManager::getFetchedTexture(
uuid, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, LLHost());
uuid, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_ALM, LLViewerTexture::LOD_TEXTURE, 0, 0, LLHost());
return setTESpecularMapCore(te, image);
}

View File

@ -774,6 +774,7 @@ void LLViewerTexture::setBoostLevel(S32 level)
{
mBoostLevel = level;
if(mBoostLevel != LLViewerTexture::BOOST_NONE &&
mBoostLevel != LLViewerTexture::BOOST_ALM &&
mBoostLevel != LLViewerTexture::BOOST_SELECTED &&
mBoostLevel != LLViewerTexture::BOOST_ICON)
{
@ -1667,6 +1668,10 @@ void LLViewerFetchedTexture::processTextureStats()
{
mDesiredDiscardLevel = 0;
}
else if (!LLPipeline::sRenderDeferred && mBoostLevel == LLGLTexture::BOOST_ALM)
{
mDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1;
}
else if (mDontDiscard && mBoostLevel == LLGLTexture::BOOST_ICON)
{
if (mFullWidth > MAX_IMAGE_SIZE_DEFAULT || mFullHeight > MAX_IMAGE_SIZE_DEFAULT)
@ -1959,8 +1964,9 @@ void LLViewerFetchedTexture::updateVirtualSize()
{
if(drawable->isRecentlyVisible())
{
if (getBoostLevel() == LLViewerTexture::BOOST_NONE &&
drawable->getVObj() && drawable->getVObj()->isSelected())
if ((getBoostLevel() == LLViewerTexture::BOOST_NONE || getBoostLevel() == LLViewerTexture::BOOST_ALM)
&& drawable->getVObj()
&& drawable->getVObj()->isSelected())
{
setBoostLevel(LLViewerTexture::BOOST_SELECTED);
}
@ -1977,6 +1983,7 @@ void LLViewerFetchedTexture::updateVirtualSize()
if (getBoostLevel() == LLViewerTexture::BOOST_SELECTED &&
gFrameTimeSeconds - mSelectedTime > SELECTION_RESET_TIME)
{
// Could have been BOOST_ALM, but if user was working with this texture, better keep it as NONE
setBoostLevel(LLViewerTexture::BOOST_NONE);
}
@ -2253,7 +2260,7 @@ bool LLViewerFetchedTexture::updateFetch()
// Load the texture progressively: we try not to rush to the desired discard too fast.
// If the camera is not moving, we do not tweak the discard level notch by notch but go to the desired discard with larger boosted steps
// This mitigates the "textures stay blurry" problem when loading while not killing the texture memory while moving around
S32 delta_level = (mBoostLevel > LLGLTexture::BOOST_NONE) ? 2 : 1;
S32 delta_level = (mBoostLevel > LLGLTexture::BOOST_ALM) ? 2 : 1;
if (current_discard < 0)
{
desired_discard = llmax(desired_discard, getMaxDiscardLevel() - delta_level);
@ -3272,6 +3279,10 @@ void LLViewerLODTexture::processTextureStats()
if (mFullWidth > MAX_IMAGE_SIZE_DEFAULT || mFullHeight > MAX_IMAGE_SIZE_DEFAULT)
mDesiredDiscardLevel = 1; // MAX_IMAGE_SIZE_DEFAULT = 1024 and max size ever is 2048
}
else if (!LLPipeline::sRenderDeferred && mBoostLevel == LLGLTexture::BOOST_ALM)
{
mDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1;
}
else if (mBoostLevel < LLGLTexture::BOOST_HIGH && mMaxVirtualSize <= 10.f)
{
// If the image has not been significantly visible in a while, we don't want it

View File

@ -507,6 +507,12 @@ LLViewerFetchedTexture* LLViewerTextureList::getImage(const LLUUID &image_id,
LLPointer<LLViewerFetchedTexture> imagep = findImage(image_id, get_element_type(boost_priority));
if (!imagep.isNull())
{
if (boost_priority != LLViewerTexture::BOOST_ALM && imagep->getBoostLevel() == LLViewerTexture::BOOST_ALM)
{
// Workaround: we need BOOST_ALM texture for something, 'rise' to NONE
imagep->setDecodePriority(LLViewerTexture::BOOST_NONE);
}
LLViewerFetchedTexture *texture = imagep.get();
if (request_from_host.isOk() &&
!texture->getTargetHost().isOk())

View File

@ -8176,13 +8176,11 @@ void LLVOAvatar::updateMeshTextures()
debugColorizeSubMeshes(i,LLColor4::blue);
}
}
static LLUUID default_alpha_uuid = LLUUID(gSavedSettings.getString("UIImgDefaultAlphaUUID"));
bool hair_alpha_exists = (getImage(TEX_HAIR_ALPHA, 0) && getImage(TEX_HAIR_ALPHA, 0)->getID() != default_alpha_uuid);
// set texture and color of hair manually if we are not using a baked image.
// This can happen while loading hair for yourself, or for clients that did not
// bake a hair texture. Still needed for yourself after 1.22 is depricated.
if (!is_layer_baked[BAKED_HAIR] || (isEditingAppearance() && !hair_alpha_exists))
if (!is_layer_baked[BAKED_HAIR])
{
const LLColor4 color = mTexHairColor ? mTexHairColor->getColor() : LLColor4(1,1,1,1);
LLViewerTexture* hair_img = getImage( TEX_HAIR, 0 );

View File

@ -700,7 +700,13 @@ void LLVivoxVoiceClient::voiceControlCoro()
{
mIsCoroutineActive = true;
LLCoros::set_consuming(true);
while (gAgent.getTeleportState() != LLAgent::TELEPORT_NONE)
{
LL_INFOS("Voice") << "Suspending voiceControlCoro() due to teleport. Tuning: " << mTuningMode << ". Relog: " << mRelogRequested << LL_ENDL;
llcoro::suspendUntilTimeout(1.0);
}
do
{
@ -722,7 +728,7 @@ void LLVivoxVoiceClient::voiceControlCoro()
// and then reconstruct the voice connecion from scratch.
if (mRelogRequested)
{
while (isGatewayRunning())
while (isGatewayRunning() || gAgent.getTeleportState() != LLAgent::TELEPORT_NONE)
{
llcoro::suspendUntilTimeout(1.0);
}
@ -1413,7 +1419,7 @@ bool LLVivoxVoiceClient::addAndJoinSession(const sessionStatePtr_t &nextSession)
mAudioSession = nextSession;
mAudioSessionChanged = true;
if (!mAudioSession->mReconnect)
if (!mAudioSession || !mAudioSession->mReconnect)
{
mNextAudioSession.reset();
}
@ -1421,16 +1427,19 @@ bool LLVivoxVoiceClient::addAndJoinSession(const sessionStatePtr_t &nextSession)
// The old session may now need to be deleted.
reapSession(oldSession);
if (!mAudioSession->mHandle.empty())
if (mAudioSession)
{
// Connect to a session by session handle
if (!mAudioSession->mHandle.empty())
{
// Connect to a session by session handle
sessionMediaConnectSendMessage(mAudioSession);
}
else
{
// Connect to a session by URI
sessionCreateSendMessage(mAudioSession, true, false);
sessionMediaConnectSendMessage(mAudioSession);
}
else
{
// Connect to a session by URI
sessionCreateSendMessage(mAudioSession, true, false);
}
}
notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_JOINING);
@ -1495,6 +1504,11 @@ bool LLVivoxVoiceClient::addAndJoinSession(const sessionStatePtr_t &nextSession)
LL_INFOS("Voice") << "event=" << ll_stream_notation_sd(result) << LL_ENDL;
if (result.has("session"))
{
if (!mAudioSession)
{
LL_WARNS("Voice") << "Message for session handle \"" << result["handle"] << "\" while session is not initialized." << LL_ENDL;
continue;
}
if (result.has("handle") && result["handle"] != mAudioSession->mHandle)
{
LL_WARNS("Voice") << "Message for session handle \"" << result["handle"] << "\" while waiting for \"" << mAudioSession->mHandle << "\"." << LL_ENDL;
@ -1838,6 +1852,11 @@ bool LLVivoxVoiceClient::runSession(const sessionStatePtr_t &session)
{
if (result.has("handle"))
{
if (!mAudioSession)
{
LL_WARNS("Voice") << "Message for session handle \"" << result["handle"] << "\" while session is not initiated." << LL_ENDL;
continue;
}
if (result["handle"] != mAudioSession->mHandle)
{
LL_WARNS("Voice") << "Message for session handle \"" << result["handle"] << "\" while waiting for \"" << mAudioSession->mHandle << "\"." << LL_ENDL;

View File

@ -945,7 +945,7 @@ void LLVOVolume::updateTextureVirtualSize(bool forced)
{
LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE);
LLUUID id = params->getLightTexture();
mLightTexture = LLViewerTextureManager::getFetchedTexture(id);
mLightTexture = LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_ALM);
if (mLightTexture.notNull())
{
F32 rad = getLightRadius();
@ -3275,7 +3275,7 @@ LLViewerTexture* LLVOVolume::getLightTexture()
{
if (mLightTexture.isNull() || id != mLightTexture->getID())
{
mLightTexture = LLViewerTextureManager::getFetchedTexture(id);
mLightTexture = LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_ALM);
}
}
else