diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-14 16:10:40 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-14 20:46:19 +0200 |
commit | bc66bf4608557d757555aef1f46abf8a15c3538b (patch) | |
tree | 92d1f64c49ad464c26cb33b0044fdf54efa7cdf5 /desktop/source/app/opencl.cxx | |
parent | d72f963c0de0c2e48f1dc999cd8687e13a1f676f (diff) |
loplugin:flatten in desktop
Change-Id: I1ab39e041025692cac06eb6602787f16a3a9cb0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92198
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop/source/app/opencl.cxx')
-rw-r--r-- | desktop/source/app/opencl.cxx | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/desktop/source/app/opencl.cxx b/desktop/source/app/opencl.cxx index a1fe3c0f6aea..0ea322e02565 100644 --- a/desktop/source/app/opencl.cxx +++ b/desktop/source/app/opencl.cxx @@ -223,32 +223,32 @@ void Desktop::CheckOpenCLCompute(const Reference< XDesktop2 > &xDesktop) aSelectedCLDeviceVersionID += "--" + OUString::number(aTimeVal.Seconds); - if (aSelectedCLDeviceVersionID != officecfg::Office::Common::Misc::SelectedOpenCLDeviceIdentifier::get()) - { - // OpenCL device changed - sanity check it and disable if bad. + if (aSelectedCLDeviceVersionID == officecfg::Office::Common::Misc::SelectedOpenCLDeviceIdentifier::get()) + return; - sal_Int32 nOrigMinimumSize = officecfg::Office::Calc::Formula::Calculation::OpenCLMinimumDataSize::get(); - { // set the minimum group size to something small for quick testing. - std::shared_ptr<comphelper::ConfigurationChanges> xBatch(comphelper::ConfigurationChanges::create()); - officecfg::Office::Calc::Formula::Calculation::OpenCLMinimumDataSize::set(3 /* small */, xBatch); - xBatch->commit(); - } + // OpenCL device changed - sanity check it and disable if bad. - // Hopefully at least basic functionality always works and broken OpenCL implementations break - // only when they are used to compute something. If this assumptions turns out to be not true, - // the driver check needs to be moved sooner. - bool bSucceeded = testOpenCLDriver() && testOpenCLCompute(xDesktop, aURL); + sal_Int32 nOrigMinimumSize = officecfg::Office::Calc::Formula::Calculation::OpenCLMinimumDataSize::get(); + { // set the minimum group size to something small for quick testing. + std::shared_ptr<comphelper::ConfigurationChanges> xBatch(comphelper::ConfigurationChanges::create()); + officecfg::Office::Calc::Formula::Calculation::OpenCLMinimumDataSize::set(3 /* small */, xBatch); + xBatch->commit(); + } - { // restore the minimum group size - std::shared_ptr<comphelper::ConfigurationChanges> xBatch(comphelper::ConfigurationChanges::create()); - officecfg::Office::Calc::Formula::Calculation::OpenCLMinimumDataSize::set(nOrigMinimumSize, xBatch); - officecfg::Office::Common::Misc::SelectedOpenCLDeviceIdentifier::set(aSelectedCLDeviceVersionID, xBatch); - xBatch->commit(); - } + // Hopefully at least basic functionality always works and broken OpenCL implementations break + // only when they are used to compute something. If this assumptions turns out to be not true, + // the driver check needs to be moved sooner. + bool bSucceeded = testOpenCLDriver() && testOpenCLCompute(xDesktop, aURL); - if (!bSucceeded) - OpenCLZone::hardDisable(); + { // restore the minimum group size + std::shared_ptr<comphelper::ConfigurationChanges> xBatch(comphelper::ConfigurationChanges::create()); + officecfg::Office::Calc::Formula::Calculation::OpenCLMinimumDataSize::set(nOrigMinimumSize, xBatch); + officecfg::Office::Common::Misc::SelectedOpenCLDeviceIdentifier::set(aSelectedCLDeviceVersionID, xBatch); + xBatch->commit(); } + + if (!bSucceeded) + OpenCLZone::hardDisable(); } #endif // HAVE_FEATURE_OPENCL |