summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowwin32.cpp
diff options
context:
space:
mode:
authorsimon <none@none>2014-05-07 13:19:05 -0700
committersimon <none@none>2014-05-07 13:19:05 -0700
commitdc4c184696b308b8f60fa1dd751b35e22bd47d62 (patch)
tree1606d992f1cce6fe19572042c456725eb95d7066 /indra/llwindow/llwindowwin32.cpp
parent883467a3cc421fca68a25589114e0e3f0538ff0e (diff)
parent250db74bf9325acdc1169f6c13d297e7fe44b753 (diff)
Merge downstream version 3.7.8 code
Diffstat (limited to 'indra/llwindow/llwindowwin32.cpp')
-rwxr-xr-xindra/llwindow/llwindowwin32.cpp115
1 files changed, 58 insertions, 57 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 5106da09b2..7b34fa09e8 100755
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -38,6 +38,7 @@
// Linden library includes
#include "llerror.h"
+#include "llfasttimer.h"
#include "llgl.h"
#include "llstring.h"
#include "lldir.h"
@@ -214,7 +215,7 @@ LLWinImm::LLWinImm() : mHImmDll(NULL)
// the case, since it is very unusual; these APIs are available from
// the beginning, and all versions of IMM32.DLL should have them all.
// Unfortunately, this code may be executed before initialization of
- // the logging channel (llwarns), and we can't do it here... Yes, this
+ // the logging channel (LL_WARNS()), and we can't do it here... Yes, this
// is one of disadvantages to use static constraction to DLL loading.
FreeLibrary(mHImmDll);
mHImmDll = NULL;
@@ -1068,7 +1069,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
mhInstance,
NULL);
- LL_INFOS("Window") << "window is created." << llendl ;
+ LL_INFOS("Window") << "window is created." << LL_ENDL ;
//-----------------------------------------------------------------------
// Create GL drawing context
@@ -1101,7 +1102,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
return FALSE;
}
- LL_INFOS("Window") << "Device context retrieved." << llendl ;
+ LL_INFOS("Window") << "Device context retrieved." << LL_ENDL ;
if (!(pixel_format = ChoosePixelFormat(mhDC, &pfd)))
{
@@ -1111,7 +1112,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
return FALSE;
}
- LL_INFOS("Window") << "Pixel format chosen." << llendl ;
+ LL_INFOS("Window") << "Pixel format chosen." << LL_ENDL ;
// Verify what pixel format we actually received.
if (!DescribePixelFormat(mhDC, pixel_format, sizeof(PIXELFORMATDESCRIPTOR),
@@ -1124,35 +1125,35 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
}
// (EXP-1765) dump pixel data to see if there is a pattern that leads to unreproducible crash
- LL_INFOS("Window") << "--- begin pixel format dump ---" << llendl ;
- LL_INFOS("Window") << "pixel_format is " << pixel_format << llendl ;
- LL_INFOS("Window") << "pfd.nSize: " << pfd.nSize << llendl ;
- LL_INFOS("Window") << "pfd.nVersion: " << pfd.nVersion << llendl ;
- LL_INFOS("Window") << "pfd.dwFlags: 0x" << std::hex << pfd.dwFlags << std::dec << llendl ;
- LL_INFOS("Window") << "pfd.iPixelType: " << (int)pfd.iPixelType << llendl ;
- LL_INFOS("Window") << "pfd.cColorBits: " << (int)pfd.cColorBits << llendl ;
- LL_INFOS("Window") << "pfd.cRedBits: " << (int)pfd.cRedBits << llendl ;
- LL_INFOS("Window") << "pfd.cRedShift: " << (int)pfd.cRedShift << llendl ;
- LL_INFOS("Window") << "pfd.cGreenBits: " << (int)pfd.cGreenBits << llendl ;
- LL_INFOS("Window") << "pfd.cGreenShift: " << (int)pfd.cGreenShift << llendl ;
- LL_INFOS("Window") << "pfd.cBlueBits: " << (int)pfd.cBlueBits << llendl ;
- LL_INFOS("Window") << "pfd.cBlueShift: " << (int)pfd.cBlueShift << llendl ;
- LL_INFOS("Window") << "pfd.cAlphaBits: " << (int)pfd.cAlphaBits << llendl ;
- LL_INFOS("Window") << "pfd.cAlphaShift: " << (int)pfd.cAlphaShift << llendl ;
- LL_INFOS("Window") << "pfd.cAccumBits: " << (int)pfd.cAccumBits << llendl ;
- LL_INFOS("Window") << "pfd.cAccumRedBits: " << (int)pfd.cAccumRedBits << llendl ;
- LL_INFOS("Window") << "pfd.cAccumGreenBits: " << (int)pfd.cAccumGreenBits << llendl ;
- LL_INFOS("Window") << "pfd.cAccumBlueBits: " << (int)pfd.cAccumBlueBits << llendl ;
- LL_INFOS("Window") << "pfd.cAccumAlphaBits: " << (int)pfd.cAccumAlphaBits << llendl ;
- LL_INFOS("Window") << "pfd.cDepthBits: " << (int)pfd.cDepthBits << llendl ;
- LL_INFOS("Window") << "pfd.cStencilBits: " << (int)pfd.cStencilBits << llendl ;
- LL_INFOS("Window") << "pfd.cAuxBuffers: " << (int)pfd.cAuxBuffers << llendl ;
- LL_INFOS("Window") << "pfd.iLayerType: " << (int)pfd.iLayerType << llendl ;
- LL_INFOS("Window") << "pfd.bReserved: " << (int)pfd.bReserved << llendl ;
- LL_INFOS("Window") << "pfd.dwLayerMask: " << pfd.dwLayerMask << llendl ;
- LL_INFOS("Window") << "pfd.dwVisibleMask: " << pfd.dwVisibleMask << llendl ;
- LL_INFOS("Window") << "pfd.dwDamageMask: " << pfd.dwDamageMask << llendl ;
- LL_INFOS("Window") << "--- end pixel format dump ---" << llendl ;
+ LL_INFOS("Window") << "--- begin pixel format dump ---" << LL_ENDL ;
+ LL_INFOS("Window") << "pixel_format is " << pixel_format << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.nSize: " << pfd.nSize << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.nVersion: " << pfd.nVersion << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.dwFlags: 0x" << std::hex << pfd.dwFlags << std::dec << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.iPixelType: " << (int)pfd.iPixelType << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cColorBits: " << (int)pfd.cColorBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cRedBits: " << (int)pfd.cRedBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cRedShift: " << (int)pfd.cRedShift << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cGreenBits: " << (int)pfd.cGreenBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cGreenShift: " << (int)pfd.cGreenShift << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cBlueBits: " << (int)pfd.cBlueBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cBlueShift: " << (int)pfd.cBlueShift << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cAlphaBits: " << (int)pfd.cAlphaBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cAlphaShift: " << (int)pfd.cAlphaShift << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cAccumBits: " << (int)pfd.cAccumBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cAccumRedBits: " << (int)pfd.cAccumRedBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cAccumGreenBits: " << (int)pfd.cAccumGreenBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cAccumBlueBits: " << (int)pfd.cAccumBlueBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cAccumAlphaBits: " << (int)pfd.cAccumAlphaBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cDepthBits: " << (int)pfd.cDepthBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cStencilBits: " << (int)pfd.cStencilBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cAuxBuffers: " << (int)pfd.cAuxBuffers << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.iLayerType: " << (int)pfd.iLayerType << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.bReserved: " << (int)pfd.bReserved << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.dwLayerMask: " << pfd.dwLayerMask << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.dwVisibleMask: " << pfd.dwVisibleMask << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.dwDamageMask: " << pfd.dwDamageMask << LL_ENDL ;
+ LL_INFOS("Window") << "--- end pixel format dump ---" << LL_ENDL ;
if (pfd.cColorBits < 32)
{
@@ -1195,7 +1196,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
return FALSE;
}
- LL_INFOS("Window") << "Drawing context is created." << llendl ;
+ LL_INFOS("Window") << "Drawing context is created." << LL_ENDL ;
gGLManager.initWGL();
@@ -1252,7 +1253,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
while(!result && mFSAASamples > 0)
{
- llwarns << "FSAASamples: " << mFSAASamples << " not supported." << llendl ;
+ LL_WARNS() << "FSAASamples: " << mFSAASamples << " not supported." << LL_ENDL ;
mFSAASamples /= 2 ; //try to decrease sample pixel number until to disable anti-aliasing
if(mFSAASamples < 2)
@@ -1274,13 +1275,13 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
if(result)
{
- llwarns << "Only support FSAASamples: " << mFSAASamples << llendl ;
+ LL_WARNS() << "Only support FSAASamples: " << mFSAASamples << LL_ENDL ;
}
}
if (!result)
{
- llwarns << "mFSAASamples: " << mFSAASamples << llendl ;
+ LL_WARNS() << "mFSAASamples: " << mFSAASamples << LL_ENDL ;
close();
show_window_creation_error("Error after wglChoosePixelFormatARB 32-bit");
@@ -1333,7 +1334,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
LL_INFOS("Window") << "Choosing pixel formats: " << num_formats << " pixel formats returned" << LL_ENDL;
}
- LL_INFOS("Window") << "pixel formats done." << llendl ;
+ LL_INFOS("Window") << "pixel formats done." << LL_ENDL ;
S32 swap_method = 0;
S32 cur_format = num_formats-1;
@@ -1383,7 +1384,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
mhInstance,
NULL);
- LL_INFOS("Window") << "recreate window done." << llendl ;
+ LL_INFOS("Window") << "recreate window done." << LL_ENDL ;
if (!(mhDC = GetDC(mWindowHandle)))
{
@@ -1492,8 +1493,8 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
}
else
{
- llinfos << "Created OpenGL " << llformat("%d.%d", attribs[1], attribs[3]) <<
- (LLRender::sGLCoreProfile ? " core" : " compatibility") << " context." << llendl;
+ LL_INFOS() << "Created OpenGL " << llformat("%d.%d", attribs[1], attribs[3]) <<
+ (LLRender::sGLCoreProfile ? " core" : " compatibility") << " context." << LL_ENDL;
done = true;
if (LLRender::sGLCoreProfile)
@@ -1835,8 +1836,8 @@ void LLWindowWin32::gatherInput()
mMousePositionModified = FALSE;
}
-static LLFastTimer::DeclareTimer FTM_KEYHANDLER("Handle Keyboard");
-static LLFastTimer::DeclareTimer FTM_MOUSEHANDLER("Handle Mouse");
+static LLTrace::BlockTimerStatHandle FTM_KEYHANDLER("Handle Keyboard");
+static LLTrace::BlockTimerStatHandle FTM_MOUSEHANDLER("Handle Mouse");
LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_param, LPARAM l_param)
{
@@ -1894,8 +1895,8 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_DEVICECHANGE");
if (gDebugWindowProc)
{
- llinfos << " WM_DEVICECHANGE: wParam=" << w_param
- << "; lParam=" << l_param << llendl;
+ LL_INFOS() << " WM_DEVICECHANGE: wParam=" << w_param
+ << "; lParam=" << l_param << LL_ENDL;
}
if (w_param == DBT_DEVNODES_CHANGED || w_param == DBT_DEVICEARRIVAL)
{
@@ -2091,7 +2092,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
window_imp->mKeyVirtualKey = w_param;
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_KEYUP");
- LLFastTimer t2(FTM_KEYHANDLER);
+ LL_RECORD_BLOCK_TIME(FTM_KEYHANDLER);
if (gDebugWindowProc)
{
@@ -2111,7 +2112,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_IME_SETCONTEXT");
if (gDebugWindowProc)
{
- llinfos << "WM_IME_SETCONTEXT" << llendl;
+ LL_INFOS() << "WM_IME_SETCONTEXT" << LL_ENDL;
}
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
@@ -2124,7 +2125,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_IME_STARTCOMPOSITION");
if (gDebugWindowProc)
{
- llinfos << "WM_IME_STARTCOMPOSITION" << llendl;
+ LL_INFOS() << "WM_IME_STARTCOMPOSITION" << LL_ENDL;
}
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
@@ -2137,7 +2138,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_IME_ENDCOMPOSITION");
if (gDebugWindowProc)
{
- llinfos << "WM_IME_ENDCOMPOSITION" << llendl;
+ LL_INFOS() << "WM_IME_ENDCOMPOSITION" << LL_ENDL;
}
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
@@ -2149,7 +2150,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_IME_COMPOSITION");
if (gDebugWindowProc)
{
- llinfos << "WM_IME_COMPOSITION" << llendl;
+ LL_INFOS() << "WM_IME_COMPOSITION" << LL_ENDL;
}
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
@@ -2162,7 +2163,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_IME_REQUEST");
if (gDebugWindowProc)
{
- llinfos << "WM_IME_REQUEST" << llendl;
+ LL_INFOS() << "WM_IME_REQUEST" << LL_ENDL;
}
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
@@ -2211,7 +2212,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
case WM_LBUTTONDOWN:
{
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_LBUTTONDOWN");
- LLFastTimer t2(FTM_MOUSEHANDLER);
+ LL_RECORD_BLOCK_TIME(FTM_MOUSEHANDLER);
sHandleLeftMouseUp = true;
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
@@ -2284,7 +2285,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
case WM_LBUTTONUP:
{
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_LBUTTONUP");
- LLFastTimer t2(FTM_MOUSEHANDLER);
+ LL_RECORD_BLOCK_TIME(FTM_MOUSEHANDLER);
if (!sHandleLeftMouseUp)
{
@@ -2325,7 +2326,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
case WM_RBUTTONDOWN:
{
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_RBUTTONDOWN");
- LLFastTimer t2(FTM_MOUSEHANDLER);
+ LL_RECORD_BLOCK_TIME(FTM_MOUSEHANDLER);
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
window_imp->interruptLanguageTextInput();
@@ -2359,7 +2360,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
case WM_RBUTTONUP:
{
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_RBUTTONUP");
- LLFastTimer t2(FTM_MOUSEHANDLER);
+ LL_RECORD_BLOCK_TIME(FTM_MOUSEHANDLER);
// Because we move the cursor position in the app, we need to query
// to find out where the cursor at the time the event is handled.
// If we don't do this, many clicks could get buffered up, and if the
@@ -2389,7 +2390,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
// case WM_MBUTTONDBLCLK:
{
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_MBUTTONDOWN");
- LLFastTimer t2(FTM_MOUSEHANDLER);
+ LL_RECORD_BLOCK_TIME(FTM_MOUSEHANDLER);
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
window_imp->interruptLanguageTextInput();
@@ -2423,7 +2424,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
case WM_MBUTTONUP:
{
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_MBUTTONUP");
- LLFastTimer t2(FTM_MOUSEHANDLER);
+ LL_RECORD_BLOCK_TIME(FTM_MOUSEHANDLER);
// Because we move the cursor position in the llviewer app, we need to query
// to find out where the cursor at the time the event is handled.
// If we don't do this, many clicks could get buffered up, and if the