diff options
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rwxr-xr-x | indra/newview/llviewerwindow.cpp | 191 |
1 files changed, 97 insertions, 94 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index bf11bce3da..844f4344e0 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" @@ -216,6 +215,7 @@ // Globals // void render_ui(F32 zoom_factor = 1.f, int subfield = 0); +void swap(); extern BOOL gDebugClicks; extern BOOL gDisplaySwapBuffers; @@ -236,7 +236,7 @@ LLVector4a gDebugRaycastParticleIntersection; LLVector2 gDebugRaycastTexCoord; LLVector4a gDebugRaycastNormal; LLVector4a gDebugRaycastTangent; -S32 gDebugRaycastFaceHit; +S32 gDebugRaycastFaceHit; LLVector4a gDebugRaycastStart; LLVector4a gDebugRaycastEnd; @@ -256,6 +256,9 @@ std::string LLViewerWindow::sSnapshotDir; std::string LLViewerWindow::sMovieBaseName; +LLTrace::SampleStatHandle<> LLViewerWindow::sMouseVelocityStat("Mouse Velocity"); + + class RecordToChatConsole : public LLError::Recorder, public LLSingleton<RecordToChatConsole> { public: @@ -285,6 +288,8 @@ public: // LLDebugText // +static LLTrace::TimeBlock FTM_DISPLAY_DEBUG_TEXT("Display Debug Text"); + class LLDebugText { private: @@ -461,6 +466,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"); @@ -566,7 +573,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())); @@ -581,14 +588,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; @@ -600,9 +602,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; } @@ -776,9 +778,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; } } @@ -837,6 +839,7 @@ public: void draw() { + LL_RECORD_BLOCK_TIME(FTM_DISPLAY_DEBUG_TEXT); for (line_list_t::iterator iter = mLineList.begin(); iter != mLineList.end(); ++iter) { @@ -926,7 +929,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 @@ -952,7 +955,7 @@ 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; } return mouse_captor->handleAnyMouseClick(local_x, local_y, mask, clicktype, down); } @@ -986,13 +989,13 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK { if (LLView::sDebugMouseHandling) { - llinfos << buttonname << " Mouse " << buttonstatestr << " " << LLView::sMouseHandlerMessage << llendl; + LL_INFOS() << buttonname << " Mouse " << buttonstatestr << " " << LLView::sMouseHandlerMessage << 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; } } @@ -1117,7 +1120,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())); @@ -1449,10 +1452,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); @@ -1587,8 +1591,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 @@ -1606,7 +1609,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. @@ -1644,14 +1647,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; @@ -1671,7 +1674,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); } @@ -2022,27 +2025,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 @@ -2050,17 +2053,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(); @@ -2088,12 +2091,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(); @@ -2107,12 +2110,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(); @@ -2120,19 +2123,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; } @@ -2243,8 +2244,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(); } @@ -2725,7 +2726,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; } @@ -2743,13 +2744,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 @@ -2838,12 +2839,13 @@ void append_xui_tooltip(LLView* viewp, LLToolTip::Params& params) } } +static LLTrace::TimeBlock 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; @@ -3064,12 +3066,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 @@ -3090,7 +3092,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; } @@ -3099,7 +3101,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; } } } @@ -3312,8 +3314,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); @@ -3324,7 +3326,7 @@ void LLViewerWindow::updateMouseDelta() mouse_vel.setVec((F32) dx, (F32) dy); } - mMouseVelocityStat->addValue(mouse_vel.magVec()); + sample(sMouseVelocityStat, mouse_vel.magVec()); } void LLViewerWindow::updateKeyboardFocus() @@ -3415,10 +3417,10 @@ void LLViewerWindow::updateKeyboardFocus() } } -static LLFastTimer::DeclareTimer FTM_UPDATE_WORLD_VIEW("Update World View"); +static LLTrace::TimeBlock 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; @@ -3688,11 +3690,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; @@ -3912,7 +3914,7 @@ LLViewerObject* LLViewerWindow::cursorIntersect(S32 mouse_x, S32 mouse_y, F32 de } } } - + return found; } @@ -4060,13 +4062,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) { @@ -4107,7 +4109,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) ]; @@ -4115,7 +4117,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) { @@ -4135,7 +4137,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; } @@ -4195,7 +4197,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); } @@ -4218,7 +4220,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); @@ -4233,12 +4235,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; @@ -4279,7 +4281,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. } } @@ -4376,7 +4378,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); @@ -4408,7 +4410,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); @@ -4453,6 +4455,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++) @@ -4774,10 +4777,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) @@ -4788,7 +4791,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(); @@ -4833,7 +4836,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; } } @@ -4845,7 +4848,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(); @@ -4882,10 +4885,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; } } @@ -4911,11 +4914,11 @@ void LLViewerWindow::requestResolutionUpdate() mResDirty = true; } -static LLFastTimer::DeclareTimer FTM_WINDOW_CHECK_SETTINGS("Window Settings"); +static LLTrace::TimeBlock 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(); @@ -4933,7 +4936,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) { @@ -4976,7 +4979,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; @@ -5002,7 +5005,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")); @@ -5068,7 +5071,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 @@ -5371,7 +5374,7 @@ void LLPickInfo::getSurfaceInfo() tangent.clear(); normal.clear(); intersection.clear(); - + LLViewerObject* objectp = getObject(); if (objectp) @@ -5392,7 +5395,7 @@ void LLPickInfo::getSurfaceInfo() if (facep) { mUVCoords = facep->surfaceToTexture(mSTCoords, intersection, normal); - } + } } mIntersection.set(intersection.getF32ptr()); |