[Libreoffice-commits] core.git: vcl/inc vcl/workben

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Tue Sep 17 13:06:52 UTC 2019


 vcl/inc/opengl/zone.hxx |    2 --
 vcl/workben/vcldemo.cxx |   21 +++++++++------------
 2 files changed, 9 insertions(+), 14 deletions(-)

New commits:
commit 5c386a41c3cf416ed878f5ea6ece8f15990bd613
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Sep 17 13:35:34 2019 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Tue Sep 17 15:05:37 2019 +0200

    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 at redhat.com>

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)


More information about the Libreoffice-commits mailing list