summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2013-09-09 18:58:41 -0700
committerRichard Linden <none@none>2013-09-09 18:58:41 -0700
commit52da9f5f49e0e300943abc3afa6944e6bee0cdd1 (patch)
treeb61a1aa1775b3faca1baf492a969a51d7ce8b3fe /indra/newview/llviewerwindow.cpp
parent55ae6a7962cdc9a9d7d087fbc529d30db9c37013 (diff)
parent91850b6cfacb32ed32265ebd37ce7690dd79a0b0 (diff)
merge with viewer-release
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rwxr-xr-xindra/newview/llviewerwindow.cpp186
1 files changed, 93 insertions, 93 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 40b8560071..34b0f450ab 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"
@@ -215,6 +214,7 @@
// Globals
//
void render_ui(F32 zoom_factor = 1.f, int subfield = 0);
+void swap();
extern BOOL gDebugClicks;
extern BOOL gDisplaySwapBuffers;
@@ -235,7 +235,7 @@ LLVector4a gDebugRaycastParticleIntersection;
LLVector2 gDebugRaycastTexCoord;
LLVector4a gDebugRaycastNormal;
LLVector4a gDebugRaycastTangent;
-S32 gDebugRaycastFaceHit;
+S32 gDebugRaycastFaceHit;
LLVector4a gDebugRaycastStart;
LLVector4a gDebugRaycastEnd;
@@ -255,6 +255,9 @@ std::string LLViewerWindow::sSnapshotDir;
std::string LLViewerWindow::sMovieBaseName;
+LLTrace::SampleStatHandle<> LLViewerWindow::sMouseVelocityStat("Mouse Velocity");
+
+
class RecordToChatConsole : public LLError::Recorder, public LLSingleton<RecordToChatConsole>
{
public:
@@ -459,6 +462,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");
@@ -564,7 +569,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()));
@@ -579,14 +584,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;
@@ -598,9 +598,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;
}
@@ -738,9 +738,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;
}
}
@@ -888,7 +888,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
@@ -914,7 +914,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);
}
@@ -948,13 +948,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;
}
}
@@ -1079,7 +1079,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()));
@@ -1411,10 +1411,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);
@@ -1549,8 +1550,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
@@ -1568,7 +1568,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.
@@ -1606,14 +1606,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;
@@ -1633,7 +1633,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);
}
@@ -1984,24 +1984,24 @@ 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 ;
// 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
@@ -2009,17 +2009,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();
@@ -2047,12 +2047,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();
@@ -2066,12 +2066,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();
@@ -2079,19 +2079,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;
}
@@ -2202,8 +2200,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();
}
@@ -2684,7 +2682,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;
}
@@ -2702,13 +2700,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
@@ -2797,12 +2795,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;
@@ -3023,12 +3022,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
@@ -3049,7 +3048,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;
}
@@ -3058,7 +3057,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;
}
}
}
@@ -3271,8 +3270,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);
@@ -3283,7 +3282,7 @@ void LLViewerWindow::updateMouseDelta()
mouse_vel.setVec((F32) dx, (F32) dy);
}
- mMouseVelocityStat->addValue(mouse_vel.magVec());
+ sample(sMouseVelocityStat, mouse_vel.magVec());
}
void LLViewerWindow::updateKeyboardFocus()
@@ -3374,10 +3373,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;
@@ -3647,11 +3646,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;
@@ -3871,7 +3870,7 @@ LLViewerObject* LLViewerWindow::cursorIntersect(S32 mouse_x, S32 mouse_y, F32 de
}
}
}
-
+
return found;
}
@@ -4019,13 +4018,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)
{
@@ -4066,7 +4065,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) ];
@@ -4074,7 +4073,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)
{
@@ -4094,7 +4093,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;
}
@@ -4154,7 +4153,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);
}
@@ -4177,7 +4176,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);
@@ -4192,12 +4191,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;
@@ -4238,7 +4237,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.
}
}
@@ -4335,7 +4334,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);
@@ -4367,7 +4366,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);
@@ -4412,6 +4411,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++)
@@ -4733,10 +4733,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)
@@ -4747,7 +4747,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();
@@ -4792,7 +4792,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;
}
}
@@ -4804,7 +4804,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();
@@ -4841,10 +4841,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;
}
}
@@ -4870,11 +4870,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();
@@ -4892,7 +4892,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)
{
@@ -4935,7 +4935,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;
@@ -4961,7 +4961,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"));
@@ -5027,7 +5027,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
@@ -5330,7 +5330,7 @@ void LLPickInfo::getSurfaceInfo()
tangent.clear();
normal.clear();
intersection.clear();
-
+
LLViewerObject* objectp = getObject();
if (objectp)
@@ -5351,7 +5351,7 @@ void LLPickInfo::getSurfaceInfo()
if (facep)
{
mUVCoords = facep->surfaceToTexture(mSTCoords, intersection, normal);
- }
+ }
}
mIntersection.set(intersection.getF32ptr());