1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #ifndef INCLUDED_VCL_INC_OPENGL_ZONE_H
11 #define INCLUDED_VCL_INC_OPENGL_ZONE_H
13 #include <sal/config.h>
14 #include <sal/types.h>
15 #include <vcl/dllapi.h>
18 class OpenGLWatchdogThread
;
21 * We want to be able to detect if a given crash came
22 * from the OpenGL code, so use this helper to track that.
25 friend class OpenGLZoneTest
;
26 friend class OpenGLWatchdogThread
;
27 friend class OpenGLSalGraphicsImpl
;
29 /// how many times have we entered a GL zone
30 static volatile sal_uInt64 gnEnterCount
;
31 /// how many times have we left a new GL zone
32 static volatile sal_uInt64 gnLeaveCount
;
34 static VCL_DLLPUBLIC
void enter();
35 static VCL_DLLPUBLIC
void leave();
37 OpenGLZone() { gnEnterCount
++; }
38 ~OpenGLZone() { gnLeaveCount
++; }
39 static bool isInZone() { return gnEnterCount
!= gnLeaveCount
; }
40 static void hardDisable();
43 #endif // INCLUDED_VCL_INC_OPENGL_ZONE_H
45 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */