summaryrefslogtreecommitdiff
path: root/vcl/source/opengl
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2017-09-28 12:40:42 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2017-09-29 14:55:11 +0200
commit0dd2e602e5c1b46e82abc6051677aeaab1d265b8 (patch)
tree7f7a1cbc9cb87c38c732d4691129bf81dc1d04ff /vcl/source/opengl
parent8b12c98ec7ec0b5ba20c28890ee63803fb9518d5 (diff)
Drop check for Windows versions we don't support
Since we dropped support of Vista and below in master toward 6.0, those checks are needless. Removing the code that only worked in older versions, and streamlining the resulting code. Also, use kernel32.dll version for Windows version, instead of deprecated GetVersionEx, and inconvenient VersionHelpers. Since both GetVersion(Ex) and VersionHelpers (based on VerifyVersionInfo) are subject to manifest-based behavior since Windows 8.1, this move will hopefully result in more reliable OS version detection. Change-Id: I3edd8fc1843e64b6a65bd3a126be6a085511f13c Reviewed-on: https://gerrit.libreoffice.org/42905 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'vcl/source/opengl')
-rw-r--r--vcl/source/opengl/OpenGLHelper.cxx44
1 files changed, 23 insertions, 21 deletions
diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
index f9443f708bd2..146d810b632d 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -197,6 +197,28 @@ namespace
return getHexString(pBuffer, RTL_DIGEST_LENGTH_MD5);
}
+ OString getDeviceInfoString()
+ {
+#if defined( SAL_UNX ) && !defined( MACOSX ) && !defined( IOS )&& !defined( ANDROID )
+ const X11OpenGLDeviceInfo aInfo;
+ return aInfo.GetOS() +
+ aInfo.GetOSRelease() +
+ aInfo.GetRenderer() +
+ aInfo.GetVendor() +
+ aInfo.GetVersion();
+#elif defined( _WIN32 )
+ const WinOpenGLDeviceInfo aInfo;
+ return OUStringToOString(aInfo.GetAdapterVendorID(), RTL_TEXTENCODING_UTF8) +
+ OUStringToOString(aInfo.GetAdapterDeviceID(), RTL_TEXTENCODING_UTF8) +
+ OUStringToOString(aInfo.GetDriverVersion(), RTL_TEXTENCODING_UTF8) +
+ OString::number(aInfo.GetWindowsVersion());
+#else
+ return OString(reinterpret_cast<const char*>(glGetString(GL_VENDOR))) +
+ OString(reinterpret_cast<const char*>(glGetString(GL_RENDERER))) +
+ OString(reinterpret_cast<const char*>(glGetString(GL_VERSION)));
+#endif
+ }
+
OString getStringDigest( const OUString& rVertexShaderName,
const OUString& rFragmentShaderName,
const OString& rPreamble )
@@ -206,27 +228,7 @@ namespace
OString aFragmentShaderSource = getShaderSource( rFragmentShaderName );
// get info about the graphic device
-#if defined( SAL_UNX ) && !defined( MACOSX ) && !defined( IOS )&& !defined( ANDROID )
- static const X11OpenGLDeviceInfo aInfo;
- static const OString aDeviceInfo (
- aInfo.GetOS() +
- aInfo.GetOSRelease() +
- aInfo.GetRenderer() +
- aInfo.GetVendor() +
- aInfo.GetVersion() );
-#elif defined( _WIN32 )
- static const WinOpenGLDeviceInfo aInfo;
- static const OString aDeviceInfo (
- OUStringToOString( aInfo.GetAdapterVendorID(), RTL_TEXTENCODING_UTF8 ) +
- OUStringToOString( aInfo.GetAdapterDeviceID(), RTL_TEXTENCODING_UTF8 ) +
- OUStringToOString( aInfo.GetDriverVersion(), RTL_TEXTENCODING_UTF8 ) +
- OString::number( aInfo.GetWindowsVersion() ) );
-#else
- static const OString aDeviceInfo (
- OString( reinterpret_cast<const char*>(glGetString(GL_VENDOR)) ) +
- OString( reinterpret_cast<const char*>(glGetString(GL_RENDERER)) ) +
- OString( reinterpret_cast<const char*>(glGetString(GL_VERSION)) ) );
-#endif
+ static const OString aDeviceInfo (getDeviceInfoString());
OString aMessage;
aMessage += rPreamble;