diff options
author | Tor Lillqvist <tml@collabora.com> | 2016-06-03 11:10:58 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2016-06-03 11:11:31 +0300 |
commit | 90dcb7d3269340542cfed82b4c0133451cc66829 (patch) | |
tree | 32fe7c8613767a37c3b66186228f92cb548eb011 /vcl/opengl/win | |
parent | 4aee1237a59808cbd58c9c02870063d5a7156710 (diff) |
Clean up Windows error reporting a bit
We have comphelper::WindowsErrorString(), so use it, in SAL_WARNs,
right where an error happens. Get rid of the fairly unhelpful
ImplWriteLastError() function.
Avoid duplicated error reporting.
Change-Id: I83374a65980b7c0ffa35fc493b4fb1f2e94f0dbb
Diffstat (limited to 'vcl/opengl/win')
-rw-r--r-- | vcl/opengl/win/gdiimpl.cxx | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/vcl/opengl/win/gdiimpl.cxx b/vcl/opengl/win/gdiimpl.cxx index 310eb14b6552..c20e755ab485 100644 --- a/vcl/opengl/win/gdiimpl.cxx +++ b/vcl/opengl/win/gdiimpl.cxx @@ -8,6 +8,8 @@ */ #include "opengl/win/gdiimpl.hxx" + +#include <comphelper/windowserrorstring.hxx> #include <desktop/exithelper.h> #include <opengl/zone.hxx> #include <o3tl/lru_map.hxx> @@ -94,7 +96,7 @@ void WinOpenGLContext::makeCurrent() if (!wglMakeCurrent(m_aGLWin.hDC, m_aGLWin.hRC)) { - SAL_WARN("vcl.opengl", "OpenGLContext::makeCurrent(): wglMakeCurrent failed: " << GetLastError()); + SAL_WARN("vcl.opengl", "wglMakeCurrent failed: " << WindowsErrorString(GetLastError())); return; } @@ -522,8 +524,7 @@ bool WinOpenGLContext::ImplInit() if (!SetPixelFormat(m_aGLWin.hDC, WindowPix, &PixelFormatFront)) { - ImplWriteLastError(GetLastError(), "SetPixelFormat in OpenGLContext::ImplInit"); - SAL_WARN("vcl.opengl", "SetPixelFormat failed"); + SAL_WARN("vcl.opengl", "SetPixelFormat failed: " << WindowsErrorString(GetLastError())); if (bFirstCall) disableOpenGLAndTerminateForRestart(); bFirstCall = false; @@ -533,8 +534,7 @@ bool WinOpenGLContext::ImplInit() HGLRC hTempRC = wglCreateContext(m_aGLWin.hDC); if (hTempRC == NULL) { - ImplWriteLastError(GetLastError(), "wglCreateContext in OpenGLContext::ImplInit"); - SAL_WARN("vcl.opengl", "wglCreateContext failed"); + SAL_WARN("vcl.opengl", "wglCreateContext failed: "<< WindowsErrorString(GetLastError())); if (bFirstCall) disableOpenGLAndTerminateForRestart(); bFirstCall = false; @@ -543,8 +543,7 @@ bool WinOpenGLContext::ImplInit() if (!wglMakeCurrent(m_aGLWin.hDC, hTempRC)) { - ImplWriteLastError(GetLastError(), "wglMakeCurrent in OpenGLContext::ImplInit"); - SAL_WARN("vcl.opengl", "wglMakeCurrent failed"); + SAL_WARN("vcl.opengl", "wglMakeCurrent failed: "<< WindowsErrorString(GetLastError())); if (bFirstCall) disableOpenGLAndTerminateForRestart(); bFirstCall = false; @@ -585,8 +584,7 @@ bool WinOpenGLContext::ImplInit() m_aGLWin.hRC = wglCreateContextAttribsARB(m_aGLWin.hDC, hSharedCtx, attribs); if (m_aGLWin.hRC == 0) { - ImplWriteLastError(GetLastError(), "wglCreateContextAttribsARB in OpenGLContext::ImplInit"); - SAL_WARN("vcl.opengl", "wglCreateContextAttribsARB failed"); + SAL_WARN("vcl.opengl", "wglCreateContextAttribsARB failed: "<< WindowsErrorString(GetLastError())); wglMakeCurrent(NULL, NULL); wglDeleteContext(hTempRC); if (bFirstCall) @@ -610,8 +608,7 @@ bool WinOpenGLContext::ImplInit() if (!wglMakeCurrent(m_aGLWin.hDC, m_aGLWin.hRC)) { - ImplWriteLastError(GetLastError(), "wglMakeCurrent (with shared context) in OpenGLContext::ImplInit"); - SAL_WARN("vcl.opengl", "wglMakeCurrent failed"); + SAL_WARN("vcl.opengl", "wglMakeCurrent failed: " << WindowsErrorString(GetLastError())); if (bFirstCall) disableOpenGLAndTerminateForRestart(); bFirstCall = false; |