summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-11-27 13:16:17 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2015-11-28 11:47:36 +0000
commit47eaebc3b4234b7bcfa790fc2eb584044f1ed8f4 (patch)
treef77896e28198273f47317c092c5dfa3c574d439b /vcl
parent700f080fd9d85c6f1b3a54ecbd813e42b79591c0 (diff)
Revert "Revert "write a log file about OpenGL driver""
This reverts commit 2ebca292f96494a13a0d0baa8b19dd9010616abe. The build breakage in gengal was caused by the global variable aCacheFolder, which is initialized by a call to rtl::Bootstrap::expandMacros(), which initializes the global FundamentalIni object before tools::extendApplicationEnvironment() gets a chance to set URE_BOOTSTRAP, so FundamentalIni is empty. Change-Id: I10d8652dab15ee6924ff4ceff17000963975e30f Reviewed-on: https://gerrit.libreoffice.org/20232 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/opengl/win/WinDeviceInfo.cxx36
1 files changed, 36 insertions, 0 deletions
diff --git a/vcl/opengl/win/WinDeviceInfo.cxx b/vcl/opengl/win/WinDeviceInfo.cxx
index 6bed2c09f550..fe3297c25cfa 100644
--- a/vcl/opengl/win/WinDeviceInfo.cxx
+++ b/vcl/opengl/win/WinDeviceInfo.cxx
@@ -532,6 +532,28 @@ bool WinOpenGLDeviceInfo::FindBlocklistedDeviceInList()
return match;
}
+namespace {
+
+OUString getCacheFolder()
+{
+ OUString url("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/cache/");
+ rtl::Bootstrap::expandMacros(url);
+
+ osl::Directory::create(url);
+
+ return url;
+}
+
+void writeToLog(SvStream& rStrm, const char* pKey, const OUString rVal)
+{
+ rStrm.WriteCharPtr(pKey);
+ rStrm.WriteCharPtr(": ");
+ rStrm.WriteOString(OUStringToOString(rVal, RTL_TEXTENCODING_UTF8));
+ rStrm.WriteChar('\n');
+}
+
+}
+
bool WinOpenGLDeviceInfo::isDeviceBlocked()
{
SAL_INFO("vcl.opengl", maDriverVersion);
@@ -543,6 +565,20 @@ bool WinOpenGLDeviceInfo::isDeviceBlocked()
SAL_INFO("vcl.opengl", maDeviceKey);
SAL_INFO("vcl.opengl", maDeviceString);
+ OUString aCacheFolder = getCacheFolder();
+
+ OUString aCacheFile(aCacheFolder + "/opengl_device.log");
+ SvFileStream aOpenGLLogFile(aCacheFile, StreamMode::WRITE);
+
+ writeToLog(aOpenGLLogFile, "DriverVersion", maDriverVersion);
+ writeToLog(aOpenGLLogFile, "DriverDate", maDriverDate);
+ writeToLog(aOpenGLLogFile, "DeviceID", maDeviceID);
+ writeToLog(aOpenGLLogFile, "AdapterVendorID", maAdapterVendorID);
+ writeToLog(aOpenGLLogFile, "AdapterDeviceID", maAdapterDeviceID);
+ writeToLog(aOpenGLLogFile, "AdapterSubsysID", maAdapterSubsysID);
+ writeToLog(aOpenGLLogFile, "DeviceKey", maDeviceKey);
+ writeToLog(aOpenGLLogFile, "DeviceString", maDeviceString);
+
// Check if the device is blocked from the downloaded blocklist. If not, check
// the static list after that. This order is used so that we can later escape
// out of static blocks (i.e. if we were wrong or something was patched, we