diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2016-10-18 23:53:44 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2016-10-24 08:35:15 +0000 |
commit | 21e8ed8b5f032f63012a7ee84bce64fac218154f (patch) | |
tree | 7de6ad976673c2ed28bf801c383436e9cd6e8007 /desktop/source/app/opencl.cxx | |
parent | impl. missing function (diff) | |
download | core-21e8ed8b5f032f63012a7ee84bce64fac218154f.tar.gz core-21e8ed8b5f032f63012a7ee84bce64fac218154f.zip |
tdf#103395 opencl: don't initialize OpenCL when disabled
If SAL_DISABLE_OPENCL is set we don't want to do any kind of
OpenCL initialization. Put an extra guard in fillOpenCLInfo
(and similar methods in opencl package) to prevent that.
Put the check if OpenCL can be used into one place which checks
SAL_DISABLE_OPENCL and UseOpenCL in configuration.
Change-Id: Icc216d4299d3a7942843117ab9b9411de8075b11
Reviewed-on: https://gerrit.libreoffice.org/30025
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'desktop/source/app/opencl.cxx')
-rw-r--r-- | desktop/source/app/opencl.cxx | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/desktop/source/app/opencl.cxx b/desktop/source/app/opencl.cxx index 6d22e920535c..f436971b5d61 100644 --- a/desktop/source/app/opencl.cxx +++ b/desktop/source/app/opencl.cxx @@ -119,9 +119,7 @@ bool testOpenCLCompute(const Reference< XDesktop2 > &xDesktop, const OUString &r void Desktop::CheckOpenCLCompute(const Reference< XDesktop2 > &xDesktop) { - if (getenv("SAL_DISABLE_OPENCL") || - Application::IsSafeModeEnabled() || - !officecfg::Office::Common::Misc::UseOpenCL::get()) + if (!opencl::canUseOpenCL() || Application::IsSafeModeEnabled()) return; SAL_INFO("opencl", "Initiating test of OpenCL device"); |