From 4cdf3961253b49093bf3e2fceda0099cedef4295 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 28 Oct 2011 17:48:24 -0400 Subject: STORM-591 As a music fan, I want audio to fade in gently so my immersion is increased Co-written with Robin Cornelius --- indra/newview/app_settings/settings.xml | 22 ++ indra/newview/lloverlaybar.cpp | 378 -------------------------------- indra/newview/lloverlaybar.h | 95 -------- indra/newview/llpanelnearbymedia.cpp | 24 +- indra/newview/llpanelnearbymedia.h | 1 - indra/newview/llvieweraudio.cpp | 211 +++++++++++++++++- indra/newview/llvieweraudio.h | 41 ++++ indra/newview/llviewermedia.cpp | 22 +- indra/newview/llviewerparcelmgr.cpp | 55 +++-- 9 files changed, 320 insertions(+), 529 deletions(-) delete mode 100644 indra/newview/lloverlaybar.cpp delete mode 100644 indra/newview/lloverlaybar.h (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 3c53a9d44c..c7300cc1bb 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -192,6 +192,28 @@ Value 1 + AudioMusicFadeIn + + Comment + Fade in time in seconds for music streams + Persist + 1 + Type + F32 + Value + 5.0 + + AudioMusicFadeOut + + Comment + Fade out time in seconds for music streams + Persist + 1 + Type + F32 + Value + 5.0 + AudioLevelAmbient Comment diff --git a/indra/newview/lloverlaybar.cpp b/indra/newview/lloverlaybar.cpp deleted file mode 100644 index c2bbec0470..0000000000 --- a/indra/newview/lloverlaybar.cpp +++ /dev/null @@ -1,378 +0,0 @@ -/** - * @file lloverlaybar.cpp - * @brief LLOverlayBar class implementation - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -// Temporary buttons that appear at the bottom of the screen when you -// are in a mode. - -#include "llviewerprecompiledheaders.h" - -#include "lloverlaybar.h" - -#include "llaudioengine.h" -#include "llrender.h" -#include "llagent.h" -#include "llbutton.h" -#include "llfocusmgr.h" -#include "llimview.h" -#include "llmediaremotectrl.h" -#include "llparcel.h" -#include "lltextbox.h" -#include "llui.h" -#include "llviewercontrol.h" -#include "llviewertexturelist.h" -#include "llviewerjoystick.h" -#include "llviewermedia.h" -#include "llviewermenu.h" // handle_reset_view() -#include "llviewermedia.h" -#include "llviewerparcelmedia.h" -#include "llviewerparcelmgr.h" -#include "lluictrlfactory.h" -#include "llviewerwindow.h" -#include "llvoiceclient.h" -#include "llvoavatarself.h" -#include "llvoiceremotectrl.h" -#include "llmediactrl.h" -#include "llselectmgr.h" - -// -// Globals -// - -LLOverlayBar *gOverlayBar = NULL; - -extern S32 MENU_BAR_HEIGHT; - -// -// Functions -// - - - -void* LLOverlayBar::createMediaRemote(void* userdata) -{ - LLOverlayBar *self = (LLOverlayBar*)userdata; - self->mMediaRemote = new LLMediaRemoteCtrl (); - return self->mMediaRemote; -} - -void* LLOverlayBar::createVoiceRemote(void* userdata) -{ - LLOverlayBar *self = (LLOverlayBar*)userdata; - self->mVoiceRemote = new LLVoiceRemoteCtrl(); - return self->mVoiceRemote; -} - -LLOverlayBar::LLOverlayBar() - : LLPanel(), - mMediaRemote(NULL), - mVoiceRemote(NULL), - mMusicState(STOPPED) -{ - setMouseOpaque(FALSE); - setIsChrome(TRUE); - - mBuilt = false; - - mFactoryMap["media_remote"] = LLCallbackMap(LLOverlayBar::createMediaRemote, this); - mFactoryMap["voice_remote"] = LLCallbackMap(LLOverlayBar::createVoiceRemote, this); - - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_overlaybar.xml"); -} - -BOOL LLOverlayBar::postBuild() -{ - childSetAction("Set Not Busy",onClickSetNotBusy,this); - childSetAction("Mouselook",onClickMouselook,this); - childSetAction("Stand Up",onClickStandUp,this); - childSetAction("Flycam",onClickFlycam,this); - childSetVisible("chat_bar", gSavedSettings.getBOOL("ChatVisible")); - - mVoiceRemote->expandOrCollapse(); - mMediaRemote->expandOrCollapse(); - - setFocusRoot(TRUE); - mBuilt = true; - - layoutButtons(); - return TRUE; -} - -LLOverlayBar::~LLOverlayBar() -{ - // LLView destructor cleans up children -} - -// virtual -void LLOverlayBar::reshape(S32 width, S32 height, BOOL called_from_parent) -{ - LLView::reshape(width, height, called_from_parent); - - if (mBuilt) - { - layoutButtons(); - } -} - -void LLOverlayBar::layoutButtons() -{ - LLView* state_buttons_panel = getChildView("state_buttons"); - - if (state_buttons_panel->getVisible()) - { - LLViewQuery query; - LLWidgetTypeFilter widget_filter; - query.addPreFilter(LLEnabledFilter::getInstance()); - query.addPreFilter(&widget_filter); - - child_list_t button_list = query(state_buttons_panel); - - const S32 MAX_BAR_WIDTH = 600; - S32 bar_width = llclamp(state_buttons_panel->getRect().getWidth(), 0, MAX_BAR_WIDTH); - - // calculate button widths - const S32 MAX_BUTTON_WIDTH = 150; - const S32 STATUS_BAR_PAD = 10; - S32 segment_width = llclamp(lltrunc((F32)(bar_width) / (F32)button_list.size()), 0, MAX_BUTTON_WIDTH); - S32 btn_width = segment_width - STATUS_BAR_PAD; - - // Evenly space all buttons, starting from left - S32 left = 0; - S32 bottom = 1; - - for (child_list_reverse_iter_t child_iter = button_list.rbegin(); - child_iter != button_list.rend(); ++child_iter) - { - LLView *view = *child_iter; - LLRect r = view->getRect(); - r.setOriginAndSize(left, bottom, btn_width, r.getHeight()); - view->setRect(r); - left += segment_width; - } - } -} - -// Per-frame updates of visibility -void LLOverlayBar::refresh() -{ - BOOL buttons_changed = FALSE; - - BOOL im_received = gIMMgr->getIMReceived(); - LLButton* button = getChild("IM Received"); - if (button && button->getVisible() != im_received) - { - button->setVisible(im_received); - sendChildToFront(button); - moveChildToBackOfTabGroup(button); - buttons_changed = TRUE; - } - - BOOL busy = gAgent.getBusy(); - button = getChild("Set Not Busy"); - if (button && button->getVisible() != busy) - { - button->setVisible(busy); - sendChildToFront(button); - moveChildToBackOfTabGroup(button); - buttons_changed = TRUE; - } - - BOOL flycam = LLViewerJoystick::getInstance()->getOverrideCamera(); - button = getChild("Flycam"); - if (button && button->getVisible() != flycam) - { - button->setVisible(flycam); - sendChildToFront(button); - moveChildToBackOfTabGroup(button); - buttons_changed = TRUE; - } - - BOOL mouselook_grabbed; - mouselook_grabbed = gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_DOWN_INDEX) - || gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_UP_INDEX); - button = getChild("Mouselook"); - - if (button && button->getVisible() != mouselook_grabbed) - { - button->setVisible(mouselook_grabbed); - sendChildToFront(button); - moveChildToBackOfTabGroup(button); - buttons_changed = TRUE; - } - - BOOL sitting = FALSE; - if (gAgent.getAvatarObject()) - { - sitting = gAgent.getAvatarObject()->isSitting(); - } - button = getChild("Stand Up"); - - if (button && button->getVisible() != sitting) - { - button->setVisible(sitting); - sendChildToFront(button); - moveChildToBackOfTabGroup(button); - buttons_changed = TRUE; - } - - - moveChildToBackOfTabGroup(mMediaRemote); - moveChildToBackOfTabGroup(mVoiceRemote); - - // turn off the whole bar in mouselook - if (gAgent.cameraMouselook()) - { - childSetVisible("media_remote_container", FALSE); - childSetVisible("voice_remote_container", FALSE); - childSetVisible("state_buttons", FALSE); - } - else - { - // update "remotes" - childSetVisible("media_remote_container", TRUE); - childSetVisible("voice_remote_container", LLVoiceClient::getInstance()->voiceEnabled()); - childSetVisible("state_buttons", TRUE); - } - - // always let user toggle into and out of chatbar - childSetVisible("chat_bar", gSavedSettings.getBOOL("ChatVisible")); - - if (buttons_changed) - { - layoutButtons(); - } -} - -//----------------------------------------------------------------------- -// Static functions -//----------------------------------------------------------------------- - -// static -void LLOverlayBar::onClickSetNotBusy(void*) -{ - gAgent.clearBusy(); -} - - -// static -void LLOverlayBar::onClickFlycam(void*) -{ - LLViewerJoystick::getInstance()->toggleFlycam(); -} - -// static -void LLOverlayBar::onClickResetView(void* data) -{ - handle_reset_view(); -} - -//static -void LLOverlayBar::onClickMouselook(void*) -{ - gAgent.changeCameraToMouselook(); -} - -//static -void LLOverlayBar::onClickStandUp(void*) -{ - LLSelectMgr::getInstance()->deselectAllForStandingUp(); - gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); -} - -//////////////////////////////////////////////////////////////////////////////// -// static media helpers -// *TODO: Move this into an audio manager abstraction -//static -void LLOverlayBar::mediaStop(void*) -{ - if (!gOverlayBar) - { - // return; - } - LLViewerParcelMedia::stop(); -} -//static -void LLOverlayBar::toggleMediaPlay(void*) -{ - if (!gOverlayBar) - { - // return; - } - - - if (LLViewerParcelMedia::getStatus() == LLViewerMediaImpl::MEDIA_PAUSED) - { - LLViewerParcelMedia::start(); - } - else if(LLViewerParcelMedia::getStatus() == LLViewerMediaImpl::MEDIA_PLAYING) - { - LLViewerParcelMedia::pause(); - } - else - { - LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - if (parcel) - { - LLViewerParcelMedia::play(parcel); - } - } -} - -//static -void LLOverlayBar::toggleMusicPlay(void*) -{ - if (gAudiop->isInternetStreamPlaying() != 1) - { - if (gAudiop) - { - LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - if ( parcel ) - { - // this doesn't work properly when crossing parcel boundaries - even when the - // stream is stopped, it doesn't return the right thing - commenting out for now. - // if ( gAudiop->isInternetStreamPlaying() == 0 ) - { - gAudiop->startInternetStream(parcel->getMusicURL()); - } - } - } - } - //else - //{ - // gOverlayBar->mMusicState = PAUSED; // desired state - // if (gAudiop) - // { - // gAudiop->pauseInternetStream(1); - // } - //} - else - { - if (gAudiop) - { - gAudiop->stopInternetStream(); - } - } -} - diff --git a/indra/newview/lloverlaybar.h b/indra/newview/lloverlaybar.h deleted file mode 100644 index b36f5ebb73..0000000000 --- a/indra/newview/lloverlaybar.h +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @file lloverlaybar.h - * @brief LLOverlayBar class definition - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLOVERLAYBAR_H -#define LL_LLOVERLAYBAR_H - -#include "llpanel.h" - -// "Constants" loaded from settings.xml at start time -extern S32 STATUS_BAR_HEIGHT; - -class LLButton; -class LLLineEditor; -class LLMediaRemoteCtrl; -class LLMessageSystem; -class LLTextBox; -class LLTextEditor; -class LLUICtrl; -class LLUUID; -class LLFrameTimer; -class LLStatGraph; -class LLSlider; -class LLVoiceRemoteCtrl; - -class LLOverlayBar -: public LLPanel -{ -public: - LLOverlayBar(); - ~LLOverlayBar(); - - /*virtual*/ void refresh(); - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - /*virtual*/ BOOL postBuild(); - - void layoutButtons(); - - // helpers for returning desired state - BOOL musicPlaying() { return mMusicState == PLAYING; } - - static void onClickSetNotBusy(void* data); - static void onClickMouselook(void* data); - static void onClickStandUp(void* data); - static void onClickResetView(void* data); - static void onClickFlycam(void* data); - - //static media helper functions - static void toggleMediaPlay(void*); - static void toggleMusicPlay(void*); - static void musicPause(void*); - static void musicStop(void*); - static void mediaStop(void*); - - static void toggleAudioVolumeFloater(void*); - -protected: - static void* createMediaRemote(void* userdata); - static void* createVoiceRemote(void* userdata); - - void enableMediaButtons(); - -protected: - LLMediaRemoteCtrl* mMediaRemote; - LLVoiceRemoteCtrl* mVoiceRemote; - bool mBuilt; // dialog constructed yet? - enum { STOPPED=0, PLAYING=1, PAUSED=2 }; - S32 mMusicState; -}; - -extern LLOverlayBar* gOverlayBar; - -#endif diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp index 2bbd15ae11..53fc64f089 100644 --- a/indra/newview/llpanelnearbymedia.cpp +++ b/indra/newview/llpanelnearbymedia.cpp @@ -52,6 +52,7 @@ #include "llvovolume.h" #include "llstatusbar.h" #include "llsdutil.h" +#include "llvieweraudio.h" #include "llfloaterreg.h" #include "llfloaterpreference.h" // for the gear icon @@ -808,7 +809,7 @@ bool LLPanelNearByMedia::setDisabled(const LLUUID &row_id, bool disabled) if (row_id == PARCEL_AUDIO_LIST_ITEM_UUID) { if (disabled) onClickParcelAudioStop(); - else onClickParcelAudioStart(); + else onClickParcelAudioPlay(); return true; } else if (row_id == PARCEL_MEDIA_LIST_ITEM_UUID) @@ -857,24 +858,11 @@ void LLPanelNearByMedia::onClickParcelMediaPause() LLViewerParcelMedia::pause(); } -void LLPanelNearByMedia::onClickParcelAudioStart() -{ - // User *explicitly* started the internet stream, so keep the stream - // playing and updated as they cross to other parcels etc. - mParcelAudioAutoStart = true; - - if (!gAudiop) - return; - - gAudiop->startInternetStream(LLViewerMedia::getParcelAudioURL()); -} - void LLPanelNearByMedia::onClickParcelAudioPlay() { // User *explicitly* started the internet stream, so keep the stream // playing and updated as they cross to other parcels etc. mParcelAudioAutoStart = true; - if (!gAudiop) return; @@ -883,8 +871,9 @@ void LLPanelNearByMedia::onClickParcelAudioPlay() // 'false' means unpause gAudiop->pauseInternetStream(false); } - else { - gAudiop->startInternetStream(LLViewerMedia::getParcelAudioURL()); + else + { + LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLViewerMedia::getParcelAudioURL()); } } @@ -894,11 +883,10 @@ void LLPanelNearByMedia::onClickParcelAudioStop() // re-start audio when i.e. they move to another parcel, until // they explicitly start it again. mParcelAudioAutoStart = false; - if (!gAudiop) return; - gAudiop->stopInternetStream(); + LLViewerAudio::getInstance()->stopInternetStreamWithAutoFade(); } void LLPanelNearByMedia::onClickParcelAudioPause() diff --git a/indra/newview/llpanelnearbymedia.h b/indra/newview/llpanelnearbymedia.h index be4d313743..c3634de9b4 100644 --- a/indra/newview/llpanelnearbymedia.h +++ b/indra/newview/llpanelnearbymedia.h @@ -115,7 +115,6 @@ private: void onClickParcelMediaPause(); void onClickParcelAudioPlay(); void onClickParcelAudioStop(); - void onClickParcelAudioStart(); void onClickParcelAudioPause(); void onCheckAutoPlay(); void onAdvancedButtonClick(); diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index f7fa5690d6..8fd1ca3807 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -37,9 +37,212 @@ #include "llvoiceclient.h" #include "llviewermedia.h" #include "llprogressview.h" +#include "llcallbacklist.h" ///////////////////////////////////////////////////////// +LLViewerAudio::LLViewerAudio() : + mDone(true), + mFadeState(FADE_IDLE), + mFadeTime(), + mIdleListnerActive(false) +{ +} + +LLViewerAudio::~LLViewerAudio() +{ +} + +void LLViewerAudio::registerIdleListener() +{ + if(mIdleListnerActive==false) + { + mIdleListnerActive = true; + doOnIdleRepeating(boost::bind(boost::bind(&LLViewerAudio::onIdleUpdate, this))); + } + +} + +void LLViewerAudio::startInternetStreamWithAutoFade(std::string streamURI) +{ + llinfos << "DBG streamURI: " << streamURI << llendl; + llinfos << "DBG mNextStreamURI: " << mNextStreamURI << llendl; + if (mFadeState == FADE_OUT) {llinfos << "DBG mFadeState: FADE_OUT " << llendl;} + if (mFadeState == FADE_IN) {llinfos << "DBG mFadeState: FADE_IN " << llendl;} + if (mFadeState == FADE_IDLE) {llinfos << "DBG mFadeState: FADE_IDLE " << llendl;} + + // Old and new stream are identical + if (mNextStreamURI == streamURI) + { + return; + } + + // Record the URI we are going to be switching to + mNextStreamURI = streamURI; + + if (mFadeState == FADE_IDLE) + { + // If a stream is playing fade it out first + if (!gAudiop->getInternetStreamURL().empty()) + { + mFadeState = FADE_OUT; +llinfos << "DBG new mFadeState: OUT" << llendl; + } + // Otherwise the new stream can be faded in + else + { + mFadeState = FADE_IN; +llinfos << "DBG new mFadeState: IN" << llendl; + + gAudiop->startInternetStream(mNextStreamURI); + startFading(); + registerIdleListener(); + return; + } + } + + if (mFadeState == FADE_OUT) + { + startFading(); + registerIdleListener(); + return; + } + + if (mFadeState == FADE_IN) + { + registerIdleListener(); + return; + } +} + +// We want onIdleUpdate callback to keep firing whilst we are fading out. Once we have completed the fade +// out, we switch the stream and start a fade in, and we don't care about idle updates anymore. +// A return of false from onIdleUpdate means it will be called again next idle update. +// A return of true means we have finished with it and the callback will be deleted. +bool LLViewerAudio::onIdleUpdate() +{ + if (mDone) + { + if (mFadeState == FADE_OUT) {llinfos << "DBG mFadeState: FADE_OUT " << llendl;} + if (mFadeState == FADE_IN) {llinfos << "DBG mFadeState: FADE_IN " << llendl;} + if (mFadeState == FADE_IDLE) {llinfos << "DBG mFadeState: FADE_IDLE " << llendl;} + + // This should be a rare or never occurring state. + if (mFadeState == FADE_IDLE) + { + deregisterIdleListener(); + return true; // Stop calling onIdleUpdate + } + + // we have finished the current fade operation + if (mFadeState == FADE_OUT) + { + // Clear URI + gAudiop->startInternetStream(LLStringUtil::null); + gAudiop->stopInternetStream(); + + if (!mNextStreamURI.empty()) + { + mFadeState = FADE_IN; +llinfos << "DBG new mFadeState: IN" << llendl; + gAudiop->startInternetStream(mNextStreamURI); + startFading(); + return false; + } + else + { + mFadeState = FADE_IDLE; +llinfos << "DBG new mFadeState: IDLE" << llendl; + deregisterIdleListener(); + return true; // Stop calling onIdleUpdate + } + } + else if (mFadeState == FADE_IN) + { + if (mNextStreamURI != gAudiop->getInternetStreamURL()) + { + mFadeState = FADE_OUT; + startFading(); + return false; +llinfos << "DBG new mFadeState: OUT" << llendl; + } + else + { + mFadeState = FADE_IDLE; +llinfos << "DBG new mFadeState: IDLE" << llendl; + deregisterIdleListener(); + return true; // Stop calling onIdleUpdate + } + } + } + + return false; +} + +void LLViewerAudio::stopInternetStreamWithAutoFade() +{ +llinfos << "DBG stopping stream" << llendl; + mFadeState = FADE_IDLE; +llinfos << "DBG new mFadeState: IDLE" << llendl; + mNextStreamURI = LLStringUtil::null; + mDone = true; +llinfos << "DBG mDone: true" << llendl; + + gAudiop->startInternetStream(LLStringUtil::null); + gAudiop->stopInternetStream(); +} + +void LLViewerAudio::startFading() +{ +llinfos << "DBG startFading" << llendl; + + if(mDone) + { + // The fade state here should only be one of FADE_IN or FADE_OUT, but, in case it is not, + // rather than check for both states assume a fade in and check for the fade out case. + mFadeTime = llmax(0.0f, gSavedSettings.getF32("AudioMusicFadeIn")); + if (LLViewerAudio::getInstance()->getFadeState() == LLViewerAudio::FADE_OUT) + { + mFadeTime = llmax(0.0f, gSavedSettings.getF32("AudioMusicFadeOut")); + } + stream_fade_timer.reset(); + stream_fade_timer.setTimerExpirySec(mFadeTime); + mDone = false; +llinfos << "DBG mDone: false" << llendl; + } +} + +F32 LLViewerAudio::getFadeVolume() +{ + F32 fade_volume = 1.0f; + + if (stream_fade_timer.hasExpired()) + { + mDone = true; + // If we have been fading out set volume to 0 until the next fade state occurs to prevent + // an audio transient. + if (LLViewerAudio::getInstance()->getFadeState() == LLViewerAudio::FADE_OUT) + { + fade_volume = 0.0f; + } + } + + if (!mDone) + { + // Calculate how far we are into the fade time + fade_volume = stream_fade_timer.getElapsedTimeF32() / mFadeTime; + + if (LLViewerAudio::getInstance()->getFadeState() == LLViewerAudio::FADE_OUT) + { + // If we are not fading in then we are fading out, so invert the fade + // direction; start loud and move towards zero volume. + fade_volume = 1.0f - fade_volume; + } + } + + return fade_volume; +} + void init_audio() { if (!gAudiop) @@ -145,9 +348,11 @@ void audio_update_volume(bool force_update) { F32 music_volume = gSavedSettings.getF32("AudioLevelMusic"); BOOL music_muted = gSavedSettings.getBOOL("MuteMusic"); - music_volume = mute_volume * master_volume * music_volume; - gAudiop->setInternetStreamGain ( music_muted || progress_view_visible ? 0.f : music_volume ); - + F32 fade_volume = LLViewerAudio::getInstance()->getFadeVolume(); +llinfos << "DBG fade_volume:" << fade_volume << llendl; + + music_volume = mute_volume * master_volume * music_volume * fade_volume; + gAudiop->setInternetStreamGain (music_muted ? 0.f : music_volume); } // Streaming Media diff --git a/indra/newview/llvieweraudio.h b/indra/newview/llvieweraudio.h index e5916285fb..316d7b32d2 100644 --- a/indra/newview/llvieweraudio.h +++ b/indra/newview/llvieweraudio.h @@ -27,6 +27,10 @@ #ifndef LL_VIEWERAUDIO_H #define LL_VIEWERAUDIO_H +#include "llframetimer.h" +#include "llthread.h" +#include "llsingleton.h" + // comment out to turn off wind #define kAUDIO_ENABLE_WIND //#define kAUDIO_ENABLE_WATER 1 // comment out to turn off water @@ -38,4 +42,41 @@ void audio_update_volume(bool force_update = true); void audio_update_listener(); void audio_update_wind(bool force_update = true); +class LLViewerAudio : public LLSingleton +{ +public: + + enum EFadeState + { + FADE_IDLE, + FADE_IN, + FADE_OUT, + }; + + LLViewerAudio(); + virtual ~LLViewerAudio(); + + void startInternetStreamWithAutoFade(std::string streamURI); + void stopInternetStreamWithAutoFade(); + + bool LLViewerAudio::onIdleUpdate(); + + EFadeState getFadeState() { return mFadeState; } + bool isDone() { return mDone; }; + F32 getFadeVolume(); + +private: + + bool mDone; + F32 mFadeTime; + std::string mNextStreamURI; + EFadeState mFadeState; + LLFrameTimer stream_fade_timer; + bool mIdleListnerActive; + + void registerIdleListener(); + void deregisterIdleListener() { mIdleListnerActive = false; }; + void startFading(); +}; + #endif //LL_VIEWER_H diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 41b4dc01e8..148bfbf080 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -66,7 +66,7 @@ //#include "llfirstuse.h" #include "llviewernetwork.h" #include "llwindow.h" - +#include "llvieweraudio.h" #include "llfloatermediabrowser.h" // for handling window close requests and geometry change requests in media browser windows. #include "llfloaterwebcontent.h" // for handling window close requests and geometry change requests in media browser windows. @@ -967,7 +967,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg) { if(LLViewerMedia::isParcelAudioPlaying() && gAudiop && LLViewerMedia::hasParcelAudio()) { - gAudiop->stopInternetStream(); + LLViewerAudio::getInstance()->stopInternetStreamWithAutoFade(); } } pimpl->setPriority(new_priority); @@ -1069,13 +1069,24 @@ void LLViewerMedia::setAllMediaEnabled(bool val) gAudiop && LLViewerMedia::hasParcelAudio()) { - gAudiop->startInternetStream(LLViewerMedia::getParcelAudioURL()); + if (LLAudioEngine::AUDIO_PAUSED == gAudiop->isInternetStreamPlaying()) + { + // 'false' means unpause + gAudiop->pauseInternetStream(false); + } + else + { + LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLViewerMedia::getParcelAudioURL()); + } } } else { // This actually unloads the impl, as opposed to "stop"ping the media LLViewerParcelMedia::stop(); - if (gAudiop) gAudiop->stopInternetStream(); + if (gAudiop) + { + LLViewerAudio::getInstance()->stopInternetStreamWithAutoFade(); + } } } @@ -1488,8 +1499,7 @@ void LLViewerMedia::setOpenIDCookie() new LLViewerMediaWebProfileResponder(raw_profile_url.getAuthority()), headers); - // FUI: No longer perform the user_status query - //doOnetimeEarlyHTTPRequests(); + doOnetimeEarlyHTTPRequests(); } } diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 8db72da1ee..928a84e7eb 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -67,6 +67,7 @@ #include "llworld.h" #include "roles_constants.h" #include "llweb.h" +#include "llvieweraudio.h" const F32 PARCEL_COLLISION_DRAW_SECS = 1.f; @@ -1725,7 +1726,11 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use } else { - // look for music. + // Check for video + LLViewerParcelMedia::update( parcel ); + + // Then check for music. Do this last, as there may be a delay waiting for + // the stream fading thread to finish. if (gAudiop) { if (parcel) @@ -1736,46 +1741,36 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use std::string music_url = music_url_raw; LLStringUtil::trim(music_url); - // On entering a new parcel, stop the last stream if the - // new parcel has a different music url. (Empty URL counts - // as different.) const std::string& stream_url = gAudiop->getInternetStreamURL(); - if (music_url.empty() || music_url != stream_url) + // If there is a new music URL and it's valid, play it. + if (music_url.size() > 12) { - // URL is different from one currently playing. - gAudiop->stopInternetStream(); - - // If there is a new music URL and it's valid, play it. - if (music_url.size() > 12) + if (music_url.substr(0,7) == "http://") { - if (music_url.substr(0,7) == "http://") - { - optionally_start_music(music_url); - } - else - { - llinfos << "Stopping parcel music (invalid audio stream URL)" << llendl; - // clears the URL - gAudiop->startInternetStream(LLStringUtil::null); - } + optionally_start_music(music_url); } - else if (!gAudiop->getInternetStreamURL().empty()) + else { - llinfos << "Stopping parcel music (parcel stream URL is empty)" << llendl; - gAudiop->startInternetStream(LLStringUtil::null); + llinfos << "Stopping parcel music (invalid audio stream URL)" << llendl; + // clears the URL + // null value causes fade out + LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null); } } + else if (!gAudiop->getInternetStreamURL().empty()) + { + llinfos << "Stopping parcel music (parcel stream URL is empty)" << llendl; + // null value causes fade out + LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null); + } } else { // Public land has no music - gAudiop->stopInternetStream(); + LLViewerAudio::getInstance()->stopInternetStreamWithAutoFade(); } }//if gAudiop - - // now check for video - LLViewerParcelMedia::update( parcel ); }; } @@ -1794,7 +1789,11 @@ void optionally_start_music(const std::string& music_url) gSavedSettings.getBOOL("MediaTentativeAutoPlay"))) { llinfos << "Starting parcel music " << music_url << llendl; - gAudiop->startInternetStream(music_url); + LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(music_url); + } + else + { + LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null); } } } -- cgit v1.2.3 From 5663f41a7a3dafb4650b49ebc0c86140136239cd Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 28 Oct 2011 17:54:42 -0400 Subject: STORM-591 Fix minor merge error regression --- indra/newview/llviewermedia.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 148bfbf080..a85f70b599 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1499,7 +1499,8 @@ void LLViewerMedia::setOpenIDCookie() new LLViewerMediaWebProfileResponder(raw_profile_url.getAuthority()), headers); - doOnetimeEarlyHTTPRequests(); + // FUI: No longer perform the user_status query + //doOnetimeEarlyHTTPRequests(); } } -- cgit v1.2.3 From 526f71053a9fb18e95993343a0fd826023bda683 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sat, 29 Oct 2011 05:01:23 -0400 Subject: STORM-591 Comment out debugging llinfos lines --- indra/newview/llvieweraudio.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index 8fd1ca3807..10ba54356c 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -65,12 +65,12 @@ void LLViewerAudio::registerIdleListener() void LLViewerAudio::startInternetStreamWithAutoFade(std::string streamURI) { - llinfos << "DBG streamURI: " << streamURI << llendl; +/* llinfos << "DBG streamURI: " << streamURI << llendl; llinfos << "DBG mNextStreamURI: " << mNextStreamURI << llendl; if (mFadeState == FADE_OUT) {llinfos << "DBG mFadeState: FADE_OUT " << llendl;} if (mFadeState == FADE_IN) {llinfos << "DBG mFadeState: FADE_IN " << llendl;} if (mFadeState == FADE_IDLE) {llinfos << "DBG mFadeState: FADE_IDLE " << llendl;} - +*/ // Old and new stream are identical if (mNextStreamURI == streamURI) { @@ -86,13 +86,13 @@ void LLViewerAudio::startInternetStreamWithAutoFade(std::string streamURI) if (!gAudiop->getInternetStreamURL().empty()) { mFadeState = FADE_OUT; -llinfos << "DBG new mFadeState: OUT" << llendl; +//llinfos << "DBG new mFadeState: OUT" << llendl; } // Otherwise the new stream can be faded in else { mFadeState = FADE_IN; -llinfos << "DBG new mFadeState: IN" << llendl; +//llinfos << "DBG new mFadeState: IN" << llendl; gAudiop->startInternetStream(mNextStreamURI); startFading(); @@ -123,10 +123,10 @@ bool LLViewerAudio::onIdleUpdate() { if (mDone) { - if (mFadeState == FADE_OUT) {llinfos << "DBG mFadeState: FADE_OUT " << llendl;} +/* if (mFadeState == FADE_OUT) {llinfos << "DBG mFadeState: FADE_OUT " << llendl;} if (mFadeState == FADE_IN) {llinfos << "DBG mFadeState: FADE_IN " << llendl;} if (mFadeState == FADE_IDLE) {llinfos << "DBG mFadeState: FADE_IDLE " << llendl;} - +*/ // This should be a rare or never occurring state. if (mFadeState == FADE_IDLE) { @@ -144,7 +144,7 @@ bool LLViewerAudio::onIdleUpdate() if (!mNextStreamURI.empty()) { mFadeState = FADE_IN; -llinfos << "DBG new mFadeState: IN" << llendl; +//llinfos << "DBG new mFadeState: IN" << llendl; gAudiop->startInternetStream(mNextStreamURI); startFading(); return false; @@ -152,7 +152,7 @@ llinfos << "DBG new mFadeState: IN" << llendl; else { mFadeState = FADE_IDLE; -llinfos << "DBG new mFadeState: IDLE" << llendl; +//llinfos << "DBG new mFadeState: IDLE" << llendl; deregisterIdleListener(); return true; // Stop calling onIdleUpdate } @@ -164,12 +164,12 @@ llinfos << "DBG new mFadeState: IDLE" << llendl; mFadeState = FADE_OUT; startFading(); return false; -llinfos << "DBG new mFadeState: OUT" << llendl; +//llinfos << "DBG new mFadeState: OUT" << llendl; } else { mFadeState = FADE_IDLE; -llinfos << "DBG new mFadeState: IDLE" << llendl; +//llinfos << "DBG new mFadeState: IDLE" << llendl; deregisterIdleListener(); return true; // Stop calling onIdleUpdate } @@ -181,12 +181,12 @@ llinfos << "DBG new mFadeState: IDLE" << llendl; void LLViewerAudio::stopInternetStreamWithAutoFade() { -llinfos << "DBG stopping stream" << llendl; +//llinfos << "DBG stopping stream" << llendl; mFadeState = FADE_IDLE; -llinfos << "DBG new mFadeState: IDLE" << llendl; +//llinfos << "DBG new mFadeState: IDLE" << llendl; mNextStreamURI = LLStringUtil::null; mDone = true; -llinfos << "DBG mDone: true" << llendl; +//llinfos << "DBG mDone: true" << llendl; gAudiop->startInternetStream(LLStringUtil::null); gAudiop->stopInternetStream(); @@ -194,7 +194,7 @@ llinfos << "DBG mDone: true" << llendl; void LLViewerAudio::startFading() { -llinfos << "DBG startFading" << llendl; +//llinfos << "DBG startFading" << llendl; if(mDone) { @@ -208,7 +208,7 @@ llinfos << "DBG startFading" << llendl; stream_fade_timer.reset(); stream_fade_timer.setTimerExpirySec(mFadeTime); mDone = false; -llinfos << "DBG mDone: false" << llendl; +//llinfos << "DBG mDone: false" << llendl; } } @@ -349,7 +349,7 @@ void audio_update_volume(bool force_update) F32 music_volume = gSavedSettings.getF32("AudioLevelMusic"); BOOL music_muted = gSavedSettings.getBOOL("MuteMusic"); F32 fade_volume = LLViewerAudio::getInstance()->getFadeVolume(); -llinfos << "DBG fade_volume:" << fade_volume << llendl; +//llinfos << "DBG fade_volume:" << fade_volume << llendl; music_volume = mute_volume * master_volume * music_volume * fade_volume; gAudiop->setInternetStreamGain (music_muted ? 0.f : music_volume); -- cgit v1.2.3 From 3aaaae15034b1c0e3099662023bc90d5e447d1ac Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 8 Nov 2011 15:23:56 -0500 Subject: STORM-591 Audio fading Hopefully fix error in llvieweraudio.h that caused mac and linux compile failure --- indra/newview/llvieweraudio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llvieweraudio.h b/indra/newview/llvieweraudio.h index 316d7b32d2..1663f77f4a 100644 --- a/indra/newview/llvieweraudio.h +++ b/indra/newview/llvieweraudio.h @@ -59,7 +59,7 @@ public: void startInternetStreamWithAutoFade(std::string streamURI); void stopInternetStreamWithAutoFade(); - bool LLViewerAudio::onIdleUpdate(); + bool onIdleUpdate(); EFadeState getFadeState() { return mFadeState; } bool isDone() { return mDone; }; -- cgit v1.2.3 From 57b8da6b4926435f92f0a8568c6ac725774bbbd2 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 11 Nov 2011 12:22:48 -0500 Subject: STORM-591 Remove dead line of code to fix mac/linux compile error. --- indra/newview/llviewerparcelmgr.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 928a84e7eb..ada89cc7aa 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1741,8 +1741,6 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use std::string music_url = music_url_raw; LLStringUtil::trim(music_url); - const std::string& stream_url = gAudiop->getInternetStreamURL(); - // If there is a new music URL and it's valid, play it. if (music_url.size() > 12) { -- cgit v1.2.3 From cc1fb7bcac2924674763d917f66d84fbadb11623 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 17 Nov 2011 08:06:31 -0500 Subject: LLSD-14: Bring over llsd.{h,cpp} enhancements from server-trunk. Because new enum values have been added to the LLSD type field, a few external switch statements must be adjusted to suppress fatal warnings, even though we never expect to encounter an LLSD instance containing any of the new values. --- indra/llcommon/llsd.cpp | 194 ++++++++++++++++++++++++++++------ indra/llcommon/llsd.h | 82 +++++++++++++- indra/llmessage/llsdmessagereader.cpp | 1 + indra/test/lltut.cpp | 5 + 4 files changed, 248 insertions(+), 34 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp index 6ca0737445..862b6b5ebc 100644 --- a/indra/llcommon/llsd.cpp +++ b/indra/llcommon/llsd.cpp @@ -31,6 +31,7 @@ #include "../llmath/llmath.h" #include "llformat.h" #include "llsdserialize.h" +#include "stringize.h" #ifndef LL_RELEASE_FOR_DOWNLOAD #define NAME_UNNAMED_NAMESPACE @@ -50,6 +51,24 @@ namespace using namespace LLSDUnnamedNamespace; #endif + +// Normally undefined +#ifdef LLSD_DEBUG_INFO + +// statics +S32 LLSD::sLLSDAllocationCount = 0; +S32 LLSD::sLLSDNetObjects = 0; + +#define ALLOC_LLSD_OBJECT { sLLSDNetObjects++; sLLSDAllocationCount++; } +#define FREE_LLSD_OBJECT { sLLSDNetObjects--; } + +#else + +#define ALLOC_LLSD_OBJECT +#define FREE_LLSD_OBJECT + +#endif + class LLSD::Impl /**< This class is the abstract base class of the implementation of LLSD It provides the reference counting implementation, and the default @@ -58,13 +77,10 @@ class LLSD::Impl */ { -private: - U32 mUseCount; - protected: Impl(); - enum StaticAllocationMarker { STATIC }; + enum StaticAllocationMarker { STATIC_USAGE_COUNT = 0xFFFFFFFF }; Impl(StaticAllocationMarker); ///< This constructor is used for static objects and causes the // suppresses adjusting the debugging counters when they are @@ -72,7 +88,9 @@ protected: virtual ~Impl(); - bool shared() const { return mUseCount > 1; } + bool shared() const { return (mUseCount > 1) && (mUseCount != STATIC_USAGE_COUNT); } + + U32 mUseCount; public: static void reset(Impl*& var, Impl* impl); @@ -128,6 +146,9 @@ public: virtual LLSD::array_const_iterator beginArray() const { return endArray(); } virtual LLSD::array_const_iterator endArray() const { static const std::vector empty; return empty.end(); } + virtual void dumpStats() const; + virtual void calcStats(S32 type_counts[], S32 share_counts[]) const; + static const LLSD& undef(); static U32 sAllocationCount; @@ -360,6 +381,9 @@ namespace LLSD::map_iterator endMap() { return mData.end(); } virtual LLSD::map_const_iterator beginMap() const { return mData.begin(); } virtual LLSD::map_const_iterator endMap() const { return mData.end(); } + + virtual void dumpStats() const; + virtual void calcStats(S32 type_counts[], S32 share_counts[]) const; }; ImplMap& ImplMap::makeMap(LLSD::Impl*& var) @@ -414,6 +438,36 @@ namespace return i->second; } + void ImplMap::dumpStats() const + { + std::cout << "Map size: " << mData.size() << std::endl; + + #ifdef LLSD_DEBUG_INFO + std::cout << "LLSD Net Objects: " << LLSD::sLLSDNetObjects << std::endl; + std::cout << "LLSD allocations: " << LLSD::sLLSDAllocationCount << std::endl; + #endif + + std::cout << "LLSD::Impl Net Objects: " << sOutstandingCount << std::endl; + std::cout << "LLSD::Impl allocations: " << sAllocationCount << std::endl; + + Impl::dumpStats(); + } + + void ImplMap::calcStats(S32 type_counts[], S32 share_counts[]) const + { + LLSD::map_const_iterator iter = beginMap(); + while (iter != endMap()) + { + //std::cout << " " << (*iter).first << ": " << (*iter).second << std::endl; + (*iter).second.calcStats(type_counts, share_counts); + iter++; + } + + // Add in the values for this map + Impl::calcStats(type_counts, share_counts); + } + + class ImplArray : public LLSD::Impl { private: @@ -449,6 +503,8 @@ namespace LLSD::array_iterator endArray() { return mData.end(); } virtual LLSD::array_const_iterator beginArray() const { return mData.begin(); } virtual LLSD::array_const_iterator endArray() const { return mData.end(); } + + virtual void calcStats(S32 type_counts[], S32 share_counts[]) const; }; ImplArray& ImplArray::makeArray(Impl*& var) @@ -490,12 +546,13 @@ namespace void ImplArray::insert(LLSD::Integer i, const LLSD& v) { - if (i < 0) { + if (i < 0) + { return; } DataVector::size_type index = i; - if (index >= mData.size()) + if (index >= mData.size()) // tbd - sanity check limit for index ? { mData.resize(index + 1); } @@ -543,6 +600,19 @@ namespace return mData[index]; } + + void ImplArray::calcStats(S32 type_counts[], S32 share_counts[]) const + { + LLSD::array_const_iterator iter = beginArray(); + while (iter != endArray()) + { // Add values for all items held in the array + (*iter).calcStats(type_counts, share_counts); + iter++; + } + + // Add in the values for this array + Impl::calcStats(type_counts, share_counts); + } } LLSD::Impl::Impl() @@ -564,8 +634,11 @@ LLSD::Impl::~Impl() void LLSD::Impl::reset(Impl*& var, Impl* impl) { - if (impl) ++impl->mUseCount; - if (var && --var->mUseCount == 0) + if (impl && impl->mUseCount != STATIC_USAGE_COUNT) + { + ++impl->mUseCount; + } + if (var && var->mUseCount != STATIC_USAGE_COUNT && --var->mUseCount == 0) { delete var; } @@ -574,13 +647,13 @@ void LLSD::Impl::reset(Impl*& var, Impl* impl) LLSD::Impl& LLSD::Impl::safe(Impl* impl) { - static Impl theUndefined(STATIC); + static Impl theUndefined(STATIC_USAGE_COUNT); return impl ? *impl : theUndefined; } const LLSD::Impl& LLSD::Impl::safe(const Impl* impl) { - static Impl theUndefined(STATIC); + static Impl theUndefined(STATIC_USAGE_COUNT); return impl ? *impl : theUndefined; } @@ -656,6 +729,39 @@ const LLSD& LLSD::Impl::undef() return immutableUndefined; } +void LLSD::Impl::dumpStats() const +{ + S32 type_counts[LLSD::TypeLLSDNumTypes + 1]; + memset(&type_counts, 0, LLSD::TypeLLSDNumTypes * sizeof(S32)); + + S32 share_counts[LLSD::TypeLLSDNumTypes + 1]; + memset(&share_counts, 0, LLSD::TypeLLSDNumTypes * sizeof(S32)); + + // Add info from all the values this object has + calcStats(type_counts, share_counts); + + S32 type_index = LLSD::TypeLLSDTypeBegin; + while (type_index != LLSD::TypeLLSDTypeEnd) + { + std::cout << LLSD::typeString((LLSD::Type)type_index) << " type " + << type_counts[type_index] << " objects, " + << share_counts[type_index] << " shared" + << std::endl; + type_index++; + } +} + + +void LLSD::Impl::calcStats(S32 type_counts[], S32 share_counts[]) const +{ + type_counts[(S32) type()]++; + if (shared()) + { + share_counts[(S32) type()]++; + } +} + + U32 LLSD::Impl::sAllocationCount = 0; U32 LLSD::Impl::sOutstandingCount = 0; @@ -681,10 +787,10 @@ namespace } -LLSD::LLSD() : impl(0) { } -LLSD::~LLSD() { Impl::reset(impl, 0); } +LLSD::LLSD() : impl(0) { ALLOC_LLSD_OBJECT; } +LLSD::~LLSD() { FREE_LLSD_OBJECT; Impl::reset(impl, 0); } -LLSD::LLSD(const LLSD& other) : impl(0) { assign(other); } +LLSD::LLSD(const LLSD& other) : impl(0) { ALLOC_LLSD_OBJECT; assign(other); } void LLSD::assign(const LLSD& other) { Impl::assign(impl, other.impl); } @@ -693,17 +799,17 @@ void LLSD::clear() { Impl::assignUndefined(impl); } LLSD::Type LLSD::type() const { return safe(impl).type(); } // Scaler Constructors -LLSD::LLSD(Boolean v) : impl(0) { assign(v); } -LLSD::LLSD(Integer v) : impl(0) { assign(v); } -LLSD::LLSD(Real v) : impl(0) { assign(v); } -LLSD::LLSD(const UUID& v) : impl(0) { assign(v); } -LLSD::LLSD(const String& v) : impl(0) { assign(v); } -LLSD::LLSD(const Date& v) : impl(0) { assign(v); } -LLSD::LLSD(const URI& v) : impl(0) { assign(v); } -LLSD::LLSD(const Binary& v) : impl(0) { assign(v); } +LLSD::LLSD(Boolean v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); } +LLSD::LLSD(Integer v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); } +LLSD::LLSD(Real v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); } +LLSD::LLSD(const UUID& v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); } +LLSD::LLSD(const String& v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); } +LLSD::LLSD(const Date& v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); } +LLSD::LLSD(const URI& v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); } +LLSD::LLSD(const Binary& v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); } // Convenience Constructors -LLSD::LLSD(F32 v) : impl(0) { assign((Real)v); } +LLSD::LLSD(F32 v) : impl(0) { ALLOC_LLSD_OBJECT; assign((Real)v); } // Scalar Assignment void LLSD::assign(Boolean v) { safe(impl).assign(impl, v); } @@ -726,7 +832,7 @@ LLSD::URI LLSD::asURI() const { return safe(impl).asURI(); } LLSD::Binary LLSD::asBinary() const { return safe(impl).asBinary(); } // const char * helpers -LLSD::LLSD(const char* v) : impl(0) { assign(v); } +LLSD::LLSD(const char* v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); } void LLSD::assign(const char* v) { if(v) assign(std::string(v)); @@ -801,15 +907,9 @@ static const char *llsd_dump(const LLSD &llsd, bool useXMLFormat) { std::ostringstream out; if (useXMLFormat) - { - LLSDXMLStreamer xml_streamer(llsd); - out << xml_streamer; - } + out << LLSDXMLStreamer(llsd); else - { - LLSDNotationStreamer notation_streamer(llsd); - out << notation_streamer; - } + out << LLSDNotationStreamer(llsd); out_string = out.str(); } int len = out_string.length(); @@ -840,3 +940,33 @@ LLSD::array_iterator LLSD::beginArray() { return makeArray(impl).beginArray(); LLSD::array_iterator LLSD::endArray() { return makeArray(impl).endArray(); } LLSD::array_const_iterator LLSD::beginArray() const{ return safe(impl).beginArray(); } LLSD::array_const_iterator LLSD::endArray() const { return safe(impl).endArray(); } + + +// Diagnostic dump of contents in an LLSD object +void LLSD::dumpStats() const { safe(impl).dumpStats(); } +void LLSD::calcStats(S32 type_counts[], S32 share_counts[]) const + { safe(impl).calcStats(type_counts, share_counts); } + +// static +std::string LLSD::typeString(Type type) +{ + static const char * sTypeNameArray[] = { + "Undefined", + "Boolean", + "Integer", + "Real", + "String", + "UUID", + "Date", + "URI", + "Binary", + "Map", + "Array" + }; + + if (0 <= type < (sizeof(sTypeNameArray)/sizeof(sTypeNameArray[0]))) + { + return sTypeNameArray[type]; + } + return STRINGIZE("** invalid type value " << type); +} diff --git a/indra/llcommon/llsd.h b/indra/llcommon/llsd.h index 90d0f97873..1ffa1d279b 100644 --- a/indra/llcommon/llsd.h +++ b/indra/llcommon/llsd.h @@ -80,9 +80,73 @@ An array is a sequence of zero or more LLSD values. + Thread Safety + + In general, these LLSD classes offer *less* safety than STL container + classes. Implementations prior to this one were unsafe even when + completely unrelated LLSD trees were in two threads due to reference + sharing of special 'undefined' values that participated in the reference + counting mechanism. + + The dereference-before-refcount and aggressive tree sharing also make + it impractical to share an LLSD across threads. A strategy of passing + ownership or a copy to another thread is still difficult due to a lack + of a cloning interface but it can be done with some care. + + One way of transferring ownership is as follows: + + void method(const LLSD input) { + ... + LLSD * xfer_tree = new LLSD(); + { + // Top-level values + (* xfer_tree)['label'] = "Some text"; + (* xfer_tree)['mode'] = APP_MODE_CONSTANT; + + // There will be a second-level + LLSD subtree(LLSD::emptyMap()); + (* xfer_tree)['subtree'] = subtree; + + // Do *not* copy from LLSD objects via LLSD + // intermediaries. Only use plain-old-data + // types as intermediaries to prevent reference + // sharing. + subtree['value1'] = input['value1'].asInteger(); + subtree['value2'] = input['value2'].asString(); + + // Close scope and drop 'subtree's reference. + // Only xfer_tree has a reference to the second + // level data. + } + ... + // Transfer the LLSD pointer to another thread. Ownership + // transfers, this thread no longer has a reference to any + // part of the xfer_tree and there's nothing to free or + // release here. Receiving thread does need to delete the + // pointer when it is done with the LLSD. Transfer + // mechanism must perform correct data ordering operations + // as dictated by architecture. + other_thread.sendMessageAndPointer("Take This", xfer_tree); + xfer_tree = NULL; + + + Avoid this pattern which provides half of a race condition: + + void method(const LLSD input) { + ... + LLSD xfer_tree(LLSD::emptyMap()); + xfer_tree['label'] = "Some text"; + xfer_tree['mode'] = APP_MODE_CONSTANT; + ... + other_thread.sendMessageAndPointer("Take This", xfer_tree); + + @nosubgrouping */ +// Normally undefined, used for diagnostics +//#define LLSD_DEBUG_INFO 1 + class LL_COMMON_API LLSD { public: @@ -266,7 +330,7 @@ public: /** @name Type Testing */ //@{ enum Type { - TypeUndefined, + TypeUndefined = 0, TypeBoolean, TypeInteger, TypeReal, @@ -276,7 +340,10 @@ public: TypeURI, TypeBinary, TypeMap, - TypeArray + TypeArray, + TypeLLSDTypeEnd, + TypeLLSDTypeBegin = TypeUndefined, + TypeLLSDNumTypes = (TypeLLSDTypeEnd - TypeLLSDTypeBegin) }; Type type() const; @@ -338,6 +405,17 @@ private: /// Returns Notation version of llsd -- only to be called from debugger static const char *dump(const LLSD &llsd); //@} + +public: + void dumpStats() const; // Output information on object and usage + void calcStats(S32 type_counts[], S32 share_counts[]) const; // Calculate the number of LLSD objects used by this value + + static std::string typeString(Type type); // Return human-readable type as a string + +#ifdef LLSD_DEBUG_INFO + static S32 sLLSDAllocationCount; // Number of LLSD objects ever created + static S32 sLLSDNetObjects; // Number of LLSD objects that exist +#endif }; struct llsd_select_bool : public std::unary_function diff --git a/indra/llmessage/llsdmessagereader.cpp b/indra/llmessage/llsdmessagereader.cpp index 304a692cdf..3ab62a8c57 100644 --- a/indra/llmessage/llsdmessagereader.cpp +++ b/indra/llmessage/llsdmessagereader.cpp @@ -291,6 +291,7 @@ S32 getElementSize(const LLSD& llsd) case LLSD::TypeMap: case LLSD::TypeArray: case LLSD::TypeUndefined: + default: // TypeLLSDTypeEnd, TypeLLSDNumTypes, etc. return 0; } return 0; diff --git a/indra/test/lltut.cpp b/indra/test/lltut.cpp index da7031b52a..c43a8f0c7d 100644 --- a/indra/test/lltut.cpp +++ b/indra/test/lltut.cpp @@ -34,6 +34,7 @@ #include "llformat.h" #include "llsd.h" #include "lluri.h" +#include "stringize.h" namespace tut { @@ -144,6 +145,10 @@ namespace tut } return; } + default: + // should never get here, but compiler produces warning if we + // don't cover this case, and at Linden warnings are fatal. + throw failure(STRINGIZE("invalid type field " << actual.type())); } } -- cgit v1.2.3 From e62c691aab36b50d3eecb99310d5652d0b8e6f23 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 17 Nov 2011 10:02:05 -0500 Subject: LLSD-14: Fix silly syntax error in subscript bounds check. --- indra/llcommon/llsd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp index 862b6b5ebc..b0801745d7 100644 --- a/indra/llcommon/llsd.cpp +++ b/indra/llcommon/llsd.cpp @@ -964,7 +964,7 @@ std::string LLSD::typeString(Type type) "Array" }; - if (0 <= type < (sizeof(sTypeNameArray)/sizeof(sTypeNameArray[0]))) + if (0 <= type && type < (sizeof(sTypeNameArray)/sizeof(sTypeNameArray[0]))) { return sTypeNameArray[type]; } -- cgit v1.2.3 From b0d869554b902c30f8a874b1e772a0241acf9f1f Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 17 Nov 2011 11:10:39 -0500 Subject: LLSD-14: Add tests from Simon's server-trunk changeset 3852648182db. That changeset provides most of the changes previously checked in on this Jira (viewer changeset 22b293aae639). Bring over the code he added to llsd_new_tut.cpp as well. --- indra/test/llsd_new_tut.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'indra') diff --git a/indra/test/llsd_new_tut.cpp b/indra/test/llsd_new_tut.cpp index dd93b36f04..f332ad0ee2 100644 --- a/indra/test/llsd_new_tut.cpp +++ b/indra/test/llsd_new_tut.cpp @@ -742,6 +742,42 @@ namespace tut LLSD w = v; w = "nice day"; } + + { + SDAllocationCheck check("shared values test for threaded work", 9); + + //U32 start_llsd_count = LLSD::outstandingCount(); + + LLSD m = LLSD::emptyMap(); + + m["one"] = 1; + m["two"] = 2; + m["one_copy"] = m["one"]; // 3 (m, "one" and "two") + + m["undef_one"] = LLSD(); + m["undef_two"] = LLSD(); + m["undef_one_copy"] = m["undef_one"]; + + { // Ensure first_array gets freed to avoid counting it + LLSD first_array = LLSD::emptyArray(); + first_array.append(1.0f); + first_array.append(2.0f); + first_array.append(3.0f); // 7 + + m["array"] = first_array; + m["array_clone"] = first_array; + m["array_copy"] = m["array"]; // 7 + } + + m["string_one"] = "string one value"; + m["string_two"] = "string two value"; + m["string_one_copy"] = m["string_one"]; // 9 + + //U32 llsd_object_count = LLSD::outstandingCount(); + //std::cout << "Using " << (llsd_object_count - start_llsd_count) << " LLSD objects" << std::endl; + + //m.dumpStats(); + } } template<> template<> -- cgit v1.2.3 From 570ac04e167c97553a03f283ee0683cc4648601c Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 17 Nov 2011 11:54:13 -0500 Subject: LLSD-14: while we're in llsd.h anyway, fix longstanding misspellings. My tollerance is at an end. :-P --- indra/llcommon/llsd.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/llsd.h b/indra/llcommon/llsd.h index 1ffa1d279b..80c3e9e7b5 100644 --- a/indra/llcommon/llsd.h +++ b/indra/llcommon/llsd.h @@ -40,10 +40,10 @@ /** LLSD provides a flexible data system similar to the data facilities of dynamic languages like Perl and Python. It is created to support exchange - of structured data between loosly coupled systems. (Here, "loosly coupled" + of structured data between loosely coupled systems. (Here, "loosely coupled" means not compiled together into the same module.) - Data in such exchanges must be highly tollerant of changes on either side + Data in such exchanges must be highly tolerant of changes on either side such as: - recompilation - implementation in a different langauge @@ -51,19 +51,19 @@ - execution of older versions (with fewer parameters) To this aim, the C++ API of LLSD strives to be very easy to use, and to - default to "the right thing" whereever possible. It is extremely tollerant + default to "the right thing" wherever possible. It is extremely tolerant of errors and unexpected situations. - The fundimental class is LLSD. LLSD is a value holding object. It holds + The fundamental class is LLSD. LLSD is a value holding object. It holds one value that is either undefined, one of the scalar types, or a map or an array. LLSD objects have value semantics (copying them copies the value, - though it can be considered efficient, due to shareing.), and mutable. + though it can be considered efficient, due to sharing), and mutable. Undefined is the singular value given to LLSD objects that are not initialized with any data. It is also used as the return value for - operations that return an LLSD, + operations that return an LLSD. - The sclar data types are: + The scalar data types are: - Boolean - true or false - Integer - a 32 bit signed integer - Real - a 64 IEEE 754 floating point value @@ -266,7 +266,7 @@ public: //@} /** @name Character Pointer Helpers - These are helper routines to make working with char* the same as easy as + These are helper routines to make working with char* as easy as working with strings. */ //@{ @@ -369,7 +369,7 @@ public: If you get a linker error about these being missing, you have made mistake in your code. DO NOT IMPLEMENT THESE FUNCTIONS as a fix. - All of thse problems stem from trying to support char* in LLSD or in + All of these problems stem from trying to support char* in LLSD or in std::string. There are too many automatic casts that will lead to using an arbitrary pointer or scalar type to std::string. */ @@ -378,7 +378,7 @@ public: void assign(const void*); ///< assign from arbitrary pointers LLSD& operator=(const void*); ///< assign from arbitrary pointers - bool has(Integer) const; ///< has only works for Maps + bool has(Integer) const; ///< has() only works for Maps //@} /** @name Implementation */ @@ -464,8 +464,8 @@ struct llsd_select_string : public std::unary_function LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLSD& llsd); /** QUESTIONS & TO DOS - - Would Binary be more convenient as usigned char* buffer semantics? - - Should Binary be convertable to/from String, and if so how? + - Would Binary be more convenient as unsigned char* buffer semantics? + - Should Binary be convertible to/from String, and if so how? - as UTF8 encoded strings (making not like UUID<->String) - as Base64 or Base96 encoded (making like UUID<->String) - Conversions to std::string and LLUUID do not result in easy assignment -- cgit v1.2.3 From bd5b1ed713506d365793c7f9cb49d506ce392e7a Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 17 Nov 2011 13:55:11 -0500 Subject: LLSD-14: Make dumpStats()/calcStats() implementation more robust per Monty code review --- indra/llcommon/llsd.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp index b0801745d7..39d1f3e35f 100644 --- a/indra/llcommon/llsd.cpp +++ b/indra/llcommon/llsd.cpp @@ -732,10 +732,10 @@ const LLSD& LLSD::Impl::undef() void LLSD::Impl::dumpStats() const { S32 type_counts[LLSD::TypeLLSDNumTypes + 1]; - memset(&type_counts, 0, LLSD::TypeLLSDNumTypes * sizeof(S32)); + memset(&type_counts, 0, sizeof(type_counts)); S32 share_counts[LLSD::TypeLLSDNumTypes + 1]; - memset(&share_counts, 0, LLSD::TypeLLSDNumTypes * sizeof(S32)); + memset(&share_counts, 0, sizeof(share_counts)); // Add info from all the values this object has calcStats(type_counts, share_counts); @@ -753,11 +753,15 @@ void LLSD::Impl::dumpStats() const void LLSD::Impl::calcStats(S32 type_counts[], S32 share_counts[]) const -{ - type_counts[(S32) type()]++; - if (shared()) +{ + S32 type = S32(type()); + if (0 <= type && type < LLSD::TypeLLSDNumTypes) { - share_counts[(S32) type()]++; + type_counts[type]++; + if (shared()) + { + share_counts[type]++; + } } } -- cgit v1.2.3 From b49c934bd913c0973630abf32ea566eefa1aa973 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 17 Nov 2011 15:03:25 -0500 Subject: LLSD-14: fixed way-too-overloaded local variable. --- indra/llcommon/llsd.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp index 39d1f3e35f..3fa08aee8d 100644 --- a/indra/llcommon/llsd.cpp +++ b/indra/llcommon/llsd.cpp @@ -754,13 +754,13 @@ void LLSD::Impl::dumpStats() const void LLSD::Impl::calcStats(S32 type_counts[], S32 share_counts[]) const { - S32 type = S32(type()); - if (0 <= type && type < LLSD::TypeLLSDNumTypes) + S32 tp = S32(type()); + if (0 <= tp && tp < LLSD::TypeLLSDNumTypes) { - type_counts[type]++; + type_counts[tp]++; if (shared()) { - share_counts[type]++; + share_counts[tp]++; } } } -- cgit v1.2.3 From ed596077c4eb5b1ba6be4a71824ef220c086d436 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 18 Nov 2011 09:47:55 -0500 Subject: STORM-591 Removed commented out debugging lines --- indra/newview/llvieweraudio.cpp | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index 10ba54356c..0262da4dee 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -65,12 +65,6 @@ void LLViewerAudio::registerIdleListener() void LLViewerAudio::startInternetStreamWithAutoFade(std::string streamURI) { -/* llinfos << "DBG streamURI: " << streamURI << llendl; - llinfos << "DBG mNextStreamURI: " << mNextStreamURI << llendl; - if (mFadeState == FADE_OUT) {llinfos << "DBG mFadeState: FADE_OUT " << llendl;} - if (mFadeState == FADE_IN) {llinfos << "DBG mFadeState: FADE_IN " << llendl;} - if (mFadeState == FADE_IDLE) {llinfos << "DBG mFadeState: FADE_IDLE " << llendl;} -*/ // Old and new stream are identical if (mNextStreamURI == streamURI) { @@ -86,14 +80,11 @@ void LLViewerAudio::startInternetStreamWithAutoFade(std::string streamURI) if (!gAudiop->getInternetStreamURL().empty()) { mFadeState = FADE_OUT; -//llinfos << "DBG new mFadeState: OUT" << llendl; } // Otherwise the new stream can be faded in else { mFadeState = FADE_IN; -//llinfos << "DBG new mFadeState: IN" << llendl; - gAudiop->startInternetStream(mNextStreamURI); startFading(); registerIdleListener(); @@ -123,10 +114,6 @@ bool LLViewerAudio::onIdleUpdate() { if (mDone) { -/* if (mFadeState == FADE_OUT) {llinfos << "DBG mFadeState: FADE_OUT " << llendl;} - if (mFadeState == FADE_IN) {llinfos << "DBG mFadeState: FADE_IN " << llendl;} - if (mFadeState == FADE_IDLE) {llinfos << "DBG mFadeState: FADE_IDLE " << llendl;} -*/ // This should be a rare or never occurring state. if (mFadeState == FADE_IDLE) { @@ -144,7 +131,6 @@ bool LLViewerAudio::onIdleUpdate() if (!mNextStreamURI.empty()) { mFadeState = FADE_IN; -//llinfos << "DBG new mFadeState: IN" << llendl; gAudiop->startInternetStream(mNextStreamURI); startFading(); return false; @@ -152,7 +138,6 @@ bool LLViewerAudio::onIdleUpdate() else { mFadeState = FADE_IDLE; -//llinfos << "DBG new mFadeState: IDLE" << llendl; deregisterIdleListener(); return true; // Stop calling onIdleUpdate } @@ -164,12 +149,10 @@ bool LLViewerAudio::onIdleUpdate() mFadeState = FADE_OUT; startFading(); return false; -//llinfos << "DBG new mFadeState: OUT" << llendl; } else { mFadeState = FADE_IDLE; -//llinfos << "DBG new mFadeState: IDLE" << llendl; deregisterIdleListener(); return true; // Stop calling onIdleUpdate } @@ -181,12 +164,9 @@ bool LLViewerAudio::onIdleUpdate() void LLViewerAudio::stopInternetStreamWithAutoFade() { -//llinfos << "DBG stopping stream" << llendl; mFadeState = FADE_IDLE; -//llinfos << "DBG new mFadeState: IDLE" << llendl; mNextStreamURI = LLStringUtil::null; mDone = true; -//llinfos << "DBG mDone: true" << llendl; gAudiop->startInternetStream(LLStringUtil::null); gAudiop->stopInternetStream(); @@ -194,8 +174,6 @@ void LLViewerAudio::stopInternetStreamWithAutoFade() void LLViewerAudio::startFading() { -//llinfos << "DBG startFading" << llendl; - if(mDone) { // The fade state here should only be one of FADE_IN or FADE_OUT, but, in case it is not, @@ -208,7 +186,6 @@ void LLViewerAudio::startFading() stream_fade_timer.reset(); stream_fade_timer.setTimerExpirySec(mFadeTime); mDone = false; -//llinfos << "DBG mDone: false" << llendl; } } @@ -349,7 +326,6 @@ void audio_update_volume(bool force_update) F32 music_volume = gSavedSettings.getF32("AudioLevelMusic"); BOOL music_muted = gSavedSettings.getBOOL("MuteMusic"); F32 fade_volume = LLViewerAudio::getInstance()->getFadeVolume(); -//llinfos << "DBG fade_volume:" << fade_volume << llendl; music_volume = mute_volume * master_volume * music_volume * fade_volume; gAudiop->setInternetStreamGain (music_muted ? 0.f : music_volume); -- cgit v1.2.3 From 17ca9f9ae7b80dd9797408487499e9d3168c6291 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 18 Nov 2011 15:13:12 -0800 Subject: Removed unused code from alpha fragment shaders to fix some mac rendering glitches with non-fullbright alpha objects. --- .../app_settings/shaders/class1/deferred/alphaF.glsl | 13 ------------- .../app_settings/shaders/class2/deferred/alphaF.glsl | 13 ------------- 2 files changed, 26 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index 4cca287356..c012efa056 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -51,19 +51,6 @@ VARYING vec2 vary_texcoord0; uniform mat4 inv_proj; -vec4 getPosition(vec2 pos_screen) -{ - float depth = texture2DRect(depthMap, pos_screen.xy).a; - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - void main() { vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index 8d88e93698..1179b212ae 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -56,19 +56,6 @@ uniform float shadow_bias; uniform mat4 inv_proj; -vec4 getPosition(vec2 pos_screen) -{ - float depth = texture2DRect(depthMap, pos_screen.xy).a; - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos.xyz /= pos.w; - pos.w = 1.0; - return pos; -} - float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl) { stc.xyz /= stc.w; -- cgit v1.2.3 From e97fb23218734d1fbda87eedd7659235777a69ae Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 19 Nov 2011 10:02:20 -0500 Subject: Make LLSD diagnostic methods conditional on LLSD_DEBUG_INFO. This establishes that there are no viewer-side unit tests relying on these methods. The point is to try to clean up the LLSD public API. In the same vein, remove from LLSD public API a diagnostic method which is nothing more than an implementation detail for the corresponding LLSD::Impl method. The same effect can be achieved by making LLSD::Impl a friend of LLSD, moving the method with the messy signature (classic-C arrays!) into LLSD::Impl itself. --- indra/llcommon/llsd.cpp | 19 ++++++++++++++----- indra/llcommon/llsd.h | 14 +++++++++++++- 2 files changed, 27 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp index 3fa08aee8d..1bd5d06d29 100644 --- a/indra/llcommon/llsd.cpp +++ b/indra/llcommon/llsd.cpp @@ -148,6 +148,13 @@ public: virtual void dumpStats() const; virtual void calcStats(S32 type_counts[], S32 share_counts[]) const; + // Container subclasses contain LLSD objects, rather than directly + // containing Impl objects. This helper forwards through LLSD. + void calcStats(const LLSD& llsd, S32 type_counts[], S32 share_counts[]) const + { + safe(llsd.impl).calcStats(type_counts, share_counts); + } + static const LLSD& undef(); @@ -459,7 +466,7 @@ namespace while (iter != endMap()) { //std::cout << " " << (*iter).first << ": " << (*iter).second << std::endl; - (*iter).second.calcStats(type_counts, share_counts); + Impl::calcStats((*iter).second, type_counts, share_counts); iter++; } @@ -606,7 +613,7 @@ namespace LLSD::array_const_iterator iter = beginArray(); while (iter != endArray()) { // Add values for all items held in the array - (*iter).calcStats(type_counts, share_counts); + Impl::calcStats((*iter), type_counts, share_counts); iter++; } @@ -802,7 +809,7 @@ void LLSD::clear() { Impl::assignUndefined(impl); } LLSD::Type LLSD::type() const { return safe(impl).type(); } -// Scaler Constructors +// Scalar Constructors LLSD::LLSD(Boolean v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); } LLSD::LLSD(Integer v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); } LLSD::LLSD(Real v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); } @@ -894,8 +901,10 @@ LLSD& LLSD::operator[](Integer i) const LLSD& LLSD::operator[](Integer i) const { return safe(impl).ref(i); } +#ifdef LLSD_DEBUG_INFO U32 LLSD::allocationCount() { return Impl::sAllocationCount; } U32 LLSD::outstandingCount() { return Impl::sOutstandingCount; } +#endif static const char *llsd_dump(const LLSD &llsd, bool useXMLFormat) { @@ -947,9 +956,9 @@ LLSD::array_const_iterator LLSD::endArray() const { return safe(impl).endArray() // Diagnostic dump of contents in an LLSD object +#ifdef LLSD_DEBUG_INFO void LLSD::dumpStats() const { safe(impl).dumpStats(); } -void LLSD::calcStats(S32 type_counts[], S32 share_counts[]) const - { safe(impl).calcStats(type_counts, share_counts); } +#endif // static std::string LLSD::typeString(Type type) diff --git a/indra/llcommon/llsd.h b/indra/llcommon/llsd.h index 80c3e9e7b5..3519b134c2 100644 --- a/indra/llcommon/llsd.h +++ b/indra/llcommon/llsd.h @@ -387,13 +387,20 @@ public: class Impl; private: Impl* impl; + friend class LLSD::Impl; //@} /** @name Unit Testing Interface */ //@{ public: +#ifdef LLSD_DEBUG_INFO + /// @warn THESE COUNTS WILL NOT BE ACCURATE IN A MULTI-THREADED + /// ENVIRONMENT. + /// + /// These counts track LLSD::Impl (hidden) objects. static U32 allocationCount(); ///< how many Impls have been made static U32 outstandingCount(); ///< how many Impls are still alive +#endif //@} private: @@ -407,12 +414,17 @@ private: //@} public: +#ifdef LLSD_DEBUG_INFO void dumpStats() const; // Output information on object and usage - void calcStats(S32 type_counts[], S32 share_counts[]) const; // Calculate the number of LLSD objects used by this value +#endif static std::string typeString(Type type); // Return human-readable type as a string #ifdef LLSD_DEBUG_INFO + /// @warn THESE COUNTS WILL NOT BE ACCURATE IN A MULTI-THREADED + /// ENVIRONMENT. + /// + /// These counts track LLSD (public) objects. static S32 sLLSDAllocationCount; // Number of LLSD objects ever created static S32 sLLSDNetObjects; // Number of LLSD objects that exist #endif -- cgit v1.2.3 From b4766d2fde6b74c5a4a50cdde4373b5261a020e2 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Mon, 21 Nov 2011 14:42:21 -0700 Subject: fix for sh-2601: [crashhunters] crash in LLBufferArray::countAfter() sh-2602: [crashhunters] crash on exit in ~LLPumpIO() --- indra/llmessage/llcurl.cpp | 356 +++++++++++++++++++++------------- indra/llmessage/llcurl.h | 105 +++++++--- indra/llmessage/llurlrequest.cpp | 6 +- indra/newview/llappviewer.cpp | 5 + indra/newview/llxmlrpctransaction.cpp | 16 +- 5 files changed, 308 insertions(+), 180 deletions(-) (limited to 'indra') diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index 330028c926..7f61e1ac04 100644 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -86,9 +86,7 @@ S32 gCurlMultiCount = 0; std::vector LLCurl::sSSLMutex; std::string LLCurl::sCAPath; std::string LLCurl::sCAFile; - -bool LLCurl::sMultiThreaded = false; -static U32 sMainThreadID = 0; +LLCurlThread* LLCurl::sCurlThread = NULL ; void check_curl_code(CURLcode code) { @@ -221,14 +219,11 @@ namespace boost std::set LLCurl::Easy::sFreeHandles; std::set LLCurl::Easy::sActiveHandles; -LLMutex* LLCurl::Easy::sHandleMutex = NULL; -LLMutex* LLCurl::Easy::sMultiMutex = NULL; //static CURL* LLCurl::Easy::allocEasyHandle() { CURL* ret = NULL; - LLMutexLock lock(sHandleMutex); if (sFreeHandles.empty()) { ret = curl_easy_init(); @@ -256,8 +251,6 @@ void LLCurl::Easy::releaseEasyHandle(CURL* handle) llerrs << "handle cannot be NULL!" << llendl; } - LLMutexLock lock(sHandleMutex); - if (sActiveHandles.find(handle) != sActiveHandles.end()) { sActiveHandles.erase(handle); @@ -521,23 +514,13 @@ void LLCurl::Easy::prepRequest(const std::string& url, //////////////////////////////////////////////////////////////////////////// LLCurl::Multi::Multi() - : LLThread("Curl Multi"), - mQueued(0), + : mQueued(0), mErrorCount(0), - mPerformState(PERFORM_STATE_READY) + mState(STATE_READY), + mDead(FALSE), + mMutexp(NULL), + mDeletionMutexp(NULL) { - mQuitting = false; - - mThreaded = LLCurl::sMultiThreaded && LLThread::currentID() == sMainThreadID; - if (mThreaded) - { - mSignal = new LLCondition(NULL); - } - else - { - mSignal = NULL; - } - mCurlMultiHandle = curl_multi_init(); if (!mCurlMultiHandle) { @@ -545,22 +528,20 @@ LLCurl::Multi::Multi() mCurlMultiHandle = curl_multi_init(); } - llassert_always(mCurlMultiHandle); - ++gCurlMultiCount; -} - -LLCurl::Multi::~Multi() -{ - llassert(isStopped()); + llassert_always(mCurlMultiHandle); - if (LLCurl::sMultiThreaded) + if(LLCurl::getCurlThread()->getThreaded()) { - LLCurl::Easy::sMultiMutex->lock(); + mMutexp = new LLMutex(NULL) ; + mDeletionMutexp = new LLMutex(NULL) ; } + LLCurl::getCurlThread()->addMulti(this) ; - delete mSignal; - mSignal = NULL; + ++gCurlMultiCount; +} +LLCurl::Multi::~Multi() +{ // Clean up active for(easy_active_list_t::iterator iter = mEasyActiveList.begin(); iter != mEasyActiveList.end(); ++iter) @@ -577,75 +558,149 @@ LLCurl::Multi::~Multi() mEasyFreeList.clear(); check_curl_multi_code(curl_multi_cleanup(mCurlMultiHandle)); + + delete mMutexp ; + mMutexp = NULL ; + delete mDeletionMutexp ; + mDeletionMutexp = NULL ; + --gCurlMultiCount; +} - if (LLCurl::sMultiThreaded) +void LLCurl::Multi::lock() +{ + if(mMutexp) { - LLCurl::Easy::sMultiMutex->unlock(); + mMutexp->lock() ; } } -CURLMsg* LLCurl::Multi::info_read(S32* msgs_in_queue) +void LLCurl::Multi::unlock() { - CURLMsg* curlmsg = curl_multi_info_read(mCurlMultiHandle, msgs_in_queue); - return curlmsg; + if(mMutexp) + { + mMutexp->unlock() ; + } } -void LLCurl::Multi::perform() +void LLCurl::Multi::markDead() { - if (mThreaded) + if(mDeletionMutexp) { - if (mPerformState == PERFORM_STATE_READY) - { - mSignal->signal(); - } + mDeletionMutexp->lock() ; } - else + + mDead = TRUE ; + + if(mDeletionMutexp) + { + mDeletionMutexp->unlock() ; + } +} + +void LLCurl::Multi::setState(LLCurl::Multi::ePerformState state) +{ + lock() ; + mState = state ; + if(mState == STATE_READY) { - doPerform(); + LLCurl::getCurlThread()->setPriority(mHandle, LLQueuedThread::PRIORITY_NORMAL) ; } + unlock() ; } -void LLCurl::Multi::run() +LLCurl::Multi::ePerformState LLCurl::Multi::getState() { - llassert(mThreaded); + ePerformState state ; + + lock() ; + state = mState ; + unlock() ; + + return state ; +} + +bool LLCurl::Multi::isCompleted() +{ + return STATE_COMPLETED == getState() ; +} - while (!mQuitting) +bool LLCurl::Multi::waitToComplete() +{ + if(!mMutexp) //not threaded { - mSignal->wait(); - mPerformState = PERFORM_STATE_PERFORMING; - if (!mQuitting) - { - LLMutexLock lock(LLCurl::Easy::sMultiMutex); - doPerform(); - } + doPerform() ; + return true ; + } + + bool completed ; + + lock() ; + completed = (STATE_COMPLETED == mState) ; + if(!completed) + { + LLCurl::getCurlThread()->setPriority(mHandle, LLQueuedThread::PRIORITY_URGENT) ; } + unlock() ; + + return completed; } -void LLCurl::Multi::doPerform() +CURLMsg* LLCurl::Multi::info_read(S32* msgs_in_queue) { - S32 q = 0; - for (S32 call_count = 0; - call_count < MULTI_PERFORM_CALL_REPEAT; - call_count += 1) + CURLMsg* curlmsg = curl_multi_info_read(mCurlMultiHandle, msgs_in_queue); + return curlmsg; +} + +//return true if dead +bool LLCurl::Multi::doPerform() +{ + if(mDeletionMutexp) + { + mDeletionMutexp->lock() ; + } + bool dead = mDead ; + + if(mDead) { - CURLMcode code = curl_multi_perform(mCurlMultiHandle, &q); - if (CURLM_CALL_MULTI_PERFORM != code || q == 0) + setState(STATE_COMPLETED); + mQueued = 0 ; + } + else if(getState() != STATE_COMPLETED) + { + setState(STATE_PERFORMING); + + S32 q = 0; + for (S32 call_count = 0; + call_count < MULTI_PERFORM_CALL_REPEAT; + call_count++) { - check_curl_multi_code(code); - break; + CURLMcode code = curl_multi_perform(mCurlMultiHandle, &q); + if (CURLM_CALL_MULTI_PERFORM != code || q == 0) + { + check_curl_multi_code(code); + + break; + } } - + + mQueued = q; + setState(STATE_COMPLETED) ; } - mQueued = q; - mPerformState = PERFORM_STATE_COMPLETED; + + if(mDeletionMutexp) + { + mDeletionMutexp->unlock() ; + } + + return dead ; } S32 LLCurl::Multi::process() { - perform(); + waitToComplete() ; - if (mPerformState != PERFORM_STATE_COMPLETED) + if (getState() != STATE_COMPLETED) { return 0; } @@ -681,7 +736,8 @@ S32 LLCurl::Multi::process() } } - mPerformState = PERFORM_STATE_READY; + setState(STATE_READY); + return processed; } @@ -739,6 +795,75 @@ void LLCurl::Multi::removeEasy(Easy* easy) easyFree(easy); } +//------------------------------------------------------------ +//LLCurlThread +LLCurlThread::CurlRequest::CurlRequest(handle_t handle, LLCurl::Multi* multi) : + LLQueuedThread::QueuedRequest(handle, LLQueuedThread::PRIORITY_NORMAL, FLAG_AUTO_COMPLETE), + mMulti(multi) +{ +} + +LLCurlThread::CurlRequest::~CurlRequest() +{ + if(mMulti) + { + delete mMulti ; + mMulti = NULL ; + } +} + +bool LLCurlThread::CurlRequest::processRequest() +{ + bool completed = true ; + if(mMulti) + { + completed = mMulti->doPerform() ; + setPriority(LLQueuedThread::PRIORITY_LOW) ; + } + + return completed ; +} + +void LLCurlThread::CurlRequest::finishRequest(bool completed) +{ + delete mMulti ; + mMulti = NULL ; +} + +LLCurlThread::LLCurlThread(bool threaded) : + LLQueuedThread("curlthread", threaded) +{ +} + +//virtual +LLCurlThread::~LLCurlThread() +{ +} + +S32 LLCurlThread::update(U32 max_time_ms) +{ + return LLQueuedThread::update(max_time_ms); +} + +void LLCurlThread::addMulti(LLCurl::Multi* multi) +{ + multi->mHandle = generateHandle() ; + + CurlRequest* req = new CurlRequest(multi->mHandle, multi) ; + + if (!addRequest(req)) + { + llwarns << "curl request added when the thread is quitted" << llendl; + } +} + +void LLCurlThread::deleteMulti(LLCurl::Multi* multi) +{ + multi->markDead() ; +} + +//------------------------------------------------------------ + //static std::string LLCurl::strerror(CURLcode errorcode) { @@ -753,39 +878,23 @@ LLCurlRequest::LLCurlRequest() : mActiveMulti(NULL), mActiveRequestCount(0) { - mThreadID = LLThread::currentID(); mProcessing = FALSE; } LLCurlRequest::~LLCurlRequest() { - llassert_always(mThreadID == LLThread::currentID()); - //stop all Multi handle background threads for (curlmulti_set_t::iterator iter = mMultiSet.begin(); iter != mMultiSet.end(); ++iter) { - LLCurl::Multi* multi = *iter; - multi->mQuitting = true; - if (multi->mThreaded) - { - while (!multi->isStopped()) - { - multi->mSignal->signal(); - apr_sleep(1000); - } - } + LLCurl::getCurlThread()->deleteMulti(*iter) ; } - for_each(mMultiSet.begin(), mMultiSet.end(), DeletePointer()); + mMultiSet.clear() ; } void LLCurlRequest::addMulti() { - llassert_always(mThreadID == LLThread::currentID()); LLCurl::Multi* multi = new LLCurl::Multi(); - if (multi->mThreaded) - { - multi->start(); - } + mMultiSet.insert(multi); mActiveMulti = multi; mActiveRequestCount = 0; @@ -901,7 +1010,6 @@ bool LLCurlRequest::post(const std::string& url, // Note: call once per frame S32 LLCurlRequest::process() { - llassert_always(mThreadID == LLThread::currentID()); S32 res = 0; mProcessing = TRUE; @@ -915,17 +1023,7 @@ S32 LLCurlRequest::process() if (multi != mActiveMulti && tres == 0 && multi->mQueued == 0) { mMultiSet.erase(curiter); - multi->mQuitting = true; - if (multi->mThreaded) - { - while (!multi->isStopped()) - { - multi->mSignal->signal(); - apr_sleep(1000); - } - } - - delete multi; + LLCurl::getCurlThread()->deleteMulti(multi); } } mProcessing = FALSE; @@ -934,7 +1032,6 @@ S32 LLCurlRequest::process() S32 LLCurlRequest::getQueued() { - llassert_always(mThreadID == LLThread::currentID()); S32 queued = 0; for (curlmulti_set_t::iterator iter = mMultiSet.begin(); iter != mMultiSet.end(); ) @@ -942,7 +1039,7 @@ S32 LLCurlRequest::getQueued() curlmulti_set_t::iterator curiter = iter++; LLCurl::Multi* multi = *curiter; queued += multi->mQueued; - if (multi->mPerformState != LLCurl::Multi::PERFORM_STATE_READY) + if (multi->getState() != LLCurl::Multi::STATE_READY) { ++queued; } @@ -959,10 +1056,7 @@ LLCurlEasyRequest::LLCurlEasyRequest() mResultReturned(false) { mMulti = new LLCurl::Multi(); - if (mMulti->mThreaded) - { - mMulti->start(); - } + mEasy = mMulti->allocEasy(); if (mEasy) { @@ -975,16 +1069,7 @@ LLCurlEasyRequest::LLCurlEasyRequest() LLCurlEasyRequest::~LLCurlEasyRequest() { - mMulti->mQuitting = true; - if (mMulti->mThreaded) - { - while (!mMulti->isStopped()) - { - mMulti->mSignal->signal(); - apr_sleep(1000); - } - } - delete mMulti; + LLCurl::getCurlThread()->deleteMulti(mMulti) ; } void LLCurlEasyRequest::setopt(CURLoption option, S32 value) @@ -1080,19 +1165,14 @@ void LLCurlEasyRequest::requestComplete() } } -void LLCurlEasyRequest::perform() -{ - mMulti->perform(); -} - // Usage: Call getRestult until it returns false (no more messages) bool LLCurlEasyRequest::getResult(CURLcode* result, LLCurl::TransferInfo* info) { - if (mMulti->mPerformState != LLCurl::Multi::PERFORM_STATE_COMPLETED) + if (!mMulti->isCompleted()) { //we're busy, try again later return false; } - mMulti->mPerformState = LLCurl::Multi::PERFORM_STATE_READY; + mMulti->setState(LLCurl::Multi::STATE_READY) ; if (!mEasy) { @@ -1180,8 +1260,6 @@ unsigned long LLCurl::ssl_thread_id(void) void LLCurl::initClass(bool multi_threaded) { - sMainThreadID = LLThread::currentID(); - sMultiThreaded = multi_threaded; // Do not change this "unless you are familiar with and mean to control // internal operations of libcurl" // - http://curl.haxx.se/libcurl/c/curl_global_init.html @@ -1189,9 +1267,6 @@ void LLCurl::initClass(bool multi_threaded) check_curl_code(code); - Easy::sHandleMutex = new LLMutex(NULL); - Easy::sMultiMutex = new LLMutex(NULL); - #if SAFE_SSL S32 mutex_count = CRYPTO_num_locks(); for (S32 i=0; iupdate(1)) //finish all tasks + { + break ; + } + } + sCurlThread->shutdown() ; + delete sCurlThread ; + sCurlThread = NULL ; + #if SAFE_SSL CRYPTO_set_locking_callback(NULL); for_each(sSSLMutex.begin(), sSSLMutex.end(), DeletePointer()); #endif - delete Easy::sHandleMutex; - Easy::sHandleMutex = NULL; - delete Easy::sMultiMutex; - Easy::sMultiMutex = NULL; - for (std::set::iterator iter = Easy::sFreeHandles.begin(); iter != Easy::sFreeHandles.end(); ++iter) { CURL* curl = *iter; diff --git a/indra/llmessage/llcurl.h b/indra/llmessage/llcurl.h index 87de202717..23a6ca67e3 100755 --- a/indra/llmessage/llcurl.h +++ b/indra/llmessage/llcurl.h @@ -42,8 +42,10 @@ #include "lliopipe.h" #include "llsd.h" #include "llthread.h" +#include "llqueuedthread.h" class LLMutex; +class LLCurlThread; // For whatever reason, this is not typedef'd in curl.h typedef size_t (*curl_header_callback)(void *ptr, size_t size, size_t nmemb, void *stream); @@ -56,8 +58,6 @@ public: class Easy; class Multi; - static bool sMultiThreaded; - struct TransferInfo { TransferInfo() : mSizeDownload(0.0), mTotalTime(0.0), mSpeedDownload(0.0) {} @@ -181,10 +181,12 @@ public: static void ssl_locking_callback(int mode, int type, const char *file, int line); static unsigned long ssl_thread_id(void); + static LLCurlThread* getCurlThread() { return sCurlThread ;} private: static std::string sCAPath; static std::string sCAFile; static const unsigned int MAX_REDIRECTS; + static LLCurlThread* sCurlThread; }; class LLCurl::Easy @@ -216,7 +218,7 @@ public: U32 report(CURLcode); void getTransferInfo(LLCurl::TransferInfo* info); - void prepRequest(const std::string& url, const std::vector& headers, ResponderPtr, S32 time_out = 0, bool post = false); + void prepRequest(const std::string& url, const std::vector& headers, LLCurl::ResponderPtr, S32 time_out = 0, bool post = false); const char* getErrorBuffer(); @@ -247,64 +249,105 @@ private: // Note: char*'s not strings since we pass pointers to curl std::vector mStrings; - ResponderPtr mResponder; + LLCurl::ResponderPtr mResponder; static std::set sFreeHandles; static std::set sActiveHandles; - static LLMutex* sHandleMutex; - static LLMutex* sMultiMutex; }; -class LLCurl::Multi : public LLThread +class LLCurl::Multi { LOG_CLASS(Multi); + + friend class LLCurlThread ; + +private: + ~Multi(); + + void markDead() ; + bool doPerform(); + public: typedef enum { - PERFORM_STATE_READY=0, - PERFORM_STATE_PERFORMING=1, - PERFORM_STATE_COMPLETED=2 + STATE_READY=0, + STATE_PERFORMING=1, + STATE_COMPLETED=2 } ePerformState; - Multi(); - ~Multi(); + Multi(); - Easy* allocEasy(); - bool addEasy(Easy* easy); + LLCurl::Easy* allocEasy(); + bool addEasy(LLCurl::Easy* easy); + void removeEasy(LLCurl::Easy* easy); - void removeEasy(Easy* easy); + void lock() ; + void unlock() ; + + void setState(ePerformState state) ; + ePerformState getState() ; + bool isCompleted() ; + + bool waitToComplete() ; S32 process(); - void perform(); - void doPerform(); - virtual void run(); - CURLMsg* info_read(S32* msgs_in_queue); S32 mQueued; S32 mErrorCount; - S32 mPerformState; - - LLCondition* mSignal; - bool mQuitting; - bool mThreaded; - private: - void easyFree(Easy*); + void easyFree(LLCurl::Easy*); CURLM* mCurlMultiHandle; - typedef std::set easy_active_list_t; + typedef std::set easy_active_list_t; easy_active_list_t mEasyActiveList; - typedef std::map easy_active_map_t; + typedef std::map easy_active_map_t; easy_active_map_t mEasyActiveMap; - typedef std::set easy_free_list_t; + typedef std::set easy_free_list_t; easy_free_list_t mEasyFreeList; + + LLQueuedThread::handle_t mHandle ; + ePerformState mState; + + BOOL mDead ; + LLMutex* mMutexp ; + LLMutex* mDeletionMutexp ; }; +class LLCurlThread : public LLQueuedThread +{ +public: + + class CurlRequest : public LLQueuedThread::QueuedRequest + { + protected: + virtual ~CurlRequest(); // use deleteRequest() + + public: + CurlRequest(handle_t handle, LLCurl::Multi* multi); + + /*virtual*/ bool processRequest(); + /*virtual*/ void finishRequest(bool completed); + + private: + // input + LLCurl::Multi* mMulti; + }; + +public: + LLCurlThread(bool threaded = true) ; + virtual ~LLCurlThread() ; + + S32 update(U32 max_time_ms); + + void addMulti(LLCurl::Multi* multi) ; + void deleteMulti(LLCurl::Multi* multi) ; +} ; + namespace boost { void intrusive_ptr_add_ref(LLCurl::Responder* p); @@ -339,7 +382,6 @@ private: LLCurl::Multi* mActiveMulti; S32 mActiveRequestCount; BOOL mProcessing; - U32 mThreadID; // debug }; class LLCurlEasyRequest @@ -357,9 +399,10 @@ public: void slist_append(const char* str); void sendRequest(const std::string& url); void requestComplete(); - void perform(); bool getResult(CURLcode* result, LLCurl::TransferInfo* info = NULL); std::string getErrorString(); + bool isCompleted() {return mMulti->isCompleted() ;} + bool wait() { return mMulti->waitToComplete(); } LLCurl::Easy* getEasy() const { return mEasy; } diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp index fa03bb7512..a3a2b2b1b8 100644 --- a/indra/llmessage/llurlrequest.cpp +++ b/indra/llmessage/llurlrequest.cpp @@ -170,6 +170,7 @@ LLURLRequest::~LLURLRequest() { LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST); delete mDetail; + mDetail = NULL ; } void LLURLRequest::setURL(const std::string& url) @@ -344,7 +345,10 @@ LLIOPipe::EStatus LLURLRequest::process_impl( static LLFastTimer::DeclareTimer FTM_URL_PERFORM("Perform"); { LLFastTimer t(FTM_URL_PERFORM); - mDetail->mCurlRequest->perform(); + if(!mDetail->mCurlRequest->wait()) + { + return status ; + } } while(1) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index c937f604fc..8b7108e1e2 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1417,6 +1417,11 @@ bool LLAppViewer::mainLoop() } } gMeshRepo.update() ; + + if(!LLCurl::getCurlThread()->update(1)) + { + LLCurl::getCurlThread()->pause() ; //nothing in the curl thread. + } if(!total_work_pending) //pause texture fetching threads if nothing to process. { diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index f483ba5af8..920a9a3752 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -382,19 +382,11 @@ bool LLXMLRPCTransaction::Impl::process() // continue onward } } - - //const F32 MAX_PROCESSING_TIME = 0.05f; - //LLTimer timer; - - mCurlRequest->perform(); - - /*while (mCurlRequest->perform() > 0) + + if(!mCurlRequest->wait()) { - if (timer.getElapsedTimeF32() >= MAX_PROCESSING_TIME) - { - return false; - } - }*/ + return false ; + } while(1) { -- cgit v1.2.3 From 08f364bfc9aaeb771145d660287427c41b1dc0bf Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 21 Nov 2011 16:00:52 -0600 Subject: SH-2708 Fix for broken shadows on alpha objects --- .../shaders/class1/deferred/shadowAlphaMaskF.glsl | 2 +- .../shaders/class1/deferred/shadowAlphaMaskV.glsl | 5 +++- indra/newview/lldrawpool.h | 1 - indra/newview/llviewershadermgr.cpp | 1 + indra/newview/llvovolume.cpp | 5 ---- indra/newview/pipeline.cpp | 27 ++++++++++++++++++---- indra/newview/pipeline.h | 3 +-- 7 files changed, 29 insertions(+), 15 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl index 46d42d2a4a..c1fb7b55d4 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl @@ -37,7 +37,7 @@ VARYING vec2 vary_texcoord0; void main() { - float alpha = texture2D(diffuseMap, vary_texcoord0.xy).a * vertex_color.a; + float alpha = diffuseLookup(vary_texcoord0.xy).a * vertex_color.a; if (alpha < minimum_alpha) { diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl index 6a3cba771b..7d3b06c56e 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl @@ -34,15 +34,18 @@ VARYING vec4 post_pos; VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; +void passTextureIndex(); + void main() { //transform vertex vec4 pos = modelview_projection_matrix*vec4(position.xyz, 1.0); - post_pos = pos; gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w); + passTextureIndex(); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; vertex_color = diffuse_color; } diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h index c7acbb42c6..5a2981e749 100644 --- a/indra/newview/lldrawpool.h +++ b/indra/newview/lldrawpool.h @@ -133,7 +133,6 @@ public: PASS_ALPHA, PASS_ALPHA_MASK, PASS_FULLBRIGHT_ALPHA_MASK, - PASS_ALPHA_SHADOW, NUM_RENDER_TYPES, }; diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 18ae83e3b6..bddc07b395 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -1338,6 +1338,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() if (success) { gDeferredShadowAlphaMaskProgram.mName = "Deferred Shadow Alpha Mask Shader"; + gDeferredShadowAlphaMaskProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; gDeferredShadowAlphaMaskProgram.mShaderFiles.clear(); gDeferredShadowAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredShadowAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskF.glsl", GL_FRAGMENT_SHADER_ARB)); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index baab191cb6..3d013f286c 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4896,11 +4896,6 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: { registerFace(group, facep, LLRenderPass::PASS_ALPHA); } - - if (LLPipeline::sRenderDeferred) - { - registerFace(group, facep, LLRenderPass::PASS_ALPHA_SHADOW); - } } else if (gPipeline.canUseVertexShaders() && group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_HUD diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index d8e271811a..f3d5f94813 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -6159,13 +6159,13 @@ void LLPipeline::resetVertexBuffers() LLVertexBuffer::initClass(LLVertexBuffer::sEnableVBOs, LLVertexBuffer::sDisableVBOMapping); } -void LLPipeline::renderObjects(U32 type, U32 mask, BOOL texture) +void LLPipeline::renderObjects(U32 type, U32 mask, BOOL texture, BOOL batch_texture) { LLMemType mt_ro(LLMemType::MTYPE_PIPELINE_RENDER_OBJECTS); assertInitialized(); gGL.loadMatrix(gGLModelView); gGLLastMatrix = NULL; - mSimplePool->pushBatches(type, mask); + mSimplePool->pushBatches(type, mask, texture, batch_texture); gGL.loadMatrix(gGLModelView); gGLLastMatrix = NULL; } @@ -8195,7 +8195,14 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera } LLPipeline::sShadowRender = TRUE; - U32 types[] = { LLRenderPass::PASS_SIMPLE, LLRenderPass::PASS_FULLBRIGHT, LLRenderPass::PASS_SHINY, LLRenderPass::PASS_BUMP, LLRenderPass::PASS_FULLBRIGHT_SHINY }; + U32 types[] = { + LLRenderPass::PASS_SIMPLE, + LLRenderPass::PASS_FULLBRIGHT, + LLRenderPass::PASS_SHINY, + LLRenderPass::PASS_BUMP, + LLRenderPass::PASS_FULLBRIGHT_SHINY + }; + LLGLEnable cull(GL_CULL_FACE); if (use_shader) @@ -8267,7 +8274,15 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera LLFastTimer ftm(FTM_SHADOW_ALPHA); gDeferredShadowAlphaMaskProgram.bind(); gDeferredShadowAlphaMaskProgram.setMinimumAlpha(0.598f); - renderObjects(LLRenderPass::PASS_ALPHA_SHADOW, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_COLOR, TRUE); + + U32 mask = LLVertexBuffer::MAP_VERTEX | + LLVertexBuffer::MAP_TEXCOORD0 | + LLVertexBuffer::MAP_COLOR | + LLVertexBuffer::MAP_TEXTURE_INDEX; + + renderObjects(LLRenderPass::PASS_ALPHA_MASK, mask, TRUE, TRUE); + renderObjects(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, mask, TRUE, TRUE); + renderObjects(LLRenderPass::PASS_ALPHA, mask, TRUE, TRUE); gDeferredTreeShadowProgram.bind(); gDeferredTreeShadowProgram.setMinimumAlpha(0.598f); renderObjects(LLRenderPass::PASS_GRASS, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, TRUE); @@ -8589,7 +8604,9 @@ void LLPipeline::generateSunShadow(LLCamera& camera) LLPipeline::RENDER_TYPE_TERRAIN, LLPipeline::RENDER_TYPE_WATER, LLPipeline::RENDER_TYPE_VOIDWATER, - LLPipeline::RENDER_TYPE_PASS_ALPHA_SHADOW, + LLPipeline::RENDER_TYPE_PASS_ALPHA, + LLPipeline::RENDER_TYPE_PASS_ALPHA_MASK, + LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_ALPHA_MASK, LLPipeline::RENDER_TYPE_PASS_GRASS, LLPipeline::RENDER_TYPE_PASS_SIMPLE, LLPipeline::RENDER_TYPE_PASS_BUMP, diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 8b6532ca25..c6b2e20fa5 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -231,7 +231,7 @@ public: void postSort(LLCamera& camera); void forAllVisibleDrawables(void (*func)(LLDrawable*)); - void renderObjects(U32 type, U32 mask, BOOL texture = TRUE); + void renderObjects(U32 type, U32 mask, BOOL texture = TRUE, BOOL batch_texture = FALSE); void renderGroups(LLRenderPass* pass, U32 type, U32 mask, BOOL texture); void grabReferences(LLCullResult& result); @@ -408,7 +408,6 @@ public: RENDER_TYPE_PASS_ALPHA = LLRenderPass::PASS_ALPHA, RENDER_TYPE_PASS_ALPHA_MASK = LLRenderPass::PASS_ALPHA_MASK, RENDER_TYPE_PASS_FULLBRIGHT_ALPHA_MASK = LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, - RENDER_TYPE_PASS_ALPHA_SHADOW = LLRenderPass::PASS_ALPHA_SHADOW, // Following are object types (only used in drawable mRenderType) RENDER_TYPE_HUD = LLRenderPass::NUM_RENDER_TYPES, RENDER_TYPE_VOLUME, -- cgit v1.2.3 From 1dd24cfcf85f4807410bb8d5320a692e2d7e121c Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 21 Nov 2011 17:40:12 -0500 Subject: SH-2614 FIX, SH-2684 FIX - fixed buggy state management in onPhysicsUseLOD --- indra/newview/llfloatermodelpreview.cpp | 38 ++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) mode change 100644 => 100755 indra/newview/llfloatermodelpreview.cpp (limited to 'indra') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp old mode 100644 new mode 100755 index 881f087d7b..49e29e7447 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -995,38 +995,38 @@ void LLFloaterModelPreview::onPhysicsBrowse(LLUICtrl* ctrl, void* userdata) //static void LLFloaterModelPreview::onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata) { - S32 num_modes = 4; - S32 which_mode = 3; - static S32 previous_mode = which_mode; + S32 num_lods = 4; + S32 which_mode; LLCtrlSelectionInterface* iface = sInstance->childGetSelectionInterface("physics_lod_combo"); if (iface) { which_mode = iface->getFirstSelectedIndex(); } + else + { + llwarns << "no iface" << llendl; + return; + } - S32 file_mode = iface->getItemCount() - 1; - bool file_browse = which_mode == file_mode; - bool lod_to_file = file_browse && (previous_mode != file_mode); - bool file_to_lod = !file_browse && (previous_mode == file_mode); - - if (!lod_to_file) + if (which_mode <= 0) { - which_mode = num_modes - which_mode; - sInstance->mModelPreview->setPhysicsFromLOD(which_mode); + llwarns << "which_mode out of range, " << which_mode << llendl; } - if (lod_to_file || file_to_lod) + S32 file_mode = iface->getItemCount() - 1; + if (which_mode < file_mode) { - LLModelPreview *model_preview = sInstance->mModelPreview; - if (model_preview) - { - model_preview->refresh(); - model_preview->updateStatusMessages(); - } + S32 which_lod = num_lods - which_mode; + sInstance->mModelPreview->setPhysicsFromLOD(which_lod); } - previous_mode = which_mode; + LLModelPreview *model_preview = sInstance->mModelPreview; + if (model_preview) + { + model_preview->refresh(); + model_preview->updateStatusMessages(); + } } //static -- cgit v1.2.3 From abf39f788609f65d1b2b3ac1548f7146aa5c8584 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 21 Nov 2011 15:15:26 -0800 Subject: Greatly reduced the number of memcpy operations done on the media plug-in message output pipe by removing 's = s.substr()' type operations. The output string is now cleared via 's.clear()' when its entire contents have been pumped and the beginning of the data is stored as an index when necessary, rather than modifying the initial string. Reviewed by davep. --- indra/llplugin/llpluginmessagepipe.cpp | 51 ++++++++++++++++++++++------------ indra/llplugin/llpluginmessagepipe.h | 1 + 2 files changed, 35 insertions(+), 17 deletions(-) (limited to 'indra') diff --git a/indra/llplugin/llpluginmessagepipe.cpp b/indra/llplugin/llpluginmessagepipe.cpp index 8d13e38ad5..091e93ea4b 100644 --- a/indra/llplugin/llpluginmessagepipe.cpp +++ b/indra/llplugin/llpluginmessagepipe.cpp @@ -94,10 +94,10 @@ void LLPluginMessagePipeOwner::killMessagePipe(void) LLPluginMessagePipe::LLPluginMessagePipe(LLPluginMessagePipeOwner *owner, LLSocket::ptr_t socket): mInputMutex(gAPRPoolp), mOutputMutex(gAPRPoolp), + mOutputStartIndex(0), mOwner(owner), mSocket(socket) { - mOwner->setMessagePipe(this); } @@ -113,6 +113,14 @@ bool LLPluginMessagePipe::addMessage(const std::string &message) { // queue the message for later output LLMutexLock lock(&mOutputMutex); + + // If we're starting to use up too much memory, clear + if (mOutputStartIndex > 1024 * 1024) + { + mOutput = mOutput.substr(mOutputStartIndex); + mOutputStartIndex = 0; + } + mOutput += message; mOutput += MESSAGE_DELIMITER; // message separator @@ -165,35 +173,44 @@ bool LLPluginMessagePipe::pumpOutput() if(mSocket) { apr_status_t status; - apr_size_t size; + apr_size_t in_size, out_size; LLMutexLock lock(&mOutputMutex); - if(!mOutput.empty()) + + const char * output_data = &(mOutput.data()[mOutputStartIndex]); + if(*output_data != '\0') { // write any outgoing messages - size = (apr_size_t)mOutput.size(); + in_size = (apr_size_t) (mOutput.size() - mOutputStartIndex); + out_size = in_size; setSocketTimeout(0); // LL_INFOS("Plugin") << "before apr_socket_send, size = " << size << LL_ENDL; - status = apr_socket_send( - mSocket->getSocket(), - (const char*)mOutput.data(), - &size); + status = apr_socket_send(mSocket->getSocket(), + output_data, + &out_size); // LL_INFOS("Plugin") << "after apr_socket_send, size = " << size << LL_ENDL; - if(status == APR_SUCCESS) + if((status == APR_SUCCESS) || APR_STATUS_IS_EAGAIN(status)) { - // success - mOutput = mOutput.substr(size); - } - else if(APR_STATUS_IS_EAGAIN(status)) - { - // Socket buffer is full... - // remove the written part from the buffer and try again later. - mOutput = mOutput.substr(size); + // Success or Socket buffer is full... + + // If we've pumped the entire string, clear it + if (out_size == in_size) + { + mOutputStartIndex = 0; + mOutput.clear(); + } + else + { + llassert(in_size > out_size); + + // Remove the written part from the buffer and try again later. + mOutputStartIndex += out_size; + } } else if(APR_STATUS_IS_EOF(status)) { diff --git a/indra/llplugin/llpluginmessagepipe.h b/indra/llplugin/llpluginmessagepipe.h index beb942c0fe..059943cc90 100644 --- a/indra/llplugin/llpluginmessagepipe.h +++ b/indra/llplugin/llpluginmessagepipe.h @@ -86,6 +86,7 @@ protected: std::string mInput; LLMutex mOutputMutex; std::string mOutput; + std::string::size_type mOutputStartIndex; LLPluginMessagePipeOwner *mOwner; LLSocket::ptr_t mSocket; -- cgit v1.2.3 From 2b43a6b8c9b22d02373ac70193fa85f2bfb77b19 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 22 Nov 2011 13:13:51 -0500 Subject: STORM-591 Remove 2 development debug settings and replace them with constants --- indra/newview/app_settings/settings.xml | 22 ---------------------- indra/newview/llvieweraudio.cpp | 7 +++++-- 2 files changed, 5 insertions(+), 24 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c7300cc1bb..3c53a9d44c 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -192,28 +192,6 @@ Value 1 - AudioMusicFadeIn - - Comment - Fade in time in seconds for music streams - Persist - 1 - Type - F32 - Value - 5.0 - - AudioMusicFadeOut - - Comment - Fade out time in seconds for music streams - Persist - 1 - Type - F32 - Value - 5.0 - AudioLevelAmbient Comment diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index 0262da4dee..1e5c742cf9 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -174,14 +174,17 @@ void LLViewerAudio::stopInternetStreamWithAutoFade() void LLViewerAudio::startFading() { + const F32 AUDIO_MUSIC_FADE_IN_TIME = 3.0; + const F32 AUDIO_MUSIC_FADE_OUT_TIME = 2.0; + if(mDone) { // The fade state here should only be one of FADE_IN or FADE_OUT, but, in case it is not, // rather than check for both states assume a fade in and check for the fade out case. - mFadeTime = llmax(0.0f, gSavedSettings.getF32("AudioMusicFadeIn")); + mFadeTime = AUDIO_MUSIC_FADE_IN_TIME; if (LLViewerAudio::getInstance()->getFadeState() == LLViewerAudio::FADE_OUT) { - mFadeTime = llmax(0.0f, gSavedSettings.getF32("AudioMusicFadeOut")); + mFadeTime = AUDIO_MUSIC_FADE_OUT_TIME; } stream_fade_timer.reset(); stream_fade_timer.setTimerExpirySec(mFadeTime); -- cgit v1.2.3 From 9850e09f7663558070bca6353a7da806a53f4441 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 22 Nov 2011 11:51:49 -0700 Subject: trivial: update the memory pool log info to the latest. --- indra/llcommon/llmemory.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp index bb7998c0a8..3b9758f996 100644 --- a/indra/llcommon/llmemory.cpp +++ b/indra/llcommon/llmemory.cpp @@ -159,6 +159,7 @@ void LLMemory::logMemoryInfo(BOOL update) if(update) { updateMemoryInfo() ; + LLPrivateMemoryPoolManager::getInstance()->updateStatistics() ; } llinfos << "Current allocated physical memory(KB): " << sAllocatedMemInKB << llendl ; -- cgit v1.2.3 From be3c6747a88d8bbb2c6b87c9eb97b14a42b90ae7 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 22 Nov 2011 11:53:44 -0700 Subject: remove redundant memory allocation for sh-2651: [crashhunters] Crash after google translate failure --- indra/llxml/llxmlnode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp index 9f1e249ddd..4362c88c4e 100644 --- a/indra/llxml/llxmlnode.cpp +++ b/indra/llxml/llxmlnode.cpp @@ -1277,7 +1277,7 @@ bool LLXMLNode::getAttribute(const LLStringTableEntry* name, LLXMLNodePtr& node, { return mDefault->getAttribute(name, node, FALSE); } - node = new LLXMLNode(); + return false; } -- cgit v1.2.3 From a4cb08ae5d20416e21bbc70540527097495af887 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 23 Nov 2011 08:42:42 -0500 Subject: STORM-591 Trivial code cleanup --- indra/newview/llvieweraudio.h | 1 - indra/newview/llviewerparcelmgr.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvieweraudio.h b/indra/newview/llvieweraudio.h index 1663f77f4a..26062a2818 100644 --- a/indra/newview/llvieweraudio.h +++ b/indra/newview/llvieweraudio.h @@ -28,7 +28,6 @@ #define LL_VIEWERAUDIO_H #include "llframetimer.h" -#include "llthread.h" #include "llsingleton.h" // comment out to turn off wind diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index ada89cc7aa..c18665a3c3 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1727,7 +1727,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use else { // Check for video - LLViewerParcelMedia::update( parcel ); + LLViewerParcelMedia::update(parcel); // Then check for music. Do this last, as there may be a delay waiting for // the stream fading thread to finish. -- cgit v1.2.3 From c69785f0b5625e655838b9cc9779407077ca770e Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 23 Nov 2011 12:05:24 -0600 Subject: SH-2449 Preserve texture scaling when animating textures when "size x" and "size y" parameters to llSetTextureAnim are zero. --- indra/llprimitive/lltextureanim.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llprimitive/lltextureanim.cpp b/indra/llprimitive/lltextureanim.cpp index 398af4e6e8..185a3f69c0 100644 --- a/indra/llprimitive/lltextureanim.cpp +++ b/indra/llprimitive/lltextureanim.cpp @@ -168,8 +168,8 @@ void LLTextureAnim::unpackTAMessage(LLDataPacker &dp) mMode = data[0]; mFace = data[1]; - mSizeX = llmax((U8)1, data[2]); - mSizeY = llmax((U8)1, data[3]); + mSizeX = data[2]; + mSizeY = data[3]; htonmemcpy(&mStart, data + 4, MVT_F32, sizeof(F32)); htonmemcpy(&mLength, data + 8, MVT_F32, sizeof(F32)); htonmemcpy(&mRate, data + 12, MVT_F32, sizeof(F32)); -- cgit v1.2.3 From 943789b53ac3f2750cb71dca6facc0de7fa39539 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 23 Nov 2011 12:11:53 -0800 Subject: SH-2710 FIX -- Removed calls to getChild happening every frame and during idle calls. Reviewed by davep. --- indra/llui/llscrolllistctrl.cpp | 8 +- indra/llui/llscrolllistctrl.h | 2 + indra/newview/lldebugview.cpp | 39 +++++---- indra/newview/lldebugview.h | 6 +- indra/newview/llfloaterwebcontent.cpp | 40 ++++++--- indra/newview/llfloaterwebcontent.h | 6 ++ indra/newview/llnearbychatbar.cpp | 17 ++-- indra/newview/llnearbychatbar.h | 7 +- indra/newview/llnearbychathandler.cpp | 11 ++- indra/newview/llscreenchannel.cpp | 42 +++++++-- indra/newview/llscreenchannel.h | 7 +- indra/newview/llsidepaneltaskinfo.cpp | 159 +++++++++++++++++++++------------- indra/newview/llsidepaneltaskinfo.h | 40 ++++++++- indra/newview/llstatusbar.cpp | 5 +- indra/newview/llstatusbar.h | 3 +- 15 files changed, 272 insertions(+), 120 deletions(-) (limited to 'indra') diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 622f3e215c..466fac33ea 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -175,6 +175,7 @@ LLScrollListCtrl::LLScrollListCtrl(const LLScrollListCtrl::Params& p) mBorder(NULL), mSortCallback(NULL), mPopupMenu(NULL), + mCommentTextView(NULL), mNumDynamicWidthColumns(0), mTotalStaticColumnWidth(0), mTotalColumnPadding(0), @@ -476,7 +477,12 @@ void LLScrollListCtrl::updateLayout() getRect().getWidth() - 2 * mBorderThickness, getRect().getHeight() - (2 * mBorderThickness ) - heading_size ); - getChildView("comment_text")->setShape(mItemListRect); + if (mCommentTextView == NULL) + { + mCommentTextView = getChildView("comment_text"); + } + + mCommentTextView->setShape(mItemListRect); // how many lines of content in a single "page" S32 page_lines = getLinesPerPage(); diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index 09ab89960d..ae8aea9245 100644 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -480,6 +480,8 @@ private: S32 mHighlightedItem; class LLViewBorder* mBorder; LLContextMenu *mPopupMenu; + + LLView *mCommentTextView; LLWString mSearchString; LLFrameTimer mSearchTimer; diff --git a/indra/newview/lldebugview.cpp b/indra/newview/lldebugview.cpp index ba511a3693..92ac336d0d 100644 --- a/indra/newview/lldebugview.cpp +++ b/indra/newview/lldebugview.cpp @@ -55,9 +55,30 @@ LLDebugView* gDebugView = NULL; static LLDefaultChildRegistry::Register r("debug_view"); LLDebugView::LLDebugView(const LLDebugView::Params& p) -: LLView(p) +: LLView(p), + mFastTimerView(NULL), + mMemoryView(NULL), + mDebugConsolep(NULL), + mFloaterSnapRegion(NULL) {} +LLDebugView::~LLDebugView() +{ + // These have already been deleted. Fix the globals appropriately. + gDebugView = NULL; + gTextureView = NULL; + gSceneView = NULL; + gTextureSizeView = NULL; + gTextureCategoryView = NULL; +} + +BOOL LLDebugView::postBuild() +{ + mFloaterSnapRegion = getRootView()->getChildView("floater_snap_region"); + + return TRUE; +} + void LLDebugView::init() { LLRect r; @@ -109,8 +130,6 @@ void LLDebugView::init() addChild(gTextureView); //gTextureView->reshape(r.getWidth(), r.getHeight(), TRUE); - - if(gAuditTexture) { @@ -136,22 +155,10 @@ void LLDebugView::init() } } - -LLDebugView::~LLDebugView() -{ - // These have already been deleted. Fix the globals appropriately. - gDebugView = NULL; - gTextureView = NULL; - gSceneView = NULL; - gTextureSizeView = NULL; - gTextureCategoryView = NULL; -} - void LLDebugView::draw() { - LLView* floater_snap_region = getRootView()->getChildView("floater_snap_region"); LLRect debug_rect; - floater_snap_region->localRectToOtherView(floater_snap_region->getLocalRect(), &debug_rect, getParent()); + mFloaterSnapRegion->localRectToOtherView(mFloaterSnapRegion->getLocalRect(), &debug_rect, getParent()); setShape(debug_rect); LLView::draw(); diff --git a/indra/newview/lldebugview.h b/indra/newview/lldebugview.h index 907a42c981..33d6a7394f 100644 --- a/indra/newview/lldebugview.h +++ b/indra/newview/lldebugview.h @@ -51,17 +51,21 @@ public: changeDefault(mouse_opaque, false); } }; + LLDebugView(const Params&); ~LLDebugView(); + BOOL postBuild(); + void init(); void draw(); - + void setStatsVisible(BOOL visible); LLFastTimerView* mFastTimerView; LLMemoryView* mMemoryView; LLConsole* mDebugConsolep; + LLView* mFloaterSnapRegion; }; extern LLDebugView* gDebugView; diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index f410c31f44..02f1899e6e 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -55,6 +55,15 @@ LLFloaterWebContent::_Params::_Params() LLFloaterWebContent::LLFloaterWebContent( const Params& params ) : LLFloater( params ), LLInstanceTracker(params.id()), + mWebBrowser(NULL), + mAddressCombo(NULL), + mSecureLockIcon(NULL), + mStatusBarText(NULL), + mStatusBarProgress(NULL), + mBtnBack(NULL), + mBtnForward(NULL), + mBtnReload(NULL), + mBtnStop(NULL), mUUID(params.id()), mShowPageTitle(params.show_page_title) { @@ -74,11 +83,16 @@ BOOL LLFloaterWebContent::postBuild() mStatusBarText = getChild< LLTextBox >( "statusbartext" ); mStatusBarProgress = getChild("statusbarprogress" ); + mBtnBack = getChildView( "back" ); + mBtnForward = getChildView( "forward" ); + mBtnReload = getChildView( "reload" ); + mBtnStop = getChildView( "stop" ); + // observe browser events mWebBrowser->addObserver( this ); // these buttons are always enabled - getChildView("reload")->setEnabled( true ); + mBtnReload->setEnabled( true ); getChildView("popexternal")->setEnabled( true ); // cache image for secure browsing @@ -276,8 +290,8 @@ void LLFloaterWebContent::onClose(bool app_quitting) void LLFloaterWebContent::draw() { // this is asynchronous so we need to keep checking - getChildView( "back" )->setEnabled( mWebBrowser->canNavigateBack() ); - getChildView( "forward" )->setEnabled( mWebBrowser->canNavigateForward() ); + mBtnBack->setEnabled( mWebBrowser->canNavigateBack() ); + mBtnForward->setEnabled( mWebBrowser->canNavigateForward() ); LLFloater::draw(); } @@ -297,12 +311,12 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent else if(event == MEDIA_EVENT_NAVIGATE_BEGIN) { // flags are sent with this event - getChildView("back")->setEnabled( self->getHistoryBackAvailable() ); - getChildView("forward")->setEnabled( self->getHistoryForwardAvailable() ); + mBtnBack->setEnabled( self->getHistoryBackAvailable() ); + mBtnForward->setEnabled( self->getHistoryForwardAvailable() ); // toggle visibility of these buttons based on browser state - getChildView("reload")->setVisible( false ); - getChildView("stop")->setVisible( true ); + mBtnReload->setVisible( false ); + mBtnStop->setVisible( true ); // turn "on" progress bar now we're about to start loading mStatusBarProgress->setVisible( true ); @@ -310,12 +324,12 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent else if(event == MEDIA_EVENT_NAVIGATE_COMPLETE) { // flags are sent with this event - getChildView("back")->setEnabled( self->getHistoryBackAvailable() ); - getChildView("forward")->setEnabled( self->getHistoryForwardAvailable() ); + mBtnBack->setEnabled( self->getHistoryBackAvailable() ); + mBtnForward->setEnabled( self->getHistoryForwardAvailable() ); // toggle visibility of these buttons based on browser state - getChildView("reload")->setVisible( true ); - getChildView("stop")->setVisible( false ); + mBtnReload->setVisible( true ); + mBtnStop->setVisible( false ); // turn "off" progress bar now we're loaded mStatusBarProgress->setVisible( false ); @@ -421,8 +435,8 @@ void LLFloaterWebContent::onClickStop() // still should happen when we catch the navigate complete event // but sometimes (don't know why) that event isn't sent from Qt // and we ghetto a point where the stop button stays active. - getChildView("reload")->setVisible( true ); - getChildView("stop")->setVisible( false ); + mBtnReload->setVisible( true ); + mBtnStop->setVisible( false ); } void LLFloaterWebContent::onEnterAddress() diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h index 6fc66d1ad8..0340eedd93 100644 --- a/indra/newview/llfloaterwebcontent.h +++ b/indra/newview/llfloaterwebcontent.h @@ -97,6 +97,12 @@ protected: LLIconCtrl* mSecureLockIcon; LLTextBox* mStatusBarText; LLProgressBar* mStatusBarProgress; + + LLView* mBtnBack; + LLView* mBtnForward; + LLView* mBtnReload; + LLView* mBtnStop; + std::string mCurrentURL; std::string mUUID; bool mShowPageTitle; diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 4674c85324..701fdf43c7 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -70,9 +70,14 @@ static LLChatTypeTrigger sChatTypeTriggers[] = { }; LLNearbyChatBar::LLNearbyChatBar(const LLSD& key) - : LLFloater(key), - mChatBox(NULL) -{ mSpeakerMgr = LLLocalSpeakerMgr::getInstance(); +: LLFloater(key), + mChatBox(NULL), + mNearbyChat(NULL), + mOutputMonitor(NULL), + mSpeakerMgr(NULL), + mExpandedHeight(COLLAPSED_HEIGHT + EXPANDED_HEIGHT) +{ + mSpeakerMgr = LLLocalSpeakerMgr::getInstance(); } //virtual @@ -94,6 +99,7 @@ BOOL LLNearbyChatBar::postBuild() mChatBox->setEnableLineHistory(TRUE); mChatBox->setFont(LLViewerChat::getChatFont()); + mNearbyChat = getChildView("nearby_chat"); LLUICtrl* show_btn = getChild("show_nearby_chat"); show_btn->setCommitCallback(boost::bind(&LLNearbyChatBar::onToggleNearbyChatPanel, this)); @@ -104,8 +110,6 @@ BOOL LLNearbyChatBar::postBuild() // Register for font change notifications LLViewerChat::setFontChangedCallback(boost::bind(&LLNearbyChatBar::onChatFontChange, this, _1)); - mExpandedHeight = COLLAPSED_HEIGHT + EXPANDED_HEIGHT; - enableResizeCtrls(true, true, false); return TRUE; @@ -115,8 +119,7 @@ bool LLNearbyChatBar::applyRectControl() { bool rect_controlled = LLFloater::applyRectControl(); - LLView* nearby_chat = getChildView("nearby_chat"); - if (!nearby_chat->getVisible()) + if (!mNearbyChat->getVisible()) { reshape(getRect().getWidth(), getMinHeight()); enableResizeCtrls(true, true, false); diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h index e9734899b3..c2f57dc4ca 100644 --- a/indra/newview/llnearbychatbar.h +++ b/indra/newview/llnearbychatbar.h @@ -84,9 +84,10 @@ protected: // Which non-zero channel did we last chat on? static S32 sLastSpecialChatChannel; - LLLineEditor* mChatBox; - LLOutputMonitorCtrl* mOutputMonitor; - LLLocalSpeakerMgr* mSpeakerMgr; + LLLineEditor* mChatBox; + LLView* mNearbyChat; + LLOutputMonitorCtrl* mOutputMonitor; + LLLocalSpeakerMgr* mSpeakerMgr; S32 mExpandedHeight; }; diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index c43c95a366..7a17dbce3d 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -365,12 +365,15 @@ void LLNearbyChatScreenChannel::arrangeToasts() if(mStopProcessing || isHovering()) return; - LLView* floater_snap_region = gViewerWindow->getRootView()->getChildView("floater_snap_region"); - + if (mFloaterSnapRegion == NULL) + { + mFloaterSnapRegion = gViewerWindow->getRootView()->getChildView("floater_snap_region"); + } + if (!getParent()) { // connect to floater snap region just to get resize events, we don't care about being a proper widget - floater_snap_region->addChild(this); + mFloaterSnapRegion->addChild(this); setFollows(FOLLOWS_ALL); } @@ -378,7 +381,7 @@ void LLNearbyChatScreenChannel::arrangeToasts() updateRect(); LLRect channel_rect; - floater_snap_region->localRectToOtherView(floater_snap_region->getLocalRect(), &channel_rect, gFloaterView); + mFloaterSnapRegion->localRectToOtherView(mFloaterSnapRegion->getLocalRect(), &channel_rect, gFloaterView); channel_rect.mLeft += 10; channel_rect.mRight = channel_rect.mLeft + 300; diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 45cf81751b..33dbd3bdc3 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -53,13 +53,22 @@ LLFastTimer::DeclareTimer FTM_GET_CHANNEL_RECT("Calculate Notification Channel R LLRect LLScreenChannelBase::getChannelRect() { LLFastTimer _(FTM_GET_CHANNEL_RECT); + + if (mFloaterSnapRegion == NULL) + { + mFloaterSnapRegion = gViewerWindow->getRootView()->getChildView("floater_snap_region"); + } + + if (mChicletRegion == NULL) + { + mChicletRegion = gViewerWindow->getRootView()->getChildView("chiclet_container"); + } + LLRect channel_rect; LLRect chiclet_rect; - LLView* floater_snap_region = gViewerWindow->getRootView()->getChildView("floater_snap_region"); - floater_snap_region->localRectToScreen(floater_snap_region->getLocalRect(), &channel_rect); - LLView* chiclet_region = gViewerWindow->getRootView()->getChildView("chiclet_container"); - chiclet_region->localRectToScreen(chiclet_region->getLocalRect(), &chiclet_rect); + mFloaterSnapRegion->localRectToScreen(mFloaterSnapRegion->getLocalRect(), &channel_rect); + mChicletRegion->localRectToScreen(mChicletRegion->getLocalRect(), &chiclet_rect); channel_rect.mTop = chiclet_rect.mBottom; return channel_rect; @@ -81,14 +90,31 @@ LLScreenChannelBase::LLScreenChannelBase(const Params& p) mShowToasts(true), mID(p.id), mDisplayToastsAlways(p.display_toasts_always), - mChannelAlignment(p.channel_align) -{ + mChannelAlignment(p.channel_align), + mFloaterSnapRegion(NULL), + mChicletRegion(NULL) +{ mID = p.id; setMouseOpaque( false ); setVisible(FALSE); } +BOOL LLScreenChannelBase::postBuild() +{ + if (mFloaterSnapRegion == NULL) + { + mFloaterSnapRegion = gViewerWindow->getRootView()->getChildView("floater_snap_region"); + } + + if (mChicletRegion == NULL) + { + mChicletRegion = gViewerWindow->getRootView()->getChildView("chiclet_container"); + } + + return TRUE; +} + void LLScreenChannelBase::reshape(S32 width, S32 height, BOOL called_from_parent) { redrawToasts(); @@ -473,12 +499,10 @@ void LLScreenChannel::modifyToastByNotificationID(LLUUID id, LLPanel* panel) //-------------------------------------------------------------------------- void LLScreenChannel::redrawToasts() { - LLView* floater_snap_region = gViewerWindow->getRootView()->getChildView("floater_snap_region"); - if (!getParent()) { // connect to floater snap region just to get resize events, we don't care about being a proper widget - floater_snap_region->addChild(this); + mFloaterSnapRegion->addChild(this); setFollows(FOLLOWS_ALL); } diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h index 2f23552828..c9f8855fe6 100644 --- a/indra/newview/llscreenchannel.h +++ b/indra/newview/llscreenchannel.h @@ -69,6 +69,8 @@ public: }; LLScreenChannelBase(const Params&); + + BOOL postBuild(); void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); @@ -123,7 +125,7 @@ protected: // Channel's flags bool mControlHovering; - LLToast* mHoveredToast; + LLToast* mHoveredToast; bool mCanStoreToasts; bool mDisplayToastsAlways; // controls whether a channel shows toasts or not @@ -137,6 +139,9 @@ protected: // channel's ID LLUUID mID; + + LLView* mFloaterSnapRegion; + LLView* mChicletRegion; }; diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index 8774482acd..24cb559fd0 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -117,6 +117,42 @@ BOOL LLSidepanelTaskInfo::postBuild() childSetCommitCallback("checkbox next owner can transfer", &LLSidepanelTaskInfo::onCommitNextOwnerTransfer,this); childSetCommitCallback("clickaction", &LLSidepanelTaskInfo::onCommitClickAction,this); childSetCommitCallback("search_check", &LLSidepanelTaskInfo::onCommitIncludeInSearch,this); + + mDAPermModify = getChild("perm_modify"); + mDACreator = getChildView("Creator:"); + mDACreatorName = getChild("Creator Name"); + mDAOwner = getChildView("Owner:"); + mDAOwnerName = getChild("Owner Name"); + mDAGroup = getChildView("Group:"); + mDAGroupName = getChild("Group Name"); + mDAButtonSetGroup = getChildView("button set group"); + mDAObjectName = getChild("Object Name"); + mDAName = getChildView("Name:"); + mDADescription = getChildView("Description:"); + mDAObjectDescription = getChild("Object Description"); + mDAPermissions = getChildView("Permissions:"); + mDACheckboxShareWithGroup = getChild("checkbox share with group"); + mDAButtonDeed = getChildView("button deed"); + mDACheckboxAllowEveryoneMove = getChild("checkbox allow everyone move"); + mDACheckboxAllowEveryoneCopy = getChild("checkbox allow everyone copy"); + mDANextOwnerCan = getChildView("Next owner can:"); + mDACheckboxNextOwnerCanModify = getChild("checkbox next owner can modify"); + mDACheckboxNextOwnerCanCopy = getChild("checkbox next owner can copy"); + mDACheckboxNextOwnerCanTransfer = getChild("checkbox next owner can transfer"); + mDACheckboxForSale = getChild("checkbox for sale"); + mDASearchCheck = getChild("search_check"); + mDAComboSaleType = getChild("sale type"); + mDACost = getChild("Cost"); + mDAEditCost = getChild("Edit Cost"); + mDALabelClickAction = getChildView("label click action"); + mDAComboClickAction = getChild("clickaction"); + mDAB = getChildView("B:"); + mDAO = getChildView("O:"); + mDAG = getChildView("G:"); + mDAE = getChildView("E:"); + mDAN = getChildView("N:"); + mDAF = getChildView("F:"); + return TRUE; } @@ -138,81 +174,80 @@ BOOL LLSidepanelTaskInfo::postBuild() void LLSidepanelTaskInfo::disableAll() { - getChildView("perm_modify")->setEnabled(FALSE); - getChild("perm_modify")->setValue(LLStringUtil::null); - - getChildView("Creator:")->setEnabled(FALSE); - getChild("Creator Name")->setValue(LLStringUtil::null); - getChildView("Creator Name")->setEnabled(FALSE); - - getChildView("Owner:")->setEnabled(FALSE); - getChild("Owner Name")->setValue(LLStringUtil::null); - getChildView("Owner Name")->setEnabled(FALSE); - - getChildView("Group:")->setEnabled(FALSE); - getChild("Group Name")->setValue(LLStringUtil::null); - getChildView("Group Name")->setEnabled(FALSE); - getChildView("button set group")->setEnabled(FALSE); - - getChild("Object Name")->setValue(LLStringUtil::null); - getChildView("Object Name")->setEnabled(FALSE); - getChildView("Name:")->setEnabled(FALSE); - getChild("Group Name")->setValue(LLStringUtil::null); - getChildView("Group Name")->setEnabled(FALSE); - getChildView("Description:")->setEnabled(FALSE); - getChild("Object Description")->setValue(LLStringUtil::null); - getChildView("Object Description")->setEnabled(FALSE); - - getChildView("Permissions:")->setEnabled(FALSE); + mDAPermModify->setEnabled(FALSE); + mDAPermModify->setValue(LLStringUtil::null); + + mDACreator->setEnabled(FALSE); + mDACreatorName->setValue(LLStringUtil::null); + mDACreatorName->setEnabled(FALSE); + + mDAOwner->setEnabled(FALSE); + mDAOwnerName->setValue(LLStringUtil::null); + mDAOwnerName->setEnabled(FALSE); + + mDAGroup->setEnabled(FALSE); + mDAGroupName->setValue(LLStringUtil::null); + mDAGroupName->setEnabled(FALSE); + mDAButtonSetGroup->setEnabled(FALSE); + + mDAObjectName->setValue(LLStringUtil::null); + mDAObjectName->setEnabled(FALSE); + mDAName->setEnabled(FALSE); + mDAGroupName->setValue(LLStringUtil::null); + mDAGroupName->setEnabled(FALSE); + mDADescription->setEnabled(FALSE); + mDAObjectDescription->setValue(LLStringUtil::null); + mDAObjectDescription->setEnabled(FALSE); + + mDAPermissions->setEnabled(FALSE); - getChild("checkbox share with group")->setValue(FALSE); - getChildView("checkbox share with group")->setEnabled(FALSE); - getChildView("button deed")->setEnabled(FALSE); + mDACheckboxShareWithGroup->setValue(FALSE); + mDACheckboxShareWithGroup->setEnabled(FALSE); + mDAButtonDeed->setEnabled(FALSE); - getChild("checkbox allow everyone move")->setValue(FALSE); - getChildView("checkbox allow everyone move")->setEnabled(FALSE); - getChild("checkbox allow everyone copy")->setValue(FALSE); - getChildView("checkbox allow everyone copy")->setEnabled(FALSE); + mDACheckboxAllowEveryoneMove->setValue(FALSE); + mDACheckboxAllowEveryoneMove->setEnabled(FALSE); + mDACheckboxAllowEveryoneCopy->setValue(FALSE); + mDACheckboxAllowEveryoneCopy->setEnabled(FALSE); //Next owner can: - getChildView("Next owner can:")->setEnabled(FALSE); - getChild("checkbox next owner can modify")->setValue(FALSE); - getChildView("checkbox next owner can modify")->setEnabled(FALSE); - getChild("checkbox next owner can copy")->setValue(FALSE); - getChildView("checkbox next owner can copy")->setEnabled(FALSE); - getChild("checkbox next owner can transfer")->setValue(FALSE); - getChildView("checkbox next owner can transfer")->setEnabled(FALSE); + mDANextOwnerCan->setEnabled(FALSE); + mDACheckboxNextOwnerCanModify->setValue(FALSE); + mDACheckboxNextOwnerCanModify->setEnabled(FALSE); + mDACheckboxNextOwnerCanCopy->setValue(FALSE); + mDACheckboxNextOwnerCanCopy->setEnabled(FALSE); + mDACheckboxNextOwnerCanTransfer->setValue(FALSE); + mDACheckboxNextOwnerCanTransfer->setEnabled(FALSE); //checkbox for sale - getChild("checkbox for sale")->setValue(FALSE); - getChildView("checkbox for sale")->setEnabled(FALSE); + mDACheckboxForSale->setValue(FALSE); + mDACheckboxForSale->setEnabled(FALSE); //checkbox include in search - getChild("search_check")->setValue(FALSE); - getChildView("search_check")->setEnabled(FALSE); + mDASearchCheck->setValue(FALSE); + mDASearchCheck->setEnabled(FALSE); - LLComboBox* combo_sale_type = getChild("sale type"); - combo_sale_type->setValue(LLSaleInfo::FS_COPY); - combo_sale_type->setEnabled(FALSE); + mDAComboSaleType->setValue(LLSaleInfo::FS_COPY); + mDAComboSaleType->setEnabled(FALSE); - getChildView("Cost")->setEnabled(FALSE); - getChild("Cost")->setValue(getString("Cost Default")); - getChild("Edit Cost")->setValue(LLStringUtil::null); - getChildView("Edit Cost")->setEnabled(FALSE); + mDACost->setEnabled(FALSE); + mDACost->setValue(getString("Cost Default")); + mDAEditCost->setValue(LLStringUtil::null); + mDAEditCost->setEnabled(FALSE); - getChildView("label click action")->setEnabled(FALSE); - LLComboBox* combo_click_action = getChild("clickaction"); - if (combo_click_action) + mDALabelClickAction->setEnabled(FALSE); + if (mDAComboClickAction) { - combo_click_action->setEnabled(FALSE); - combo_click_action->clear(); + mDAComboClickAction->setEnabled(FALSE); + mDAComboClickAction->clear(); } - getChildView("B:")->setVisible( FALSE); - getChildView("O:")->setVisible( FALSE); - getChildView("G:")->setVisible( FALSE); - getChildView("E:")->setVisible( FALSE); - getChildView("N:")->setVisible( FALSE); - getChildView("F:")->setVisible( FALSE); + + mDAB->setVisible(FALSE); + mDAO->setVisible(FALSE); + mDAG->setVisible(FALSE); + mDAE->setVisible(FALSE); + mDAN->setVisible(FALSE); + mDAF->setVisible(FALSE); mOpenBtn->setEnabled(FALSE); mPayBtn->setEnabled(FALSE); diff --git a/indra/newview/llsidepaneltaskinfo.h b/indra/newview/llsidepaneltaskinfo.h index 384bc479d6..be0fee2127 100644 --- a/indra/newview/llsidepaneltaskinfo.h +++ b/indra/newview/llsidepaneltaskinfo.h @@ -37,8 +37,9 @@ // Panel for permissions of an object. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLNameBox; class LLCheckBoxCtrl; +class LLComboBox; +class LLNameBox; class LLViewerObject; class LLSidepanelTaskInfo : public LLSidepanelInventorySubpanel @@ -118,6 +119,43 @@ private: LLPointer mObject; LLObjectSelectionHandle mObjectSelection; static LLSidepanelTaskInfo* sActivePanel; + +private: + // Pointers cached here to speed up the "disableAll" function which gets called on idle + LLUICtrl* mDAPermModify; + LLView* mDACreator; + LLUICtrl* mDACreatorName; + LLView* mDAOwner; + LLUICtrl* mDAOwnerName; + LLView* mDAGroup; + LLUICtrl* mDAGroupName; + LLView* mDAButtonSetGroup; + LLUICtrl* mDAObjectName; + LLView* mDAName; + LLView* mDADescription; + LLUICtrl* mDAObjectDescription; + LLView* mDAPermissions; + LLUICtrl* mDACheckboxShareWithGroup; + LLView* mDAButtonDeed; + LLUICtrl* mDACheckboxAllowEveryoneMove; + LLUICtrl* mDACheckboxAllowEveryoneCopy; + LLView* mDANextOwnerCan; + LLUICtrl* mDACheckboxNextOwnerCanModify; + LLUICtrl* mDACheckboxNextOwnerCanCopy; + LLUICtrl* mDACheckboxNextOwnerCanTransfer; + LLUICtrl* mDACheckboxForSale; + LLUICtrl* mDASearchCheck; + LLComboBox* mDAComboSaleType; + LLUICtrl* mDACost; + LLUICtrl* mDAEditCost; + LLView* mDALabelClickAction; + LLComboBox* mDAComboClickAction; + LLView* mDAB; + LLView* mDAO; + LLView* mDAG; + LLView* mDAE; + LLView* mDAN; + LLView* mDAF; }; diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 75db269bde..89240c982f 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -114,6 +114,7 @@ LLStatusBar::LLStatusBar(const LLRect& rect) mTextTime(NULL), mSGBandwidth(NULL), mSGPacketLoss(NULL), + mBtnStats(NULL), mBtnVolume(NULL), mBoxBalance(NULL), mBalance(0), @@ -173,6 +174,8 @@ BOOL LLStatusBar::postBuild() mBoxBalance = getChild("balance"); mBoxBalance->setClickedCallback( &LLStatusBar::onClickBalance, this ); + + mBtnStats = getChildView("stat_btn"); mBtnVolume = getChild( "volume_btn" ); mBtnVolume->setClickedCallback( onClickVolume, this ); @@ -288,7 +291,7 @@ void LLStatusBar::refresh() mSGBandwidth->setVisible(net_stats_visible); mSGPacketLoss->setVisible(net_stats_visible); - getChildView("stat_btn")->setEnabled(net_stats_visible); + mBtnStats->setEnabled(net_stats_visible); // update the master volume button state bool mute_audio = LLAppViewer::instance()->getMasterSystemAudioMute(); diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index 4ea3183d18..9d28e6c2bc 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -102,10 +102,11 @@ private: LLStatGraph *mSGBandwidth; LLStatGraph *mSGPacketLoss; + LLView *mBtnStats; LLButton *mBtnVolume; LLTextBox *mBoxBalance; LLButton *mMediaToggle; - LLView* mScriptOut; + LLView *mScriptOut; LLFrameTimer mClockUpdateTimer; S32 mBalance; -- cgit v1.2.3 From 619cda179d28a9d62732a952d349dff76fd57180 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 23 Nov 2011 13:18:41 -0800 Subject: SH-2711 FIX -- Removed the "RenderAnimateTrees" setting and associated code. --- indra/newview/app_settings/settings.xml | 12 --- indra/newview/lldrawpooltree.cpp | 154 +++----------------------------- indra/newview/lldrawpooltree.h | 3 - indra/newview/llviewercontrol.cpp | 1 - indra/newview/llvotree.cpp | 96 ++++++-------------- indra/newview/llvotree.h | 1 - 6 files changed, 36 insertions(+), 231 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index aa08b0783e..b41c7f0e78 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7869,18 +7869,6 @@ 0 - RenderAnimateTrees - - Comment - Use GL matrix ops to animate tree branches. - Persist - 1 - Type - Boolean - Value - 0 - - RenderMinimumLODTriangleCount Comment diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp index d198e28c14..3165a3516c 100644 --- a/indra/newview/lldrawpooltree.cpp +++ b/indra/newview/lldrawpooltree.cpp @@ -97,25 +97,18 @@ void LLDrawPoolTree::render(S32 pass) LLGLState test(GL_ALPHA_TEST, LLGLSLShader::sNoFixedFunction ? 0 : 1); LLOverrideFaceColor color(this, 1.f, 1.f, 1.f, 1.f); - if (gSavedSettings.getBOOL("RenderAnimateTrees")) - { - renderTree(); - } - else + gGL.getTexUnit(sDiffTex)->bind(mTexturep); + + for (std::vector::iterator iter = mDrawFace.begin(); + iter != mDrawFace.end(); iter++) { - gGL.getTexUnit(sDiffTex)->bind(mTexturep); - - for (std::vector::iterator iter = mDrawFace.begin(); - iter != mDrawFace.end(); iter++) + LLFace *face = *iter; + LLVertexBuffer* buff = face->getVertexBuffer(); + if(buff) { - LLFace *face = *iter; - LLVertexBuffer* buff = face->getVertexBuffer(); - if(buff) - { - buff->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK); - buff->drawRange(LLRender::TRIANGLES, 0, buff->getNumVerts()-1, buff->getNumIndices(), 0); - gPipeline.addTrianglesDrawn(buff->getNumIndices()); - } + buff->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK); + buff->drawRange(LLRender::TRIANGLES, 0, buff->getNumVerts()-1, buff->getNumIndices(), 0); + gPipeline.addTrianglesDrawn(buff->getNumIndices()); } } } @@ -187,133 +180,6 @@ void LLDrawPoolTree::endShadowPass(S32 pass) gDeferredTreeShadowProgram.unbind(); } - -void LLDrawPoolTree::renderTree(BOOL selecting) -{ - LLGLState normalize(GL_NORMALIZE, TRUE); - - // Bind the texture for this tree. - gGL.getTexUnit(sDiffTex)->bind(mTexturep.get(), TRUE); - - U32 indices_drawn = 0; - - gGL.matrixMode(LLRender::MM_MODELVIEW); - - for (std::vector::iterator iter = mDrawFace.begin(); - iter != mDrawFace.end(); iter++) - { - LLFace *face = *iter; - LLDrawable *drawablep = face->getDrawable(); - - if (drawablep->isDead() || !face->getVertexBuffer()) - { - continue; - } - - face->getVertexBuffer()->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK); - U16* indicesp = (U16*) face->getVertexBuffer()->getIndicesPointer(); - - // Render each of the trees - LLVOTree *treep = (LLVOTree *)drawablep->getVObj().get(); - - LLColor4U color(255,255,255,255); - - if (!selecting || treep->mGLName != 0) - { - if (selecting) - { - S32 name = treep->mGLName; - - color = LLColor4U((U8)(name >> 16), (U8)(name >> 8), (U8)name, 255); - } - - gGLLastMatrix = NULL; - gGL.loadMatrix(gGLModelView); - //gGL.pushMatrix(); - F32 mat[16]; - for (U32 i = 0; i < 16; i++) - mat[i] = (F32) gGLModelView[i]; - - LLMatrix4 matrix(mat); - - // Translate to tree base HACK - adjustment in Z plants tree underground - const LLVector3 &pos_agent = treep->getPositionAgent(); - //gGL.translatef(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ] - 0.1f); - LLMatrix4 trans_mat; - trans_mat.setTranslation(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ] - 0.1f); - trans_mat *= matrix; - - // Rotate to tree position and bend for current trunk/wind - // Note that trunk stiffness controls the amount of bend at the trunk as - // opposed to the crown of the tree - // - const F32 TRUNK_STIFF = 22.f; - - LLQuaternion rot = - LLQuaternion(treep->mTrunkBend.magVec()*TRUNK_STIFF*DEG_TO_RAD, LLVector4(treep->mTrunkBend.mV[VX], treep->mTrunkBend.mV[VY], 0)) * - LLQuaternion(90.f*DEG_TO_RAD, LLVector4(0,0,1)) * - treep->getRotation(); - - LLMatrix4 rot_mat(rot); - rot_mat *= trans_mat; - - F32 radius = treep->getScale().magVec()*0.05f; - LLMatrix4 scale_mat; - scale_mat.mMatrix[0][0] = - scale_mat.mMatrix[1][1] = - scale_mat.mMatrix[2][2] = radius; - - scale_mat *= rot_mat; - - const F32 THRESH_ANGLE_FOR_BILLBOARD = 15.f; - const F32 BLEND_RANGE_FOR_BILLBOARD = 3.f; - - F32 droop = treep->mDroop + 25.f*(1.f - treep->mTrunkBend.magVec()); - - S32 stop_depth = 0; - F32 app_angle = treep->getAppAngle()*LLVOTree::sTreeFactor; - F32 alpha = 1.0; - S32 trunk_LOD = LLVOTree::sMAX_NUM_TREE_LOD_LEVELS; - - for (S32 j = 0; j < 4; j++) - { - - if (app_angle > LLVOTree::sLODAngles[j]) - { - trunk_LOD = j; - break; - } - } - if(trunk_LOD >= LLVOTree::sMAX_NUM_TREE_LOD_LEVELS) - { - continue ; //do not render. - } - - if (app_angle < (THRESH_ANGLE_FOR_BILLBOARD - BLEND_RANGE_FOR_BILLBOARD)) - { - // - // Draw only the billboard - // - // Only the billboard, can use closer to normal alpha func. - stop_depth = -1; - LLFacePool::LLOverrideFaceColor clr(this, color); - indices_drawn += treep->drawBranchPipeline(scale_mat, indicesp, trunk_LOD, stop_depth, treep->mDepth, treep->mTrunkDepth, 1.0, treep->mTwist, droop, treep->mBranches, alpha); - } - else // if (app_angle > (THRESH_ANGLE_FOR_BILLBOARD + BLEND_RANGE_FOR_BILLBOARD)) - { - // - // Draw only the full geometry tree - // - //stop_depth = (app_angle < THRESH_ANGLE_FOR_RECURSION_REDUCTION); - LLFacePool::LLOverrideFaceColor clr(this, color); - indices_drawn += treep->drawBranchPipeline(scale_mat, indicesp, trunk_LOD, stop_depth, treep->mDepth, treep->mTrunkDepth, 1.0, treep->mTwist, droop, treep->mBranches, alpha); - } - - //gGL.popMatrix(); - } - } -} - BOOL LLDrawPoolTree::verify() const { /* BOOL ok = TRUE; diff --git a/indra/newview/lldrawpooltree.h b/indra/newview/lldrawpooltree.h index ddb259bb82..e7e25453cf 100644 --- a/indra/newview/lldrawpooltree.h +++ b/indra/newview/lldrawpooltree.h @@ -68,9 +68,6 @@ public: /*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display static S32 sDiffTex; - -private: - void renderTree(BOOL selecting = FALSE); }; #endif // LL_LLDRAWPOOLTREE_H diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 73e4d11d7b..093b84413a 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -564,7 +564,6 @@ void settings_setup_listeners() gSavedSettings.getControl("OctreeAttachmentSizeFactor")->getSignal()->connect(boost::bind(&handleRepartition, _2)); gSavedSettings.getControl("RenderMaxTextureIndex")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderUseTriStrips")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); - gSavedSettings.getControl("RenderAnimateTrees")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderAvatarVP")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("VertexShaderEnable")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderUIBuffer")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp index 6486fd24ea..4564207da4 100644 --- a/indra/newview/llvotree.cpp +++ b/indra/newview/llvotree.cpp @@ -341,45 +341,11 @@ U32 LLVOTree::processUpdateMessage(LLMessageSystem *mesgsys, BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) { - const U16 FRAMES_PER_WIND_UPDATE = 20; // How many frames between wind update per tree - const F32 TREE_WIND_SENSITIVITY = 0.005f; - const F32 TREE_TRUNK_STIFFNESS = 0.1f; - if (mDead || !(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_TREE))) { return TRUE; } - if (gSavedSettings.getBOOL("RenderAnimateTrees")) - { - F32 mass_inv; - - // For all tree objects, update the trunk bending with the current wind - // Walk sprite list in order away from viewer - if (!(mFrameCount % FRAMES_PER_WIND_UPDATE)) - { - // If needed, Get latest wind for this tree - mWind = mRegionp->mWind.getVelocity(getPositionRegion()); - } - mFrameCount++; - - mass_inv = 1.f/(5.f + mDepth*mBranches*0.2f); - mTrunkVel += (mWind * mass_inv * TREE_WIND_SENSITIVITY); // Pull in direction of wind - mTrunkVel -= (mTrunkBend * mass_inv * TREE_TRUNK_STIFFNESS); // Restoring force in direction of trunk - mTrunkBend += mTrunkVel; - mTrunkVel *= 0.99f; // Add damping - - if (mTrunkBend.length() > 1.f) - { - mTrunkBend.normalize(); - } - - if (mTrunkVel.length() > 1.f) - { - mTrunkVel.normalize(); - } - } - S32 trunk_LOD = sMAX_NUM_TREE_LOD_LEVELS ; F32 app_angle = getAppAngle()*LLVOTree::sTreeFactor; @@ -392,39 +358,36 @@ BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) } } - if (!gSavedSettings.getBOOL("RenderAnimateTrees")) + if (mReferenceBuffer.isNull()) { - if (mReferenceBuffer.isNull()) - { - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE); - } - else if (trunk_LOD != mTrunkLOD) + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE); + } + else if (trunk_LOD != mTrunkLOD) + { + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, FALSE); + } + else + { + // we're not animating but we may *still* need to + // regenerate the mesh if we moved, since position + // and rotation are baked into the mesh. + // *TODO: I don't know what's so special about trees + // that they don't get REBUILD_POSITION automatically + // at a higher level. + const LLVector3 &this_position = getPositionAgent(); + if (this_position != mLastPosition) { - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, FALSE); + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_POSITION); + mLastPosition = this_position; } else { - // we're not animating but we may *still* need to - // regenerate the mesh if we moved, since position - // and rotation are baked into the mesh. - // *TODO: I don't know what's so special about trees - // that they don't get REBUILD_POSITION automatically - // at a higher level. - const LLVector3 &this_position = getPositionAgent(); - if (this_position != mLastPosition) + const LLQuaternion &this_rotation = getRotation(); + + if (this_rotation != mLastRotation) { gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_POSITION); - mLastPosition = this_position; - } - else - { - const LLQuaternion &this_rotation = getRotation(); - - if (this_rotation != mLastRotation) - { - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_POSITION); - mLastRotation = this_rotation; - } + mLastRotation = this_rotation; } } } @@ -559,7 +522,7 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable) max_vertices += sLODVertexCount[lod]; } - mReferenceBuffer = new LLVertexBuffer(LLDrawPoolTree::VERTEX_DATA_MASK, gSavedSettings.getBOOL("RenderAnimateTrees") ? GL_STATIC_DRAW_ARB : 0); + mReferenceBuffer = new LLVertexBuffer(LLDrawPoolTree::VERTEX_DATA_MASK, 0); mReferenceBuffer->allocateBuffer(max_vertices, max_indices, TRUE); LLStrider vertices; @@ -863,15 +826,8 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable) llassert(index_count == max_indices); } - if (gSavedSettings.getBOOL("RenderAnimateTrees")) - { - mDrawable->getFace(0)->setVertexBuffer(mReferenceBuffer); - } - else - { - //generate tree mesh - updateMesh(); - } + //generate tree mesh + updateMesh(); return TRUE; } diff --git a/indra/newview/llvotree.h b/indra/newview/llvotree.h index 1e1deede26..0554935539 100644 --- a/indra/newview/llvotree.h +++ b/indra/newview/llvotree.h @@ -152,7 +152,6 @@ public: friend class LLDrawPoolTree; protected: LLVector3 mTrunkBend; // Accumulated wind (used for blowing trees) - LLVector3 mTrunkVel; // LLVector3 mWind; LLPointer mReferenceBuffer; //reference geometry for generating tree mesh -- cgit v1.2.3 From e09f8e651a87e92a64c49bf0107dc7fee80bc5ef Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 23 Nov 2011 13:44:56 -0800 Subject: SH-2712 FIX -- added caching to isFullyLoaded --- indra/newview/llvoavatar.cpp | 8 +++----- indra/newview/llvoavatar.h | 3 +++ 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index a3550000df..d69d1a7962 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -690,7 +690,8 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mFullyLoadedInitialized(FALSE), mSupportsAlphaLayers(FALSE), mLoadedCallbacksPaused(FALSE), - mHasPelvisOffset( FALSE ) + mHasPelvisOffset( FALSE ), + mRenderUnloadedAvatar(LLCachedControl(gSavedSettings, "RenderUnloadedAvatar")) { LLMemType mt(LLMemType::MTYPE_AVATAR); //VTResume(); // VTune @@ -6493,10 +6494,7 @@ BOOL LLVOAvatar::processFullyLoadedChange(bool loading) BOOL LLVOAvatar::isFullyLoaded() const { - if (gSavedSettings.getBOOL("RenderUnloadedAvatar")) - return TRUE; - else - return mFullyLoaded; + return (mRenderUnloadedAvatar || mFullyLoaded); } bool LLVOAvatar::isTooComplex() const diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index e53b8e3f4b..59796370ae 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -40,6 +40,7 @@ #include "lldrawpoolalpha.h" #include "llviewerobject.h" #include "llcharacter.h" +#include "llcontrol.h" #include "llviewerjointmesh.h" #include "llviewerjointattachment.h" #include "llrendertarget.h" @@ -450,6 +451,8 @@ private: F32 mImpostorDistance; F32 mImpostorPixelArea; LLVector3 mLastAnimExtents[2]; + + LLCachedControl mRenderUnloadedAvatar; //-------------------------------------------------------------------- // Wind rippling in clothes -- cgit v1.2.3 From 2878b6d1da2820efb2ab50ff77a9f31f25ed5f6b Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 23 Nov 2011 14:30:30 -0800 Subject: SH-2713 FIX -- modified code to call LLPipeline::refreshCachedSettings only when settings that could affect it are modified. Reviewed by davep. --- indra/newview/llviewerdisplay.cpp | 4 -- indra/newview/pipeline.cpp | 95 ++++++++++++++++++++++++++++++++++++--- indra/newview/pipeline.h | 1 - 3 files changed, 88 insertions(+), 12 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 3f0b5bf3fb..cb40af7061 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -230,7 +230,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) glClear(GL_COLOR_BUFFER_BIT); gViewerWindow->getWindow()->swapBuffers(); LLPipeline::refreshCachedSettings(); - LLPipeline::refreshRenderDeferred(); gPipeline.resizeScreenTexture(); gResizeScreenTexture = FALSE; gWindowResized = FALSE; @@ -617,9 +616,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) //Increment drawable frame counter LLDrawable::incrementVisible(); - LLPipeline::refreshCachedSettings(); - LLPipeline::refreshRenderDeferred(); - LLSpatialGroup::sNoDelete = TRUE; LLTexUnit::sWhiteTexture = LLViewerFetchedTexture::sWhiteImagep->getTexName(); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index f3d5f94813..12bec90881 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -509,6 +509,92 @@ void LLPipeline::init() mDeferredVB = new LLVertexBuffer(DEFERRED_VB_MASK, 0); mDeferredVB->allocateBuffer(8, 0, true); setLightingDetail(-1); + + // + // Update all settings to trigger a cached settings refresh + // + + gSavedSettings.getControl("RenderAutoMaskAlphaDeferred")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderAutoMaskAlphaNonDeferred")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderUseFarClip")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderAvatarMaxVisible")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderDelayVBUpdate")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + + gSavedSettings.getControl("UseOcclusion")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + + gSavedSettings.getControl("VertexShaderEnable")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderAvatarVP")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("WindLightUseAtmosShaders")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderDeferred")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderDeferredSunWash")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderFSAASamples")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderResolutionDivisor")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderUIBuffer")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowDetail")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderDeferredSSAO")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowResolutionScale")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderLocalLights")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderDelayCreation")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderAnimateRes")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("FreezeTime")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("DebugBeaconLineWidth")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderHighlightBrightness")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderHighlightColor")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderHighlightThickness")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderSpotLightsInNondeferred")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("PreviewAmbientColor")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("PreviewDiffuse0")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("PreviewSpecular0")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("PreviewDiffuse1")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("PreviewSpecular1")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("PreviewDiffuse2")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("PreviewSpecular2")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("PreviewDirection0")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("PreviewDirection1")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("PreviewDirection2")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderGlowMinLuminance")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderGlowMaxExtractAlpha")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderGlowWarmthAmount")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderGlowLumWeights")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderGlowWarmthWeights")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderGlowResolutionPow")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderGlowIterations")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderGlowWidth")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderGlowStrength")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderDepthOfField")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("CameraFocusTransitionTime")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("CameraFNumber")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("CameraFocalLength")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("CameraFieldOfView")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowNoise")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowBlurSize")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderSSAOScale")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderSSAOMaxScale")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderSSAOFactor")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderSSAOEffect")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowOffsetError")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowBiasError")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowOffset")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowBias")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderSpotShadowOffset")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderSpotShadowBias")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderEdgeDepthCutoff")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderEdgeNormCutoff")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowGaussian")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowBlurDistFactor")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderDeferredAtmospheric")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderReflectionDetail")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderHighlightFadeTime")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowClipPlanes")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowOrthoClipPlanes")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowNearDist")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderFarClip")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowSplitExponent")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowErrorCutoff")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowFOVCutoff")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("CameraOffset")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("CameraMaxCoF")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("CameraDoFResScale")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); } LLPipeline::~LLPipeline() @@ -707,7 +793,6 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) { refreshCachedSettings(); - refreshRenderDeferred(); // remember these dimensions mScreenWidth = resX; @@ -839,12 +924,6 @@ void LLPipeline::updateRenderDeferred() } } -//static -void LLPipeline::refreshRenderDeferred() -{ - updateRenderDeferred(); -} - //static void LLPipeline::refreshCachedSettings() { @@ -933,6 +1012,8 @@ void LLPipeline::refreshCachedSettings() CameraOffset = gSavedSettings.getBOOL("CameraOffset"); CameraMaxCoF = gSavedSettings.getF32("CameraMaxCoF"); CameraDoFResScale = gSavedSettings.getF32("CameraDoFResScale"); + + updateRenderDeferred(); } void LLPipeline::releaseGLBuffers() diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index c6b2e20fa5..2815d736e4 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -359,7 +359,6 @@ public: static BOOL getRenderHighlights(void* data); static void updateRenderDeferred(); - static void refreshRenderDeferred(); static void refreshCachedSettings(); static void throttleNewMemoryAllocation(BOOL disable); -- cgit v1.2.3 From 2851cd519338ef4a1fde15da8d4015ab4380d6cb Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Mon, 28 Nov 2011 11:33:49 -0700 Subject: a try fix for sh-2651: [crashhunters] Crash after google translate failure and sh-2658: crash in LLPluginMessage::parse --- indra/llprimitive/llvolumexml.cpp | 19 +++++++++++-------- indra/llprimitive/llvolumexml.h | 6 +++--- indra/llui/llui.cpp | 7 +++++-- indra/llxml/llxmlnode.cpp | 8 ++++---- indra/llxuixml/llxuiparser.cpp | 1 + indra/newview/llvoicevivox.cpp | 1 - 6 files changed, 24 insertions(+), 18 deletions(-) (limited to 'indra') diff --git a/indra/llprimitive/llvolumexml.cpp b/indra/llprimitive/llvolumexml.cpp index f4f9d4d713..bf2297a029 100644 --- a/indra/llprimitive/llvolumexml.cpp +++ b/indra/llprimitive/llvolumexml.cpp @@ -34,9 +34,9 @@ //============================================================================ -LLXMLNode *LLVolumeXml::exportProfileParams(const LLProfileParams* params) +LLPointer LLVolumeXml::exportProfileParams(const LLProfileParams* params) { - LLXMLNode *ret = new LLXMLNode("profile", FALSE); + LLPointer ret = new LLXMLNode("profile", FALSE); ret->createChild("curve_type", TRUE)->setByteValue(1, ¶ms->getCurveType()); ret->createChild("interval", FALSE)->setFloatValue(2, ¶ms->getBegin()); @@ -46,9 +46,9 @@ LLXMLNode *LLVolumeXml::exportProfileParams(const LLProfileParams* params) } -LLXMLNode *LLVolumeXml::exportPathParams(const LLPathParams* params) +LLPointer LLVolumeXml::exportPathParams(const LLPathParams* params) { - LLXMLNode *ret = new LLXMLNode("path", FALSE); + LLPointer ret = new LLXMLNode("path", FALSE); ret->createChild("curve_type", TRUE)->setByteValue(1, ¶ms->getCurveType()); ret->createChild("interval", FALSE)->setFloatValue(2, ¶ms->getBegin()); ret->createChild("scale", FALSE)->setFloatValue(2, params->getScale().mV); @@ -63,12 +63,15 @@ LLXMLNode *LLVolumeXml::exportPathParams(const LLPathParams* params) } -LLXMLNode *LLVolumeXml::exportVolumeParams(const LLVolumeParams* params) +LLPointer LLVolumeXml::exportVolumeParams(const LLVolumeParams* params) { - LLXMLNode *ret = new LLXMLNode("shape", FALSE); + LLPointer ret = new LLXMLNode("shape", FALSE); - exportPathParams(¶ms->getPathParams())->setParent(ret); - exportProfileParams(¶ms->getProfileParams())->setParent(ret); + LLPointer node ; + node = exportPathParams(¶ms->getPathParams()) ; + node->setParent(ret); + node = exportProfileParams(¶ms->getProfileParams()) ; + node->setParent(ret); return ret; } diff --git a/indra/llprimitive/llvolumexml.h b/indra/llprimitive/llvolumexml.h index 5e79205d9a..9d4d989475 100644 --- a/indra/llprimitive/llvolumexml.h +++ b/indra/llprimitive/llvolumexml.h @@ -34,11 +34,11 @@ class LLVolumeXml { public: - static LLXMLNode* exportProfileParams(const LLProfileParams* params); + static LLPointer exportProfileParams(const LLProfileParams* params); - static LLXMLNode* exportPathParams(const LLPathParams* params); + static LLPointer exportPathParams(const LLPathParams* params); - static LLXMLNode* exportVolumeParams(const LLVolumeParams* params); + static LLPointer exportVolumeParams(const LLVolumeParams* params); }; #endif // LL_LLVOLUMEXML_H diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 79ad99a770..69461ec099 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -1823,9 +1823,12 @@ void LLUI::setupPaths() LLXMLNodePtr root; BOOL success = LLXMLNode::parseFile(filename, root, NULL); Paths paths; - LLXUIParser parser; - parser.readXUI(root, paths, filename); + if(success) + { + LLXUIParser parser; + parser.readXUI(root, paths, filename); + } sXUIPaths.clear(); if (success && paths.validateBlock()) diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp index 4362c88c4e..2b4a0fc2a1 100644 --- a/indra/llxml/llxmlnode.cpp +++ b/indra/llxml/llxmlnode.cpp @@ -693,7 +693,7 @@ bool LLXMLNode::parseFile(const std::string& filename, LLXMLNodePtr& node, LLXML LLFILE* fp = LLFile::fopen(filename, "rb"); /* Flawfinder: ignore */ if (fp == NULL) { - node = new LLXMLNode(); + node = NULL ; return false; } fseek(fp, 0, SEEK_END); @@ -746,7 +746,7 @@ bool LLXMLNode::parseBuffer( { llwarns << "Parse failure - wrong number of top-level nodes xml." << llendl; - node = new LLXMLNode(); + node = NULL ; return false; } @@ -805,7 +805,7 @@ bool LLXMLNode::parseStream( { llwarns << "Parse failure - wrong number of top-level nodes xml." << llendl; - node = new LLXMLNode(); + node = NULL; return false; } @@ -1206,7 +1206,7 @@ bool LLXMLNode::getChild(const LLStringTableEntry* name, LLXMLNodePtr& node, BOO { return mDefault->getChild(name, node, FALSE); } - node = new LLXMLNode(); + node = NULL; return false; } diff --git a/indra/llxuixml/llxuiparser.cpp b/indra/llxuixml/llxuiparser.cpp index 878f992178..5a525f84a8 100644 --- a/indra/llxuixml/llxuiparser.cpp +++ b/indra/llxuixml/llxuiparser.cpp @@ -1247,6 +1247,7 @@ bool LLSimpleXUIParser::readXUI(const std::string& filename, LLInitParam::BaseBl if( !file.isOpen() ) { LL_WARNS("ReadXUI") << "Unable to open file " << filename << LL_ENDL; + XML_ParserFree( mParser ); return false; } diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 8ecf4a80b7..2d7437f4f3 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -7020,7 +7020,6 @@ void LLVivoxVoiceClient::captureBufferPlayStopSendMessage() LLVivoxProtocolParser::LLVivoxProtocolParser() { - parser = NULL; parser = XML_ParserCreate(NULL); reset(); -- cgit v1.2.3 From 06a2d4eb274b1cd02b82bf2e5ffb458880ae8517 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 28 Nov 2011 17:13:42 -0800 Subject: SH-2038 PROGRESS -- Hacked the code to not render alpha using VBO's on OS X since everything renders faster using VBO's except alpha for some mysterious reason. --- indra/llrender/llshadermgr.cpp | 54 ++++++++++++++++++++++++-------------- indra/newview/featuretable_mac.txt | 4 +-- indra/newview/llvovolume.cpp | 21 +++++++++++---- 3 files changed, 52 insertions(+), 27 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index eea768a3ea..ac9dc9544d 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -845,28 +845,42 @@ BOOL LLShaderMgr::linkProgramObject(GLhandleARB obj, BOOL suppress_errors) LL_WARNS("ShaderLoading") << "GLSL Linker Error:" << LL_ENDL; } -// NOTE: Removing LL_DARWIN block as it doesn't seem to actually give the correct answer, -// but want it for reference once I move it. -#if 0 - // Force an evaluation of the gl state so the driver can tell if the shader will run in hardware or software - // per Apple's suggestion - glBegin(gGL.mMode); - glEnd(); - - // Query whether the shader can or cannot run in hardware - // http://developer.apple.com/qa/qa2007/qa1502.html - long vertexGPUProcessing; - CGLContextObj ctx = CGLGetCurrentContext(); - CGLGetParameter (ctx, kCGLCPGPUVertexProcessing, &vertexGPUProcessing); - long fragmentGPUProcessing; - CGLGetParameter (ctx, kCGLCPGPUFragmentProcessing, &fragmentGPUProcessing); - if (!fragmentGPUProcessing || !vertexGPUProcessing) +#if LL_DARWIN + + // For some reason this absolutely kills the frame rate when VBO's are enabled + if (0) { - LL_WARNS("ShaderLoading") << "GLSL Linker: Running in Software:" << LL_ENDL; - success = GL_FALSE; - suppress_errors = FALSE; + // Force an evaluation of the gl state so the driver can tell if the shader will run in hardware or software + // per Apple's suggestion + LLGLSLShader::sNoFixedFunction = false; + + glUseProgramObjectARB(obj); + + gGL.begin(LLRender::TRIANGLES); + gGL.vertex3f(0.0f, 0.0f, 0.0f); + gGL.vertex3f(0.0f, 0.0f, 0.0f); + gGL.vertex3f(0.0f, 0.0f, 0.0f); + gGL.end(); + gGL.flush(); + + glUseProgramObjectARB(0); + + LLGLSLShader::sNoFixedFunction = true; + + // Query whether the shader can or cannot run in hardware + // http://developer.apple.com/qa/qa2007/qa1502.html + GLint vertexGPUProcessing, fragmentGPUProcessing; + CGLContextObj ctx = CGLGetCurrentContext(); + CGLGetParameter(ctx, kCGLCPGPUVertexProcessing, &vertexGPUProcessing); + CGLGetParameter(ctx, kCGLCPGPUFragmentProcessing, &fragmentGPUProcessing); + if (!fragmentGPUProcessing || !vertexGPUProcessing) + { + LL_WARNS("ShaderLoading") << "GLSL Linker: Running in Software:" << LL_ENDL; + success = GL_FALSE; + suppress_errors = FALSE; + } } - + #else std::string log = get_object_log(obj); LLStringUtil::toLower(log); diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index 390da2273d..1e2fbc677d 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -1,4 +1,4 @@ -version 31 +version 32 // The version number above should be implemented IF AND ONLY IF some // change has been made that is sufficiently important to justify // resetting the graphics preferences of all users to the recommended @@ -67,7 +67,7 @@ RenderDeferred 1 1 RenderDeferredSSAO 1 1 RenderShadowDetail 1 2 WatchdogDisabled 1 1 -RenderUseStreamVBO 1 0 +RenderUseStreamVBO 1 1 RenderFSAASamples 1 16 RenderMaxTextureIndex 1 16 diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 3d013f286c..20f8674655 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4624,6 +4624,19 @@ struct CompareBatchBreakerModified void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector& faces, BOOL distance_sort, BOOL batch_textures) { + U32 buffer_usage = group->mBufferUsage; + +#if LL_DARWIN + // HACK from Leslie: + // Disable VBO usage for alpha on Mac OS X because it kills the framerate + // due to implicit calls to glTexSubImage that are beyond our control. + // (this works because the only calls here that sort by distance are alpha) + if (distance_sort) + { + buffer_usage = 0x0; + } +#endif + //calculate maximum number of vertices to store in a single buffer U32 max_vertices = (gSavedSettings.getS32("RenderMaxVBOSize")*1024)/LLVertexBuffer::calcVertexSize(group->mSpatialPartition->mVertexDataMask); max_vertices = llmin(max_vertices, (U32) 65535); @@ -4805,17 +4818,15 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: if (!buffer) { //create new buffer if needed - buffer = createVertexBuffer(mask, - group->mBufferUsage); + buffer = createVertexBuffer(mask, buffer_usage); buffer->allocateBuffer(geom_count, index_count, TRUE); } else { //resize pre-existing buffer - if (LLVertexBuffer::sEnableVBOs && buffer->getUsage() != group->mBufferUsage || + if (LLVertexBuffer::sEnableVBOs && buffer->getUsage() != buffer_usage || buffer->getTypeMask() != mask) { - buffer = createVertexBuffer(mask, - group->mBufferUsage); + buffer = createVertexBuffer(mask, buffer_usage); buffer->allocateBuffer(geom_count, index_count, TRUE); } else -- cgit v1.2.3 From 45d3e147aca316df59506053c4de5f4239287ee7 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 29 Nov 2011 17:13:11 -0600 Subject: SH-1912 Add environment map back into shiny when lighting and shadows enabled. --- indra/llrender/llrender.cpp | 5 +++++ indra/llrender/llrender.h | 1 + .../app_settings/shaders/class1/deferred/softenLightF.glsl | 12 ++++++------ .../app_settings/shaders/class2/deferred/softenLightF.glsl | 10 ++++++---- indra/newview/pipeline.cpp | 5 ++--- 5 files changed, 20 insertions(+), 13 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 812fa7024b..cd827f5091 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -1444,6 +1444,11 @@ const glh::matrix4f& LLRender::getModelviewMatrix() return mMatrix[MM_MODELVIEW][mMatIdx[MM_MODELVIEW]]; } +const glh::matrix4f& LLRender::getProjectionMatrix() +{ + return mMatrix[MM_PROJECTION][mMatIdx[MM_PROJECTION]]; +} + void LLRender::translateUI(F32 x, F32 y, F32 z) { if (mUIOffset.empty()) diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 7581b9f908..fa5f7f311d 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -348,6 +348,7 @@ public: void matrixMode(U32 mode); const glh::matrix4f& getModelviewMatrix(); + const glh::matrix4f& getProjectionMatrix(); void syncMatrices(); void syncLightState(); diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 60952ea38e..267c9bdaa5 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -35,7 +35,6 @@ uniform sampler2DRect positionMap; uniform sampler2DRect normalMap; uniform sampler2DRect lightMap; uniform sampler2DRect depthMap; -uniform sampler2D noiseMap; uniform samplerCube environmentMap; uniform sampler2D lightFunc; @@ -60,9 +59,7 @@ uniform vec4 distance_multiplier; uniform vec4 max_y; uniform vec4 glow; uniform float scene_light_strength; -uniform vec3 env_mat[3]; -//uniform mat4 shadow_matrix[3]; -//uniform vec4 shadow_clip; +uniform mat3 env_mat; uniform mat3 ssao_effect_mat; uniform vec3 sun_dir; @@ -279,8 +276,7 @@ void main() vec3 pos = getPosition_d(tc, depth).xyz; vec3 norm = texture2DRect(normalMap, tc).xyz; norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - //vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0).xyz; - + float da = max(dot(norm.xyz, sun_dir.xyz), 0.0); vec4 diffuse = texture2DRect(diffuseRect, tc); @@ -309,6 +305,10 @@ void main() vec3 spec_contrib = dumbshiny * spec.rgb; bloom = dot(spec_contrib, spec_contrib); col += spec_contrib; + + //add environmentmap + vec3 env_vec = env_mat * refnormpersp; + col += textureCube(environmentMap, env_vec).rgb * max(spec.a-diffuse.a-0.2, 0.0); } col = atmosLighting(col); diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index eb367d4ad6..d905e76df8 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -34,7 +34,6 @@ uniform sampler2DRect specularRect; uniform sampler2DRect normalMap; uniform sampler2DRect lightMap; uniform sampler2DRect depthMap; -uniform sampler2D noiseMap; uniform samplerCube environmentMap; uniform sampler2D lightFunc; uniform vec3 gi_quad; @@ -60,7 +59,7 @@ uniform vec4 distance_multiplier; uniform vec4 max_y; uniform vec4 glow; uniform float scene_light_strength; -uniform vec3 env_mat[3]; +uniform mat3 env_mat; uniform vec4 shadow_clip; uniform mat3 ssao_effect_mat; @@ -279,8 +278,7 @@ void main() vec3 pos = getPosition_d(tc, depth).xyz; vec3 norm = texture2DRect(normalMap, tc).xyz; norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - //vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0).xyz; - + float da = max(dot(norm.xyz, sun_dir.xyz), 0.0); vec4 diffuse = texture2DRect(diffuseRect, tc); @@ -315,6 +313,10 @@ void main() vec3 spec_contrib = dumbshiny * spec.rgb; bloom = dot(spec_contrib, spec_contrib); col += spec_contrib; + + //add environmentmap + vec3 env_vec = env_mat * refnormpersp; + col += textureCube(environmentMap, env_vec).rgb * max(spec.a-diffuse.a-0.2, 0.0); } col = atmosLighting(col); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 12bec90881..657cdc0e07 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -7108,13 +7108,12 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, U32 n cube_map->enable(channel); cube_map->bind(); F32* m = gGLModelView; - - + F32 mat[] = { m[0], m[1], m[2], m[4], m[5], m[6], m[8], m[9], m[10] }; - shader.uniform3fv(LLShaderMgr::DEFERRED_ENV_MAT, 3, mat); + shader.uniformMatrix3fv(LLShaderMgr::DEFERRED_ENV_MAT, 1, TRUE, mat); } } -- cgit v1.2.3 From 3fc4c14464c1b8152108a5332b754d5b2671e54d Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 29 Nov 2011 16:18:50 -0700 Subject: fix a mac build error: a friend declaration issue. --- indra/llmessage/llcurl.cpp | 32 ++++++++++++++++++++++---------- indra/llmessage/llcurl.h | 10 ++++++++-- 2 files changed, 30 insertions(+), 12 deletions(-) (limited to 'indra') diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index 7f61e1ac04..7ca25d07fc 100644 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -797,9 +797,10 @@ void LLCurl::Multi::removeEasy(Easy* easy) //------------------------------------------------------------ //LLCurlThread -LLCurlThread::CurlRequest::CurlRequest(handle_t handle, LLCurl::Multi* multi) : +LLCurlThread::CurlRequest::CurlRequest(handle_t handle, LLCurl::Multi* multi, LLCurlThread* curl_thread) : LLQueuedThread::QueuedRequest(handle, LLQueuedThread::PRIORITY_NORMAL, FLAG_AUTO_COMPLETE), - mMulti(multi) + mMulti(multi), + mCurlThread(curl_thread) { } @@ -807,7 +808,7 @@ LLCurlThread::CurlRequest::~CurlRequest() { if(mMulti) { - delete mMulti ; + mCurlThread->deleteMulti(mMulti) ; mMulti = NULL ; } } @@ -817,7 +818,7 @@ bool LLCurlThread::CurlRequest::processRequest() bool completed = true ; if(mMulti) { - completed = mMulti->doPerform() ; + completed = mCurlThread->doMultiPerform(mMulti) ; setPriority(LLQueuedThread::PRIORITY_LOW) ; } @@ -826,7 +827,7 @@ bool LLCurlThread::CurlRequest::processRequest() void LLCurlThread::CurlRequest::finishRequest(bool completed) { - delete mMulti ; + mCurlThread->deleteMulti(mMulti) ; mMulti = NULL ; } @@ -849,7 +850,7 @@ void LLCurlThread::addMulti(LLCurl::Multi* multi) { multi->mHandle = generateHandle() ; - CurlRequest* req = new CurlRequest(multi->mHandle, multi) ; + CurlRequest* req = new CurlRequest(multi->mHandle, multi, this) ; if (!addRequest(req)) { @@ -857,11 +858,22 @@ void LLCurlThread::addMulti(LLCurl::Multi* multi) } } -void LLCurlThread::deleteMulti(LLCurl::Multi* multi) +void LLCurlThread::killMulti(LLCurl::Multi* multi) { multi->markDead() ; } +//private +bool LLCurlThread::doMultiPerform(LLCurl::Multi* multi) +{ + return multi->doPerform() ; +} + +//private +void LLCurlThread::deleteMulti(LLCurl::Multi* multi) +{ + delete multi ; +} //------------------------------------------------------------ //static @@ -886,7 +898,7 @@ LLCurlRequest::~LLCurlRequest() //stop all Multi handle background threads for (curlmulti_set_t::iterator iter = mMultiSet.begin(); iter != mMultiSet.end(); ++iter) { - LLCurl::getCurlThread()->deleteMulti(*iter) ; + LLCurl::getCurlThread()->killMulti(*iter) ; } mMultiSet.clear() ; } @@ -1023,7 +1035,7 @@ S32 LLCurlRequest::process() if (multi != mActiveMulti && tres == 0 && multi->mQueued == 0) { mMultiSet.erase(curiter); - LLCurl::getCurlThread()->deleteMulti(multi); + LLCurl::getCurlThread()->killMulti(multi); } } mProcessing = FALSE; @@ -1069,7 +1081,7 @@ LLCurlEasyRequest::LLCurlEasyRequest() LLCurlEasyRequest::~LLCurlEasyRequest() { - LLCurl::getCurlThread()->deleteMulti(mMulti) ; + LLCurl::getCurlThread()->killMulti(mMulti) ; } void LLCurlEasyRequest::setopt(CURLoption option, S32 value) diff --git a/indra/llmessage/llcurl.h b/indra/llmessage/llcurl.h index 23a6ca67e3..a275db3e53 100644 --- a/indra/llmessage/llcurl.h +++ b/indra/llmessage/llcurl.h @@ -328,7 +328,7 @@ public: virtual ~CurlRequest(); // use deleteRequest() public: - CurlRequest(handle_t handle, LLCurl::Multi* multi); + CurlRequest(handle_t handle, LLCurl::Multi* multi, LLCurlThread* curl_thread); /*virtual*/ bool processRequest(); /*virtual*/ void finishRequest(bool completed); @@ -336,8 +336,10 @@ public: private: // input LLCurl::Multi* mMulti; + LLCurlThread* mCurlThread; }; - + friend class CurlRequest; + public: LLCurlThread(bool threaded = true) ; virtual ~LLCurlThread() ; @@ -345,6 +347,10 @@ public: S32 update(U32 max_time_ms); void addMulti(LLCurl::Multi* multi) ; + void killMulti(LLCurl::Multi* multi) ; + +private: + bool doMultiPerform(LLCurl::Multi* multi) ; void deleteMulti(LLCurl::Multi* multi) ; } ; -- cgit v1.2.3 From 9ad8f46a6bb96a8352cf66beafa1c742a4bed5a9 Mon Sep 17 00:00:00 2001 From: eli Date: Tue, 29 Nov 2011 15:52:56 -0800 Subject: sync with viewer-development --- .../newview/skins/default/xui/en/floater_about.xml | 52 +++--- .../default/xui/en/floater_hardware_settings.xml | 2 +- .../skins/default/xui/en/floater_world_map.xml | 2 +- indra/newview/skins/default/xui/en/menu_viewer.xml | 21 +-- .../default/xui/en/panel_postcard_settings.xml | 163 +++++++++------- .../skins/default/xui/en/panel_snapshot_local.xml | 205 ++++++++++++--------- .../default/xui/en/panel_snapshot_profile.xml | 171 ++++++++++------- indra/newview/skins/minimal/colors.xml | 6 - .../newview/skins/minimal/textures/arrow_keys.png | Bin 6558 -> 0 bytes .../minimal/textures/bottomtray/Speak_Btn_Off.png | Bin 993 -> 0 bytes .../bottomtray/Speak_Btn_Selected_Press.png | Bin 1217 -> 0 bytes .../textures/bottomtray/button_separator.png | Bin 153 -> 0 bytes .../minimal/textures/bottomtray/close_off.png | Bin 3184 -> 0 bytes .../minimal/textures/bottomtray/close_over.png | Bin 3173 -> 0 bytes .../minimal/textures/bottomtray/close_press.png | Bin 3259 -> 0 bytes .../skins/minimal/textures/click_to_move.png | Bin 8188 -> 0 bytes indra/newview/skins/minimal/textures/textures.xml | 11 -- .../skins/minimal/xui/ru/menu_script_chiclet.xml | 4 - .../skins/minimal/xui/tr/menu_script_chiclet.xml | 4 - .../skins/minimal/xui/zh/menu_script_chiclet.xml | 4 - .../minimal/xui/zh_CN/menu_script_chiclet.xml | 4 - 21 files changed, 359 insertions(+), 290 deletions(-) delete mode 100644 indra/newview/skins/minimal/colors.xml delete mode 100644 indra/newview/skins/minimal/textures/arrow_keys.png delete mode 100644 indra/newview/skins/minimal/textures/bottomtray/Speak_Btn_Off.png delete mode 100644 indra/newview/skins/minimal/textures/bottomtray/Speak_Btn_Selected_Press.png delete mode 100644 indra/newview/skins/minimal/textures/bottomtray/button_separator.png delete mode 100644 indra/newview/skins/minimal/textures/bottomtray/close_off.png delete mode 100644 indra/newview/skins/minimal/textures/bottomtray/close_over.png delete mode 100644 indra/newview/skins/minimal/textures/bottomtray/close_press.png delete mode 100644 indra/newview/skins/minimal/textures/click_to_move.png delete mode 100644 indra/newview/skins/minimal/textures/textures.xml delete mode 100644 indra/newview/skins/minimal/xui/ru/menu_script_chiclet.xml delete mode 100644 indra/newview/skins/minimal/xui/tr/menu_script_chiclet.xml delete mode 100644 indra/newview/skins/minimal/xui/zh/menu_script_chiclet.xml delete mode 100644 indra/newview/skins/minimal/xui/zh_CN/menu_script_chiclet.xml (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml index 36af475824..c7e9ec781d 100644 --- a/indra/newview/skins/default/xui/en/floater_about.xml +++ b/indra/newview/skins/default/xui/en/floater_about.xml @@ -196,34 +196,36 @@ Dummy Name replaced at run time top="5" width="435" word_wrap="true"> -3Dconnexion SDK Copyright (C) 1992-2007 3Dconnexion -APR Copyright (C) 2000-2004 The Apache Software Foundation -Collada DOM Copyright 2005 Sony Computer Entertainment Inc. -cURL Copyright (C) 1996-2002, Daniel Stenberg, (daniel@haxx.se) -DBus/dbus-glib Copyright (C) 2002, 2003 CodeFactory AB / Copyright (C) 2003, 2004 Red Hat, Inc. -expat Copyright (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd. -FreeType Copyright (C) 1996-2002, The FreeType Project (www.freetype.org). -GL Copyright (C) 1999-2004 Brian Paul. -GLOD Copyright (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns Hopkins University and David Luebke, Brenden Schubert, University of Virginia. -google-perftools Copyright (c) 2005, Google Inc. -Havok.com(TM) Copyright (C) 1999-2001, Telekinesys Research Limited. -jpeg2000 Copyright (C) 2001, David Taubman, The University of New South Wales (UNSW) -jpeglib Copyright (C) 1991-1998, Thomas G. Lane. -ogg/vorbis Copyright (C) 2001, Xiphophorus -OpenSSL Copyright (C) 1998-2002 The OpenSSL Project. -PCRE Copyright (c) 1997-2008 University of Cambridge -SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga -SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) -xmlrpc-epi Copyright (C) 2000 Epinions, Inc. -zlib Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler. -google-perftools Copyright (c) 2005, Google Inc. + 3Dconnexion SDK Copyright (C) 1992-2007 3Dconnexion + APR Copyright (C) 2000-2004 The Apache Software Foundation + Collada DOM Copyright 2005 Sony Computer Entertainment Inc. + cURL Copyright (C) 1996-2002, Daniel Stenberg, (daniel@haxx.se) + DBus/dbus-glib Copyright (C) 2002, 2003 CodeFactory AB / Copyright (C) 2003, 2004 Red Hat, Inc. + expat Copyright (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd. + FreeType Copyright (C) 1996-2002, The FreeType Project (www.freetype.org). + GL Copyright (C) 1999-2004 Brian Paul. + GLOD Copyright (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns Hopkins University and David Luebke, Brenden Schubert, University of Virginia. + google-perftools Copyright (c) 2005, Google Inc. + Havok.com(TM) Copyright (C) 1999-2001, Telekinesys Research Limited. + jpeg2000 Copyright (C) 2001, David Taubman, The University of New South Wales (UNSW) + jpeglib Copyright (C) 1991-1998, Thomas G. Lane. + ogg/vorbis Copyright (C) 2001, Xiphophorus + OpenSSL Copyright (C) 1998-2002 The OpenSSL Project. + PCRE Copyright (c) 1997-2008 University of Cambridge + SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga + SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + xmlrpc-epi Copyright (C) 2000 Epinions, Inc. + zlib Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler. + google-perftools Copyright (c) 2005, Google Inc. -Second Life Viewer uses Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (and its Licensors). All Rights Reserved. See www.havok.com for details. + Second Life Viewer uses Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (and its Licensors). All Rights Reserved. See www.havok.com for details. -All rights reserved. See licenses.txt for details. + This software contains source code provided by NVIDIA Corporation. -Voice chat Audio coding: Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1 Annex C) - + All rights reserved. See licenses.txt for details. + + Voice chat Audio coding: Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1 Annex C) + diff --git a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml index 05f4c52b95..66bb9d3cea 100644 --- a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml +++ b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml @@ -35,7 +35,7 @@ height="12" layout="topleft" left="10" - name="Antialiasing:" + name="antialiasing label" top_pad="7" width="188"> Antialiasing: diff --git a/indra/newview/skins/default/xui/en/floater_world_map.xml b/indra/newview/skins/default/xui/en/floater_world_map.xml index 4314c8a9e2..56d79f62c7 100644 --- a/indra/newview/skins/default/xui/en/floater_world_map.xml +++ b/indra/newview/skins/default/xui/en/floater_world_map.xml @@ -468,7 +468,7 @@ left="3" top_pad="7" mouse_opaque="true" - name="region_icon" + name="location_icon" width="16" /> + + + + @@ -2569,19 +2577,6 @@ - - - - - - - - - - - - ([QLVL]) - + right="-10"> + + + + + + + + + ([QLVL]) + + + diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml index 30403a21dd..ae0215a578 100644 --- a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml +++ b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml @@ -80,93 +80,128 @@ name="Custom" value="[i-1,i-1]" /> - - - - - - - - - - - ([QLVL]) - + right="-10"> + + + + + + + + + + + + + + ([QLVL]) + + +