diff options
author | Richard Linden <none@none> | 2013-11-11 19:17:49 -0800 |
---|---|---|
committer | Richard Linden <none@none> | 2013-11-11 19:17:49 -0800 |
commit | 17e9c872ada0cd1d3bf5c16887ee7f220f3a10c7 (patch) | |
tree | 93f36acc00695d7b4ee2e43d08ce790358966f38 /indra/newview/llviewerwindow.cpp | |
parent | ebc9bcbf69f7a519677a6522979a6bf6cbb04bb8 (diff) | |
parent | 1983f52ce5211c02a55f5cabd86962eea3a22084 (diff) |
Automated merge with http://bitbucket.org/lindenlab/viewer-release
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rwxr-xr-x | indra/newview/llviewerwindow.cpp | 209 |
1 files changed, 106 insertions, 103 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index cb7536edce..61f3ae5b85 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -40,6 +40,7 @@ #include "llagentcamera.h" #include "llcommunicationchannel.h" #include "llfloaterreg.h" +#include "llhudicon.h" #include "llmeshrepository.h" #include "llnotificationhandler.h" #include "llpanellogin.h" @@ -75,13 +76,11 @@ #include "message.h" #include "object_flags.h" #include "lltimer.h" -#include "timing.h" #include "llviewermenu.h" #include "lltooltip.h" #include "llmediaentry.h" #include "llurldispatcher.h" #include "raytrace.h" -#include "llstat.h" // newview includes #include "llagent.h" @@ -218,6 +217,7 @@ // Globals // void render_ui(F32 zoom_factor = 1.f, int subfield = 0); +void swap(); extern BOOL gDebugClicks; extern BOOL gDisplaySwapBuffers; @@ -238,7 +238,7 @@ LLVector4a gDebugRaycastParticleIntersection; LLVector2 gDebugRaycastTexCoord; LLVector4a gDebugRaycastNormal; LLVector4a gDebugRaycastTangent; -S32 gDebugRaycastFaceHit; +S32 gDebugRaycastFaceHit; LLVector4a gDebugRaycastStart; LLVector4a gDebugRaycastEnd; @@ -258,6 +258,9 @@ std::string LLViewerWindow::sSnapshotDir; std::string LLViewerWindow::sMovieBaseName; +LLTrace::SampleStatHandle<> LLViewerWindow::sMouseVelocityStat("Mouse Velocity"); + + class RecordToChatConsole : public LLError::Recorder, public LLSingleton<RecordToChatConsole> { public: @@ -287,6 +290,8 @@ public: // LLDebugText // +static LLTrace::BlockTimerStatHandle FTM_DISPLAY_DEBUG_TEXT("Display Debug Text"); + class LLDebugText { private: @@ -463,6 +468,8 @@ public: if (gSavedSettings.getBOOL("DebugShowRenderInfo")) { + LLTrace::Recording& last_frame_recording = LLTrace::get_frame_recording().getLastRecording(); + if (gPipeline.getUseVertexShaders() == 0) { addText(xpos, ypos, "Shaders Disabled"); @@ -568,7 +575,7 @@ public: addText(xpos, ypos, llformat("%d Unique Textures", LLImageGL::sUniqueCount)); ypos += y_inc; - addText(xpos, ypos, llformat("%d Render Calls", gPipeline.mBatchCount)); + addText(xpos, ypos, llformat("%d Render Calls", last_frame_recording.getSampleCount(LLPipeline::sStatBatchSize))); ypos += y_inc; addText(xpos, ypos, llformat("%d/%d Objects Active", gObjectList.getNumActiveObjects(), gObjectList.getNumObjects())); @@ -583,14 +590,9 @@ public: gPipeline.mTextureMatrixOps = 0; gPipeline.mMatrixOpCount = 0; - if (gPipeline.mBatchCount > 0) + if (last_frame_recording.getSampleCount(LLPipeline::sStatBatchSize) > 0) { - addText(xpos, ypos, llformat("Batch min/max/mean: %d/%d/%d", gPipeline.mMinBatchSize, gPipeline.mMaxBatchSize, - gPipeline.mTrianglesDrawn/gPipeline.mBatchCount)); - - gPipeline.mMinBatchSize = gPipeline.mMaxBatchSize; - gPipeline.mMaxBatchSize = 0; - gPipeline.mBatchCount = 0; + addText(xpos, ypos, llformat("Batch min/max/mean: %d/%d/%d", last_frame_recording.getMin(LLPipeline::sStatBatchSize), last_frame_recording.getMax(LLPipeline::sStatBatchSize), last_frame_recording.getMean(LLPipeline::sStatBatchSize))); } ypos += y_inc; @@ -602,9 +604,9 @@ public: ypos += y_inc; - if (!LLSpatialGroup::sPendingQueries.empty()) + if (!LLOcclusionCullingGroup::sPendingQueries.empty()) { - addText(xpos,ypos, llformat("%d Queries pending", LLSpatialGroup::sPendingQueries.size())); + addText(xpos,ypos, llformat("%d Queries pending", LLOcclusionCullingGroup::sPendingQueries.size())); ypos += y_inc; } @@ -778,9 +780,9 @@ public: U32 old_y = ypos ; for(S32 i = LLViewerTexture::BOOST_NONE; i < LLViewerTexture::MAX_GL_IMAGE_CATEGORY; i++) { - if(gTotalTextureBytesPerBoostLevel[i] > 0) + if(gTotalTextureBytesPerBoostLevel[i] > (S32Bytes)0) { - addText(xpos, ypos, llformat("Boost_Level %d: %.3f MB", i, (F32)gTotalTextureBytesPerBoostLevel[i] / (1024 * 1024))); + addText(xpos, ypos, llformat("Boost_Level %d: %.3f MB", i, F32Megabytes(gTotalTextureBytesPerBoostLevel[i]).value())); ypos += y_inc; } } @@ -839,6 +841,7 @@ public: void draw() { + LL_RECORD_BLOCK_TIME(FTM_DISPLAY_DEBUG_TEXT); for (line_list_t::iterator iter = mLineList.begin(); iter != mLineList.end(); ++iter) { @@ -928,7 +931,7 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK if (gDebugClicks) { - llinfos << "ViewerWindow " << buttonname << " mouse " << buttonstatestr << " at " << x << "," << y << llendl; + LL_INFOS() << "ViewerWindow " << buttonname << " mouse " << buttonstatestr << " at " << x << "," << y << LL_ENDL; } // Make sure we get a corresponding mouseup event, even if the mouse leaves the window @@ -954,13 +957,13 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK mouse_captor->screenPointToLocal( x, y, &local_x, &local_y ); if (LLView::sDebugMouseHandling) { - llinfos << buttonname << " Mouse " << buttonstatestr << " handled by captor " << mouse_captor->getName() << llendl; + LL_INFOS() << buttonname << " Mouse " << buttonstatestr << " handled by captor " << mouse_captor->getName() << LL_ENDL; } BOOL r = mouse_captor->handleAnyMouseClick(local_x, local_y, mask, clicktype, down); if (r) { - lldebugs << "LLViewerWindow::handleAnyMouseClick viewer with mousecaptor calling updatemouseeventinfo - local_x|global x "<< local_x << " " << x << "local/global y " << local_y << " " << y << llendl; + LL_DEBUGS() << "LLViewerWindow::handleAnyMouseClick viewer with mousecaptor calling updatemouseeventinfo - local_x|global x "<< local_x << " " << x << "local/global y " << local_y << " " << y << LL_ENDL; LLViewerEventRecorder::instance().setMouseGlobalCoords(x,y); LLViewerEventRecorder::instance().logMouseEvent(std::string(buttonstatestr),std::string(buttonname)); @@ -980,7 +983,7 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK if (r) { - lldebugs << "LLViewerWindow::handleAnyMouseClick calling updatemouseeventinfo - global x "<< " " << x << "global y " << y << "buttonstate: " << buttonstatestr << " buttonname " << buttonname << llendl; + LL_DEBUGS() << "LLViewerWindow::handleAnyMouseClick calling updatemouseeventinfo - global x "<< " " << x << "global y " << y << "buttonstate: " << buttonstatestr << " buttonname " << buttonname << LL_ENDL; LLViewerEventRecorder::instance().setMouseGlobalCoords(x,y); @@ -996,12 +999,12 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK if (LLView::sDebugMouseHandling) { - llinfos << buttonname << " Mouse " << buttonstatestr << " " << LLViewerEventRecorder::instance().get_xui() << llendl; + LL_INFOS() << buttonname << " Mouse " << buttonstatestr << " " << LLViewerEventRecorder::instance().get_xui() << LL_ENDL; } return TRUE; } else if (LLView::sDebugMouseHandling) { - llinfos << buttonname << " Mouse " << buttonstatestr << " not handled by view" << llendl; + LL_INFOS() << buttonname << " Mouse " << buttonstatestr << " not handled by view" << LL_ENDL; } } @@ -1127,7 +1130,7 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi S32 object_face = pick_info.mObjectFace; std::string url = data; - lldebugs << "Object: picked at " << pos.mX << ", " << pos.mY << " - face = " << object_face << " - URL = " << url << llendl; + LL_DEBUGS() << "Object: picked at " << pos.mX << ", " << pos.mY << " - face = " << object_face << " - URL = " << url << LL_ENDL; LLVOVolume *obj = dynamic_cast<LLVOVolume*>(static_cast<LLViewerObject*>(pick_info.getObject())); @@ -1460,10 +1463,11 @@ BOOL LLViewerWindow::handlePaint(LLWindow *window, S32 x, S32 y, S32 width, S FillRect(hdc, &wnd_rect, CreateSolidBrush(RGB(255, 255, 255))); std::string temp_str; + LLTrace::Recording& recording = LLViewerStats::instance().getRecording(); temp_str = llformat( "FPS %3.1f Phy FPS %2.1f Time Dil %1.3f", /* Flawfinder: ignore */ - LLViewerStats::getInstance()->mFPSStat.getMeanPerSec(), - LLViewerStats::getInstance()->mSimPhysicsFPS.getPrev(0), - LLViewerStats::getInstance()->mSimTimeDilation.getPrev(0)); + recording.getPerSec(LLStatViewer::FPS), //mFPSStat.getMeanPerSec(), + recording.getLastValue(LLStatViewer::SIM_PHYSICS_FPS), + recording.getLastValue(LLStatViewer::SIM_TIME_DILATION)); S32 len = temp_str.length(); TextOutA(hdc, 0, 0, temp_str.c_str(), len); @@ -1598,8 +1602,7 @@ LLViewerWindow::LLViewerWindow(const Params& p) mResDirty(false), mStatesDirty(false), mCurrResolutionIndex(0), - mProgressView(NULL), - mMouseVelocityStat(new LLStat("Mouse Velocity")) + mProgressView(NULL) { // gKeyboard is still NULL, so it doesn't do LLWindowListener any good to // pass its value right now. Instead, pass it a nullary function that @@ -1617,7 +1620,7 @@ LLViewerWindow::LLViewerWindow(const Params& p) LLNotifications::instance().setIgnoreAllNotifications(ignore); if (ignore) { - llinfos << "NOTE: ALL NOTIFICATIONS THAT OCCUR WILL GET ADDED TO IGNORE LIST FOR LATER RUNS." << llendl; + LL_INFOS() << "NOTE: ALL NOTIFICATIONS THAT OCCUR WILL GET ADDED TO IGNORE LIST FOR LATER RUNS." << LL_ENDL; } // Default to application directory. @@ -1655,14 +1658,14 @@ LLViewerWindow::LLViewerWindow(const Params& p) { LLSplashScreen::update(LLTrans::getString("StartupRequireDriverUpdate")); - LL_WARNS("Window") << "Failed to create window, to be shutting Down, be sure your graphics driver is updated." << llendl ; + LL_WARNS("Window") << "Failed to create window, to be shutting Down, be sure your graphics driver is updated." << LL_ENDL ; ms_sleep(5000) ; //wait for 5 seconds. LLSplashScreen::update(LLTrans::getString("ShuttingDown")); #if LL_LINUX || LL_SOLARIS - llwarns << "Unable to create window, be sure screen is set at 32-bit color and your graphics driver is configured correctly. See README-linux.txt or README-solaris.txt for further information." - << llendl; + LL_WARNS() << "Unable to create window, be sure screen is set at 32-bit color and your graphics driver is configured correctly. See README-linux.txt or README-solaris.txt for further information." + << LL_ENDL; #else LL_WARNS("Window") << "Unable to create window, be sure screen is set at 32-bit color in Control Panels->Display->Settings" << LL_ENDL; @@ -1682,7 +1685,7 @@ LLViewerWindow::LLViewerWindow(const Params& p) if(p.fullscreen && ( scr.mX!=p.width || scr.mY!=p.height)) { - llwarns << "Fullscreen has forced us in to a different resolution now using "<<scr.mX<<" x "<<scr.mY<<llendl; + LL_WARNS() << "Fullscreen has forced us in to a different resolution now using "<<scr.mX<<" x "<<scr.mY<<LL_ENDL; gSavedSettings.setS32("FullScreenWidth",scr.mX); gSavedSettings.setS32("FullScreenHeight",scr.mY); } @@ -2033,27 +2036,27 @@ void LLViewerWindow::shutdownViews() // clean up warning logger LLError::removeRecorder(RecordToChatConsole::getInstance()); - llinfos << "Warning logger is cleaned." << llendl ; + LL_INFOS() << "Warning logger is cleaned." << LL_ENDL ; delete mDebugText; mDebugText = NULL; - llinfos << "DebugText deleted." << llendl ; + LL_INFOS() << "DebugText deleted." << LL_ENDL ; // Cleanup global views if (gMorphView) { gMorphView->setVisible(FALSE); } - llinfos << "Global views cleaned." << llendl ; + LL_INFOS() << "Global views cleaned." << LL_ENDL ; LLNotificationsUI::LLToast::cleanupToasts(); - llinfos << "Leftover toast cleaned up." << llendl; + LL_INFOS() << "Leftover toast cleaned up." << LL_ENDL; // DEV-40930: Clear sModalStack. Otherwise, any LLModalDialog left open // will crump with LL_ERRS. LLModalDialog::shutdownModals(); - llinfos << "LLModalDialog shut down." << llendl; + LL_INFOS() << "LLModalDialog shut down." << LL_ENDL; // destroy the nav bar, not currently part of gViewerWindow // *TODO: Make LLNavigationBar part of gViewerWindow @@ -2061,17 +2064,17 @@ void LLViewerWindow::shutdownViews() { delete LLNavigationBar::getInstance(); } - llinfos << "LLNavigationBar destroyed." << llendl ; + LL_INFOS() << "LLNavigationBar destroyed." << LL_ENDL ; // destroy menus after instantiating navbar above, as it needs // access to gMenuHolder cleanup_menus(); - llinfos << "menus destroyed." << llendl ; + LL_INFOS() << "menus destroyed." << LL_ENDL ; // Delete all child views. delete mRootView; mRootView = NULL; - llinfos << "RootView deleted." << llendl ; + LL_INFOS() << "RootView deleted." << LL_ENDL ; LLMenuOptionPathfindingRebakeNavmesh::getInstance()->quit(); @@ -2099,12 +2102,12 @@ void LLViewerWindow::shutdownGL() gSky.cleanup(); stop_glerror(); - llinfos << "Cleaning up pipeline" << llendl; + LL_INFOS() << "Cleaning up pipeline" << LL_ENDL; gPipeline.cleanup(); stop_glerror(); //MUST clean up pipeline before cleaning up wearables - llinfos << "Cleaning up wearables" << llendl; + LL_INFOS() << "Cleaning up wearables" << LL_ENDL; LLWearableList::instance().cleanup() ; gTextureList.shutdown(); @@ -2118,12 +2121,12 @@ void LLViewerWindow::shutdownGL() LLViewerTextureManager::cleanup() ; LLImageGL::cleanupClass() ; - llinfos << "All textures and llimagegl images are destroyed!" << llendl ; + LL_INFOS() << "All textures and llimagegl images are destroyed!" << LL_ENDL ; - llinfos << "Cleaning up select manager" << llendl; + LL_INFOS() << "Cleaning up select manager" << LL_ENDL; LLSelectMgr::getInstance()->cleanup(); - llinfos << "Stopping GL during shutdown" << llendl; + LL_INFOS() << "Stopping GL during shutdown" << LL_ENDL; stopGL(FALSE); stop_glerror(); @@ -2131,19 +2134,17 @@ void LLViewerWindow::shutdownGL() LLVertexBuffer::cleanupClass(); - llinfos << "LLVertexBuffer cleaned." << llendl ; + LL_INFOS() << "LLVertexBuffer cleaned." << LL_ENDL ; } // shutdownViews() and shutdownGL() need to be called first LLViewerWindow::~LLViewerWindow() { - llinfos << "Destroying Window" << llendl; + LL_INFOS() << "Destroying Window" << LL_ENDL; destroyWindow(); delete mDebugText; mDebugText = NULL; - - delete mMouseVelocityStat; } @@ -2254,8 +2255,8 @@ void LLViewerWindow::reshape(S32 width, S32 height) } } - LLViewerStats::getInstance()->setStat(LLViewerStats::ST_WINDOW_WIDTH, (F64)width); - LLViewerStats::getInstance()->setStat(LLViewerStats::ST_WINDOW_HEIGHT, (F64)height); + sample(LLStatViewer::WINDOW_WIDTH, width); + sample(LLStatViewer::WINDOW_HEIGHT, height); LLLayoutStack::updateClass(); } @@ -2530,7 +2531,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) ||(gLoginMenuBarView && gLoginMenuBarView->handleKey(key, mask, TRUE)) ||(gMenuHolder && gMenuHolder->handleKey(key, mask, TRUE))) { - lldebugs << "LLviewerWindow::handleKey handle nav keys for nav" << llendl; + LL_DEBUGS() << "LLviewerWindow::handleKey handle nav keys for nav" << LL_ENDL; LLViewerEventRecorder::instance().logKeyEvent(key,mask); return TRUE; } @@ -2563,7 +2564,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) // if nothing has focus, go to first or last UI element as appropriate if (key == KEY_TAB && (mask & MASK_CONTROL || gFocusMgr.getKeyboardFocus() == NULL)) { - llwarns << "LLviewerWindow::handleKey give floaters first chance at tab key " << llendl; + LL_WARNS() << "LLviewerWindow::handleKey give floaters first chance at tab key " << LL_ENDL; if (gMenuHolder) gMenuHolder->hideMenus(); // if CTRL-tabbing (and not just TAB with no focus), go into window cycle mode @@ -2625,17 +2626,17 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) if (keyboard_focus->handleKey(key, mask, FALSE)) { - lldebugs << "LLviewerWindow::handleKey - in 'traverse up' - no loops seen... just called keyboard_focus->handleKey an it returned true" << llendl; + LL_DEBUGS() << "LLviewerWindow::handleKey - in 'traverse up' - no loops seen... just called keyboard_focus->handleKey an it returned true" << LL_ENDL; LLViewerEventRecorder::instance().logKeyEvent(key,mask); return TRUE; } else { - lldebugs << "LLviewerWindow::handleKey - in 'traverse up' - no loops seen... just called keyboard_focus->handleKey an it returned FALSE" << llendl; + LL_DEBUGS() << "LLviewerWindow::handleKey - in 'traverse up' - no loops seen... just called keyboard_focus->handleKey an it returned FALSE" << LL_ENDL; } } if( LLToolMgr::getInstance()->getCurrentTool()->handleKey(key, mask) ) { - lldebugs << "LLviewerWindow::handleKey toolbar handling?" << llendl; + LL_DEBUGS() << "LLviewerWindow::handleKey toolbar handling?" << LL_ENDL; LLViewerEventRecorder::instance().logKeyEvent(key,mask); return TRUE; } @@ -2643,7 +2644,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) // Try for a new-format gesture if (LLGestureMgr::instance().triggerGesture(key, mask)) { - lldebugs << "LLviewerWindow::handleKey new gesture feature" << llendl; + LL_DEBUGS() << "LLviewerWindow::handleKey new gesture feature" << LL_ENDL; LLViewerEventRecorder::instance().logKeyEvent(key,mask); return TRUE; } @@ -2652,7 +2653,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) // don't pass it down to the menus. if (gGestureList.trigger(key, mask)) { - lldebugs << "LLviewerWindow::handleKey check gesture trigger" << llendl; + LL_DEBUGS() << "LLviewerWindow::handleKey check gesture trigger" << LL_ENDL; LLViewerEventRecorder::instance().logKeyEvent(key,mask); return TRUE; } @@ -2745,7 +2746,7 @@ void LLViewerWindow::handleScrollWheel(S32 clicks) mouse_captor->handleScrollWheel(local_x, local_y, clicks); if (LLView::sDebugMouseHandling) { - llinfos << "Scroll Wheel handled by captor " << mouse_captor->getName() << llendl; + LL_INFOS() << "Scroll Wheel handled by captor " << mouse_captor->getName() << LL_ENDL; } return; } @@ -2763,13 +2764,13 @@ void LLViewerWindow::handleScrollWheel(S32 clicks) { if (LLView::sDebugMouseHandling) { - llinfos << "Scroll Wheel" << LLView::sMouseHandlerMessage << llendl; + LL_INFOS() << "Scroll Wheel" << LLView::sMouseHandlerMessage << LL_ENDL; } return; } else if (LLView::sDebugMouseHandling) { - llinfos << "Scroll Wheel not handled by view" << llendl; + LL_INFOS() << "Scroll Wheel not handled by view" << LL_ENDL; } // Zoom the camera in and out behavior @@ -2858,12 +2859,13 @@ void append_xui_tooltip(LLView* viewp, LLToolTip::Params& params) } } +static LLTrace::BlockTimerStatHandle ftm("Update UI"); + // Update UI based on stored mouse position from mouse-move // event processing. void LLViewerWindow::updateUI() { - static LLFastTimer::DeclareTimer ftm("Update UI"); - LLFastTimer t(ftm); + LL_RECORD_BLOCK_TIME(ftm); static std::string last_handle_msg; @@ -3084,12 +3086,12 @@ void LLViewerWindow::updateUI() handled = mouse_captor->handleHover(local_x, local_y, mask); if (LLView::sDebugMouseHandling) { - llinfos << "Hover handled by captor " << mouse_captor->getName() << llendl; + LL_INFOS() << "Hover handled by captor " << mouse_captor->getName() << LL_ENDL; } if( !handled ) { - lldebugst(LLERR_USER_INPUT) << "hover not handled by mouse captor" << llendl; + LL_DEBUGS("UserInput") << "hover not handled by mouse captor" << LL_ENDL; } } else @@ -3110,7 +3112,7 @@ void LLViewerWindow::updateUI() if (LLView::sDebugMouseHandling && LLView::sMouseHandlerMessage != last_handle_msg) { last_handle_msg = LLView::sMouseHandlerMessage; - llinfos << "Hover" << LLView::sMouseHandlerMessage << llendl; + LL_INFOS() << "Hover" << LLView::sMouseHandlerMessage << LL_ENDL; } handled = TRUE; } @@ -3119,7 +3121,7 @@ void LLViewerWindow::updateUI() if (last_handle_msg != LLStringUtil::null) { last_handle_msg.clear(); - llinfos << "Hover not handled by view" << llendl; + LL_INFOS() << "Hover not handled by view" << LL_ENDL; } } } @@ -3332,8 +3334,8 @@ void LLViewerWindow::updateMouseDelta() static F32 fdy = 0.f; F32 amount = 16.f; - fdx = fdx + ((F32) dx - fdx) * llmin(gFrameIntervalSeconds*amount,1.f); - fdy = fdy + ((F32) dy - fdy) * llmin(gFrameIntervalSeconds*amount,1.f); + fdx = fdx + ((F32) dx - fdx) * llmin(gFrameIntervalSeconds.value()*amount,1.f); + fdy = fdy + ((F32) dy - fdy) * llmin(gFrameIntervalSeconds.value()*amount,1.f); mCurrentMouseDelta.set(llround(fdx), llround(fdy)); mouse_vel.setVec(fdx,fdy); @@ -3344,7 +3346,7 @@ void LLViewerWindow::updateMouseDelta() mouse_vel.setVec((F32) dx, (F32) dy); } - mMouseVelocityStat->addValue(mouse_vel.magVec()); + sample(sMouseVelocityStat, mouse_vel.magVec()); } void LLViewerWindow::updateKeyboardFocus() @@ -3435,10 +3437,10 @@ void LLViewerWindow::updateKeyboardFocus() } } -static LLFastTimer::DeclareTimer FTM_UPDATE_WORLD_VIEW("Update World View"); +static LLTrace::BlockTimerStatHandle FTM_UPDATE_WORLD_VIEW("Update World View"); void LLViewerWindow::updateWorldViewRect(bool use_full_window) { - LLFastTimer ft(FTM_UPDATE_WORLD_VIEW); + LL_RECORD_BLOCK_TIME(FTM_UPDATE_WORLD_VIEW); // start off using whole window to render world LLRect new_world_rect = mWindowRectRaw; @@ -3708,11 +3710,11 @@ BOOL LLViewerWindow::clickPointOnSurfaceGlobal(const S32 x, const S32 y, LLViewe if (!intersect) { point_global = clickPointInWorldGlobal(x, y, objectp); - llinfos << "approx intersection at " << (objectp->getPositionGlobal() - point_global) << llendl; + LL_INFOS() << "approx intersection at " << (objectp->getPositionGlobal() - point_global) << LL_ENDL; } else { - llinfos << "good intersection at " << (objectp->getPositionGlobal() - point_global) << llendl; + LL_INFOS() << "good intersection at " << (objectp->getPositionGlobal() - point_global) << LL_ENDL; } return intersect; @@ -3932,7 +3934,7 @@ LLViewerObject* LLViewerWindow::cursorIntersect(S32 mouse_x, S32 mouse_y, F32 de } } } - + return found; } @@ -4080,13 +4082,13 @@ BOOL LLViewerWindow::mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d S32 grids_per_edge = (S32) regionp->getLand().mGridsPerEdge; if ((i >= grids_per_edge) || (j >= grids_per_edge)) { - //llinfos << "LLViewerWindow::mousePointOnLand probe_point is out of region" << llendl; + //LL_INFOS() << "LLViewerWindow::mousePointOnLand probe_point is out of region" << LL_ENDL; continue; } land_z = regionp->getLand().resolveHeightRegion(probe_point_region); - //llinfos << "mousePointOnLand initial z " << land_z << llendl; + //LL_INFOS() << "mousePointOnLand initial z " << land_z << LL_ENDL; if (probe_point_region.mV[VZ] < land_z) { @@ -4127,7 +4129,7 @@ BOOL LLViewerWindow::mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d j = (S32) (local_probe_point.mV[VY]/regionp->getLand().getMetersPerGrid()); if ((i >= regionp->getLand().mGridsPerEdge) || (j >= regionp->getLand().mGridsPerEdge)) { - // llinfos << "LLViewerWindow::mousePointOnLand probe_point is out of region" << llendl; + // LL_INFOS() << "LLViewerWindow::mousePointOnLand probe_point is out of region" << LL_ENDL; continue; } land_z = regionp->getLand().mSurfaceZ[ i + j * (regionp->getLand().mGridsPerEdge) ]; @@ -4135,7 +4137,7 @@ BOOL LLViewerWindow::mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d land_z = regionp->getLand().resolveHeightRegion(probe_point_region); - //llinfos << "mousePointOnLand refine z " << land_z << llendl; + //LL_INFOS() << "mousePointOnLand refine z " << land_z << LL_ENDL; if (probe_point_region.mV[VZ] < land_z) { @@ -4155,7 +4157,7 @@ BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image, bool force_picke { if (!image) { - llwarns << "No image to save" << llendl; + LL_WARNS() << "No image to save" << LL_ENDL; return FALSE; } @@ -4215,7 +4217,7 @@ BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image, bool force_picke } while( -1 != err ); // search until the file is not found (i.e., stat() gives an error). - llinfos << "Saving snapshot to " << filepath << llendl; + LL_INFOS() << "Saving snapshot to " << filepath << LL_ENDL; return image->save(filepath); } @@ -4238,7 +4240,7 @@ void LLViewerWindow::movieSize(S32 new_width, S32 new_height) BOOL LLViewerWindow::saveSnapshot( const std::string& filepath, S32 image_width, S32 image_height, BOOL show_ui, BOOL do_rebuild, ESnapshotType type) { - llinfos << "Saving snapshot to: " << filepath << llendl; + LL_INFOS() << "Saving snapshot to: " << filepath << LL_ENDL; LLPointer<LLImageRaw> raw = new LLImageRaw; BOOL success = rawSnapshot(raw, image_width, image_height, TRUE, FALSE, show_ui, do_rebuild); @@ -4253,12 +4255,12 @@ BOOL LLViewerWindow::saveSnapshot( const std::string& filepath, S32 image_width, } else { - llwarns << "Unable to encode bmp snapshot" << llendl; + LL_WARNS() << "Unable to encode bmp snapshot" << LL_ENDL; } } else { - llwarns << "Unable to capture raw snapshot" << llendl; + LL_WARNS() << "Unable to capture raw snapshot" << LL_ENDL; } return success; @@ -4299,7 +4301,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei { if(!LLMemory::tryToAlloc(NULL, image_width * image_height * 3)) { - llwarns << "No enough memory to take the snapshot with size (w : h): " << image_width << " : " << image_height << llendl ; + LL_WARNS() << "No enough memory to take the snapshot with size (w : h): " << image_width << " : " << image_height << LL_ENDL ; return FALSE ; //there is no enough memory for taking this snapshot. } } @@ -4396,7 +4398,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei if (show_ui && scale_factor > 1.f) { // Note: we should never get there... - llwarns << "over scaling UI not supported." << llendl; + LL_WARNS() << "over scaling UI not supported." << LL_ENDL; } S32 buffer_x_offset = llfloor(((window_width - snapshot_width) * scale_factor) / 2.f); @@ -4428,7 +4430,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei if (high_res && show_ui) { // Note: we should never get there... - llwarns << "High res UI snapshot not supported. " << llendl; + LL_WARNS() << "High res UI snapshot not supported. " << LL_ENDL; /*send_agent_pause(); //rescale fonts initFonts(scale_factor); @@ -4473,6 +4475,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei // Required for showing the GUI in snapshots and performing bloom composite overlay // Call even if show_ui is FALSE render_ui(scale_factor, subfield); + swap(); } for (U32 out_y = 0; out_y < read_height ; out_y++) @@ -4794,10 +4797,10 @@ LLProgressView *LLViewerWindow::getProgressView() const void LLViewerWindow::dumpState() { - llinfos << "LLViewerWindow Active " << S32(mActive) << llendl; - llinfos << "mWindow visible " << S32(mWindow->getVisible()) + LL_INFOS() << "LLViewerWindow Active " << S32(mActive) << LL_ENDL; + LL_INFOS() << "mWindow visible " << S32(mWindow->getVisible()) << " minimized " << S32(mWindow->getMinimized()) - << llendl; + << LL_ENDL; } void LLViewerWindow::stopGL(BOOL save_state) @@ -4808,7 +4811,7 @@ void LLViewerWindow::stopGL(BOOL save_state) //especially be careful to put anything behind gTextureList.destroyGL(save_state); if (!gGLManager.mIsDisabled) { - llinfos << "Shutting down GL..." << llendl; + LL_INFOS() << "Shutting down GL..." << LL_ENDL; // Pause texture decode threads (will get unpaused during main loop) LLAppViewer::getTextureCache()->pause(); @@ -4853,7 +4856,7 @@ void LLViewerWindow::stopGL(BOOL save_state) gGLManager.mIsDisabled = TRUE; stop_glerror(); - llinfos << "Remaining allocated texture memory: " << LLImageGL::sGlobalTextureMemoryInBytes << " bytes" << llendl; + LL_INFOS() << "Remaining allocated texture memory: " << LLImageGL::sGlobalTextureMemory.value() << " bytes" << LL_ENDL; } } @@ -4865,7 +4868,7 @@ void LLViewerWindow::restoreGL(const std::string& progress_message) //especially, be careful to put something before gTextureList.restoreGL(); if (gGLManager.mIsDisabled) { - llinfos << "Restoring GL..." << llendl; + LL_INFOS() << "Restoring GL..." << LL_ENDL; gGLManager.mIsDisabled = FALSE; initGLDefaults(); @@ -4902,10 +4905,10 @@ void LLViewerWindow::restoreGL(const std::string& progress_message) setShowProgress(TRUE); setProgressString(progress_message); } - llinfos << "...Restoring GL done" << llendl; + LL_INFOS() << "...Restoring GL done" << LL_ENDL; if(!LLAppViewer::instance()->restoreErrorTrap()) { - llwarns << " Someone took over my signal/exception handler (post restoreGL)!" << llendl; + LL_WARNS() << " Someone took over my signal/exception handler (post restoreGL)!" << LL_ENDL; } } @@ -4931,11 +4934,11 @@ void LLViewerWindow::requestResolutionUpdate() mResDirty = true; } -static LLFastTimer::DeclareTimer FTM_WINDOW_CHECK_SETTINGS("Window Settings"); +static LLTrace::BlockTimerStatHandle FTM_WINDOW_CHECK_SETTINGS("Window Settings"); void LLViewerWindow::checkSettings() { - LLFastTimer t(FTM_WINDOW_CHECK_SETTINGS); + LL_RECORD_BLOCK_TIME(FTM_WINDOW_CHECK_SETTINGS); if (mStatesDirty) { gGL.refreshState(); @@ -4953,7 +4956,7 @@ void LLViewerWindow::checkSettings() void LLViewerWindow::restartDisplay(BOOL show_progress_bar) { - llinfos << "Restaring GL" << llendl; + LL_INFOS() << "Restaring GL" << LL_ENDL; stopGL(); if (show_progress_bar) { @@ -4996,7 +4999,7 @@ BOOL LLViewerWindow::changeDisplaySettings(LLCoordScreen size, BOOL disable_vsyn LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus(); send_agent_pause(); - llinfos << "Stopping GL during changeDisplaySettings" << llendl; + LL_INFOS() << "Stopping GL during changeDisplaySettings" << LL_ENDL; stopGL(); mIgnoreActivate = TRUE; LLCoordScreen old_size; @@ -5022,7 +5025,7 @@ BOOL LLViewerWindow::changeDisplaySettings(LLCoordScreen size, BOOL disable_vsyn } send_agent_resume(); - llinfos << "Restoring GL during resolution change" << llendl; + LL_INFOS() << "Restoring GL during resolution change" << LL_ENDL; if (show_progress_bar) { restoreGL(LLTrans::getString("ProgressChangingResolution")); @@ -5088,7 +5091,7 @@ void LLViewerWindow::calcDisplayScale() if (display_scale != mDisplayScale) { - llinfos << "Setting display scale to " << display_scale << llendl; + LL_INFOS() << "Setting display scale to " << display_scale << LL_ENDL; mDisplayScale = display_scale; // Init default fonts @@ -5391,7 +5394,7 @@ void LLPickInfo::getSurfaceInfo() tangent.clear(); normal.clear(); intersection.clear(); - + LLViewerObject* objectp = getObject(); if (objectp) @@ -5412,7 +5415,7 @@ void LLPickInfo::getSurfaceInfo() if (facep) { mUVCoords = facep->surfaceToTexture(mSTCoords, intersection, normal); - } + } } mIntersection.set(intersection.getF32ptr()); |