diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-09-17 13:35:34 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-09-17 15:05:37 +0200 |
commit | 5c386a41c3cf416ed878f5ea6ece8f15990bd613 (patch) | |
tree | 938fb2257259a46ebf2e7a807e69366f7a25926e | |
parent | caa211b62048ac5037b3fd4320f3eb4dea7b639d (diff) |
No need for explicit OpenGLZone::enter/leave calls from vcldemo
(though I have no idea how to actually test the affected code)
Change-Id: Ib74d966d021e337bfab94c223812cb51c02c705f
Reviewed-on: https://gerrit.libreoffice.org/79059
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | vcl/inc/opengl/zone.hxx | 2 | ||||
-rw-r--r-- | vcl/workben/vcldemo.cxx | 21 |
2 files changed, 9 insertions, 14 deletions
diff --git a/vcl/inc/opengl/zone.hxx b/vcl/inc/opengl/zone.hxx index 50fd04598193..8aeabcf8b40f 100644 --- a/vcl/inc/opengl/zone.hxx +++ b/vcl/inc/opengl/zone.hxx @@ -14,7 +14,6 @@ #include <sal/types.h> #include <vcl/dllapi.h> -class OpenGLZoneTest; class OpenGLWatchdogThread; /** @@ -22,7 +21,6 @@ class OpenGLWatchdogThread; * from the OpenGL code, so use this helper to track that. */ class VCL_DLLPUBLIC OpenGLZone { - friend class OpenGLZoneTest; friend class OpenGLWatchdogThread; friend class OpenGLSalGraphicsImpl; diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index 20e30811f9e2..833108467728 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -7,6 +7,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <sal/config.h> + +#include <memory> + #include <config_features.h> #include <math.h> @@ -2019,12 +2023,6 @@ public: } }; -class OpenGLZoneTest { -public: - static void enter() { OpenGLZone::enter(); } - static void leave() { OpenGLZone::leave(); } -}; - IMPL_LINK_NOARG(DemoWidgets, GLTestClick, Button*, void) { sal_Int32 nSelected = mpGLCombo->GetSelectedEntryPos(); @@ -2045,14 +2043,13 @@ IMPL_LINK_NOARG(DemoWidgets, GLTestClick, Button*, void) break; } - bool bEnterLeave = mpGLCheck->IsChecked(); - if (bEnterLeave) - OpenGLZoneTest::enter(); + // Only create OpenGLZone RAII object if asked for: + std::unique_ptr<OpenGLZone> zone; + if (mpGLCheck->IsChecked()) { + zone.reset(new OpenGLZone); + } osl::Thread::wait(std::chrono::seconds(nDelaySeconds)); - - if (bEnterLeave) - OpenGLZoneTest::leave(); } IMPL_LINK(DemoWidgets, CursorButtonClick, Button*, pButton, void) |