OpenCoverage

qglxconvenience.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/platformsupport/glxconvenience/qglxconvenience.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the plugins of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40// We have to include this before the X11 headers dragged in by-
41// qglxconvenience_p.h.-
42#include <QtCore/QByteArray>-
43#include <QtCore/QScopedPointer>-
44-
45#include "qglxconvenience_p.h"-
46-
47#include <QtCore/QVector>-
48#include <QtCore/QVarLengthArray>-
49-
50#ifndef QT_NO_XRENDER-
51#include <X11/extensions/Xrender.h>-
52#endif-
53-
54#include <GL/glxext.h>-
55-
56enum {-
57 XFocusOut = FocusOut,-
58 XFocusIn = FocusIn,-
59 XKeyPress = KeyPress,-
60 XKeyRelease = KeyRelease,-
61 XNone = None,-
62 XRevertToParent = RevertToParent,-
63 XGrayScale = GrayScale,-
64 XCursorShape = CursorShape-
65};-
66#undef FocusOut-
67#undef FocusIn-
68#undef KeyPress-
69#undef KeyRelease-
70#undef None-
71#undef RevertToParent-
72#undef GrayScale-
73#undef CursorShape-
74-
75#ifdef FontChange-
76#undef FontChange-
77#endif-
78-
79QVector<int> qglx_buildSpec(const QSurfaceFormat &format, int drawableBit)-
80{-
81 QVector<int> spec;-
82-
83 spec << GLX_LEVEL-
84 << 0-
85-
86 << GLX_RENDER_TYPE-
87 << GLX_RGBA_BIT-
88-
89 << GLX_RED_SIZE-
90 << qMax(1, format.redBufferSize())-
91-
92 << GLX_GREEN_SIZE-
93 << qMax(1, format.greenBufferSize())-
94-
95 << GLX_BLUE_SIZE-
96 << qMax(1, format.blueBufferSize())-
97-
98 << GLX_ALPHA_SIZE-
99 << qMax(0, format.alphaBufferSize());-
100-
101 if (format.swapBehavior() != QSurfaceFormat::SingleBuffer)
format.swapBeh...::SingleBufferDescription
TRUEevaluated 4057 times by 120 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
FALSEnever evaluated
0-4057
102 spec << GLX_DOUBLEBUFFER
executed 4057 times by 120 tests: spec << 5 << 1;
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
4057
103 << True;
executed 4057 times by 120 tests: spec << 5 << 1;
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
4057
104-
105 if (format.stereo())
format.stereo()Description
TRUEnever evaluated
FALSEevaluated 4057 times by 120 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
0-4057
106 spec << GLX_STEREO
never executed: spec << 6 << 1;
0
107 << True;
never executed: spec << 6 << 1;
0
108-
109 if (format.depthBufferSize() != -1)
format.depthBufferSize() != -1Description
TRUEevaluated 64 times by 7 tests
Evaluated by:
  • tst_QGLBuffer
  • tst_QGLFunctions
  • tst_QGraphicsView
  • tst_QMdiArea
  • tst_QOpenGLWidget
  • tst_QOpenGLWindow
  • tst_QOpenGlConfig
FALSEevaluated 3993 times by 118 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
64-3993
110 spec << GLX_DEPTH_SIZE
executed 64 times by 7 tests: spec << 12 << format.depthBufferSize();
Executed by:
  • tst_QGLBuffer
  • tst_QGLFunctions
  • tst_QGraphicsView
  • tst_QMdiArea
  • tst_QOpenGLWidget
  • tst_QOpenGLWindow
  • tst_QOpenGlConfig
64
111 << format.depthBufferSize();
executed 64 times by 7 tests: spec << 12 << format.depthBufferSize();
Executed by:
  • tst_QGLBuffer
  • tst_QGLFunctions
  • tst_QGraphicsView
  • tst_QMdiArea
  • tst_QOpenGLWidget
  • tst_QOpenGLWindow
  • tst_QOpenGlConfig
64
112-
113 if (format.stencilBufferSize() != -1)
format.stencil...erSize() != -1Description
TRUEevaluated 64 times by 7 tests
Evaluated by:
  • tst_QGLBuffer
  • tst_QGLFunctions
  • tst_QGraphicsView
  • tst_QMdiArea
  • tst_QOpenGLWidget
  • tst_QOpenGLWindow
  • tst_QOpenGlConfig
FALSEevaluated 3993 times by 118 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
64-3993
114 spec << GLX_STENCIL_SIZE
executed 64 times by 7 tests: spec << 13 << format.stencilBufferSize();
Executed by:
  • tst_QGLBuffer
  • tst_QGLFunctions
  • tst_QGraphicsView
  • tst_QMdiArea
  • tst_QOpenGLWidget
  • tst_QOpenGLWindow
  • tst_QOpenGlConfig
64
115 << format.stencilBufferSize();
executed 64 times by 7 tests: spec << 13 << format.stencilBufferSize();
Executed by:
  • tst_QGLBuffer
  • tst_QGLFunctions
  • tst_QGraphicsView
  • tst_QMdiArea
  • tst_QOpenGLWidget
  • tst_QOpenGLWindow
  • tst_QOpenGlConfig
64
116-
117 if (format.samples() > 1)
format.samples() > 1Description
TRUEnever evaluated
FALSEevaluated 4057 times by 120 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
0-4057
118 spec << GLX_SAMPLE_BUFFERS_ARB
never executed: spec << 100000 << 1 << 100001 << format.samples();
0
119 << 1
never executed: spec << 100000 << 1 << 100001 << format.samples();
0
120 << GLX_SAMPLES_ARB
never executed: spec << 100000 << 1 << 100001 << format.samples();
0
121 << format.samples();
never executed: spec << 100000 << 1 << 100001 << format.samples();
0
122-
123 spec << GLX_DRAWABLE_TYPE-
124 << drawableBit-
125-
126 << XNone;-
127-
128 return spec;
executed 4057 times by 120 tests: return spec;
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
4057
129}-
130-
131namespace {-
132struct QXcbSoftwareOpenGLEnforcer {-
133 QXcbSoftwareOpenGLEnforcer() {-
134 // Allow forcing LIBGL_ALWAYS_SOFTWARE for Qt 5 applications only.-
135 // This is most useful with drivers that only support OpenGL 1.-
136 // We need OpenGL 2, but the user probably doesn't want-
137 // LIBGL_ALWAYS_SOFTWARE in OpenGL 1 apps.-
138-
139 if (!checkedForceSoftwareOpenGL) {
!checkedForceSoftwareOpenGLDescription
TRUEevaluated 124 times by 120 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
FALSEevaluated 3933 times by 105 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • ...
124-3933
140 // If LIBGL_ALWAYS_SOFTWARE is already set, don't mess with it.-
141 // We want to unset LIBGL_ALWAYS_SOFTWARE at the end so it does not-
142 // get inherited by other processes, of course only if it wasn't-
143 // already set before.-
144 if (!qEnvironmentVariableIsEmpty("QT_XCB_FORCE_SOFTWARE_OPENGL")
!qEnvironmentV...TWARE_OPENGL")Description
TRUEnever evaluated
FALSEevaluated 124 times by 120 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
0-124
145 && !qEnvironmentVariableIsSet("LIBGL_ALWAYS_SOFTWARE"))
!qEnvironmentV...AYS_SOFTWARE")Description
TRUEnever evaluated
FALSEnever evaluated
0
146 forceSoftwareOpenGL = true;
never executed: forceSoftwareOpenGL = true;
0
147-
148 checkedForceSoftwareOpenGL = true;-
149 }
executed 124 times by 120 tests: end of block
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
124
150-
151 if (forceSoftwareOpenGL)
forceSoftwareOpenGLDescription
TRUEnever evaluated
FALSEevaluated 4057 times by 120 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
0-4057
152 qputenv("LIBGL_ALWAYS_SOFTWARE", QByteArrayLiteral("1"));
never executed: qputenv("LIBGL_ALWAYS_SOFTWARE", ([]() -> QByteArray { enum { Size = sizeof("1") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "1" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()));
never executed: return ba;
0
153 }
executed 4057 times by 120 tests: end of block
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
4057
154-
155 ~QXcbSoftwareOpenGLEnforcer() {-
156 // unset LIBGL_ALWAYS_SOFTWARE now so other processes don't inherit it-
157 if (forceSoftwareOpenGL)
forceSoftwareOpenGLDescription
TRUEnever evaluated
FALSEevaluated 4057 times by 120 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
0-4057
158 qunsetenv("LIBGL_ALWAYS_SOFTWARE");
never executed: qunsetenv("LIBGL_ALWAYS_SOFTWARE");
0
159 }
executed 4057 times by 120 tests: end of block
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
4057
160-
161 static bool checkedForceSoftwareOpenGL;-
162 static bool forceSoftwareOpenGL;-
163};-
164-
165bool QXcbSoftwareOpenGLEnforcer::checkedForceSoftwareOpenGL = false;-
166bool QXcbSoftwareOpenGLEnforcer::forceSoftwareOpenGL = false;-
167-
168template <class T>-
169struct QXlibScopedPointerDeleter {-
170 static inline void cleanup(T *pointer) {-
171 XFree(pointer);-
172 }
executed 8166 times by 120 tests: end of block
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
8166
173};-
174-
175template <class T>-
176using QXlibPointer = QScopedPointer<T, QXlibScopedPointerDeleter<T>>;-
177-
178template <class T>-
179using QXlibArrayPointer = QScopedArrayPointer<T, QXlibScopedPointerDeleter<T>>;-
180}-
181-
182GLXFBConfig qglx_findConfig(Display *display, int screen , QSurfaceFormat format, bool highestPixelFormat, int drawableBit)-
183{-
184 QXcbSoftwareOpenGLEnforcer softwareOpenGLEnforcer;-
185-
186 GLXFBConfig config = 0;-
187-
188 do {-
189 const QVector<int> spec = qglx_buildSpec(format, drawableBit);-
190-
191 int confcount = 0;-
192 QXlibArrayPointer<GLXFBConfig> configs(glXChooseFBConfig(display, screen, spec.constData(), &confcount));-
193-
194 if (!config && confcount > 0) {
!configDescription
TRUEevaluated 4057 times by 120 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
FALSEnever evaluated
confcount > 0Description
TRUEevaluated 4057 times by 120 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
FALSEnever evaluated
0-4057
195 config = configs[0];-
196 if (highestPixelFormat && !format.hasAlpha())
highestPixelFormatDescription
TRUEnever evaluated
FALSEevaluated 4057 times by 120 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
!format.hasAlpha()Description
TRUEnever evaluated
FALSEnever evaluated
0-4057
197 break;
never executed: break;
0
198 }
executed 4057 times by 120 tests: end of block
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
4057
199-
200 const int requestedRed = qMax(0, format.redBufferSize());-
201 const int requestedGreen = qMax(0, format.greenBufferSize());-
202 const int requestedBlue = qMax(0, format.blueBufferSize());-
203 const int requestedAlpha = qMax(0, format.alphaBufferSize());-
204-
205 for (int i = 0; i < confcount; i++) {
i < confcountDescription
TRUEevaluated 4109 times by 120 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
FALSEnever evaluated
0-4109
206 GLXFBConfig candidate = configs[i];-
207-
208 QXlibPointer<XVisualInfo> visual(glXGetVisualFromFBConfig(display, candidate));-
209-
210 const int actualRed = qPopulationCount(visual->red_mask);-
211 const int actualGreen = qPopulationCount(visual->green_mask);-
212 const int actualBlue = qPopulationCount(visual->blue_mask);-
213 const int actualAlpha = visual->depth - actualRed - actualGreen - actualBlue;-
214-
215 if (requestedRed && actualRed != requestedRed)
requestedRedDescription
TRUEevaluated 4109 times by 120 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
FALSEnever evaluated
actualRed != requestedRedDescription
TRUEnever evaluated
FALSEevaluated 4109 times by 120 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
0-4109
216 continue;
never executed: continue;
0
217 if (requestedGreen && actualGreen != requestedGreen)
requestedGreenDescription
TRUEevaluated 4109 times by 120 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
FALSEnever evaluated
actualGreen != requestedGreenDescription
TRUEnever evaluated
FALSEevaluated 4109 times by 120 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
0-4109
218 continue;
never executed: continue;
0
219 if (requestedBlue && actualBlue != requestedBlue)
requestedBlueDescription
TRUEevaluated 4109 times by 120 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
FALSEnever evaluated
actualBlue != requestedBlueDescription
TRUEnever evaluated
FALSEevaluated 4109 times by 120 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
0-4109
220 continue;
never executed: continue;
0
221 if (requestedAlpha && actualAlpha != requestedAlpha)
requestedAlphaDescription
TRUEevaluated 56 times by 2 tests
Evaluated by:
  • tst_QSystemTrayIcon
  • tst_QWidget
FALSEevaluated 4053 times by 120 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
actualAlpha != requestedAlphaDescription
TRUEevaluated 52 times by 2 tests
Evaluated by:
  • tst_QSystemTrayIcon
  • tst_QWidget
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QSystemTrayIcon
  • tst_QWidget
4-4053
222 continue;
executed 52 times by 2 tests: continue;
Executed by:
  • tst_QSystemTrayIcon
  • tst_QWidget
52
223-
224 return candidate;
executed 4057 times by 120 tests: return candidate;
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
4057
225 }-
226 } while (qglx_reduceFormat(&format));
never executed: end of block
qglx_reduceFormat(&format)Description
TRUEnever evaluated
FALSEnever evaluated
0
227-
228 return config;
never executed: return config;
0
229}-
230-
231XVisualInfo *qglx_findVisualInfo(Display *display, int screen, QSurfaceFormat *format, int drawableBit)-
232{-
233 Q_ASSERT(format);-
234-
235 XVisualInfo *visualInfo = 0;-
236-
237 GLXFBConfig config = qglx_findConfig(display, screen, *format, false, drawableBit);-
238 if (config)
configDescription
TRUEevaluated 3974 times by 118 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
FALSEnever evaluated
0-3974
239 visualInfo = glXGetVisualFromFBConfig(display, config);
executed 3974 times by 118 tests: visualInfo = glXGetVisualFromFBConfig(display, config);
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
3974
240-
241 if (visualInfo) {
visualInfoDescription
TRUEevaluated 3974 times by 118 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
FALSEnever evaluated
0-3974
242 qglx_surfaceFormatFromGLXFBConfig(format, display, config);-
243 return visualInfo;
executed 3974 times by 118 tests: return visualInfo;
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
3974
244 }-
245-
246 // attempt to fall back to glXChooseVisual-
247 do {-
248 QVector<int> attribs = qglx_buildSpec(*format, drawableBit);-
249 visualInfo = glXChooseVisual(display, screen, attribs.data());-
250-
251 if (visualInfo) {
visualInfoDescription
TRUEnever evaluated
FALSEnever evaluated
0
252 qglx_surfaceFormatFromVisualInfo(format, display, visualInfo);-
253 return visualInfo;
never executed: return visualInfo;
0
254 }-
255 } while (qglx_reduceFormat(format));
never executed: end of block
qglx_reduceFormat(format)Description
TRUEnever evaluated
FALSEnever evaluated
0
256-
257 return visualInfo;
never executed: return visualInfo;
0
258}-
259-
260void qglx_surfaceFormatFromGLXFBConfig(QSurfaceFormat *format, Display *display, GLXFBConfig config)-
261{-
262 int redSize = 0;-
263 int greenSize = 0;-
264 int blueSize = 0;-
265 int alphaSize = 0;-
266 int depthSize = 0;-
267 int stencilSize = 0;-
268 int sampleBuffers = 0;-
269 int sampleCount = 0;-
270 int stereo = 0;-
271-
272 glXGetFBConfigAttrib(display, config, GLX_RED_SIZE, &redSize);-
273 glXGetFBConfigAttrib(display, config, GLX_GREEN_SIZE, &greenSize);-
274 glXGetFBConfigAttrib(display, config, GLX_BLUE_SIZE, &blueSize);-
275 glXGetFBConfigAttrib(display, config, GLX_ALPHA_SIZE, &alphaSize);-
276 glXGetFBConfigAttrib(display, config, GLX_DEPTH_SIZE, &depthSize);-
277 glXGetFBConfigAttrib(display, config, GLX_STENCIL_SIZE, &stencilSize);-
278 glXGetFBConfigAttrib(display, config, GLX_SAMPLES_ARB, &sampleBuffers);-
279 glXGetFBConfigAttrib(display, config, GLX_STEREO, &stereo);-
280-
281 format->setRedBufferSize(redSize);-
282 format->setGreenBufferSize(greenSize);-
283 format->setBlueBufferSize(blueSize);-
284 format->setAlphaBufferSize(alphaSize);-
285 format->setDepthBufferSize(depthSize);-
286 format->setStencilBufferSize(stencilSize);-
287 if (sampleBuffers) {
sampleBuffersDescription
TRUEnever evaluated
FALSEevaluated 4057 times by 120 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
0-4057
288 glXGetFBConfigAttrib(display, config, GLX_SAMPLES_ARB, &sampleCount);-
289 format->setSamples(sampleCount);-
290 }
never executed: end of block
0
291-
292 format->setStereo(stereo);-
293}
executed 4057 times by 120 tests: end of block
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
4057
294-
295void qglx_surfaceFormatFromVisualInfo(QSurfaceFormat *format, Display *display, XVisualInfo *visualInfo)-
296{-
297 int redSize = 0;-
298 int greenSize = 0;-
299 int blueSize = 0;-
300 int alphaSize = 0;-
301 int depthSize = 0;-
302 int stencilSize = 0;-
303 int sampleBuffers = 0;-
304 int sampleCount = 0;-
305 int stereo = 0;-
306-
307 glXGetConfig(display, visualInfo, GLX_RED_SIZE, &redSize);-
308 glXGetConfig(display, visualInfo, GLX_GREEN_SIZE, &greenSize);-
309 glXGetConfig(display, visualInfo, GLX_BLUE_SIZE, &blueSize);-
310 glXGetConfig(display, visualInfo, GLX_ALPHA_SIZE, &alphaSize);-
311 glXGetConfig(display, visualInfo, GLX_DEPTH_SIZE, &depthSize);-
312 glXGetConfig(display, visualInfo, GLX_STENCIL_SIZE, &stencilSize);-
313 glXGetConfig(display, visualInfo, GLX_SAMPLES_ARB, &sampleBuffers);-
314 glXGetConfig(display, visualInfo, GLX_STEREO, &stereo);-
315-
316 format->setRedBufferSize(redSize);-
317 format->setGreenBufferSize(greenSize);-
318 format->setBlueBufferSize(blueSize);-
319 format->setAlphaBufferSize(alphaSize);-
320 format->setDepthBufferSize(depthSize);-
321 format->setStencilBufferSize(stencilSize);-
322 if (sampleBuffers) {
sampleBuffersDescription
TRUEnever evaluated
FALSEnever evaluated
0
323 glXGetConfig(display, visualInfo, GLX_SAMPLES_ARB, &sampleCount);-
324 format->setSamples(sampleCount);-
325 }
never executed: end of block
0
326-
327 format->setStereo(stereo);-
328}
never executed: end of block
0
329-
330bool qglx_reduceFormat(QSurfaceFormat *format)-
331{-
332 Q_ASSERT(format);-
333-
334 if (format->redBufferSize() > 1) {
format->redBufferSize() > 1Description
TRUEnever evaluated
FALSEnever evaluated
0
335 format->setRedBufferSize(1);-
336 return true;
never executed: return true;
0
337 }-
338-
339 if (format->greenBufferSize() > 1) {
format->greenBufferSize() > 1Description
TRUEnever evaluated
FALSEnever evaluated
0
340 format->setGreenBufferSize(1);-
341 return true;
never executed: return true;
0
342 }-
343-
344 if (format->blueBufferSize() > 1) {
format->blueBufferSize() > 1Description
TRUEnever evaluated
FALSEnever evaluated
0
345 format->setBlueBufferSize(1);-
346 return true;
never executed: return true;
0
347 }-
348-
349 if (format->swapBehavior() != QSurfaceFormat::SingleBuffer){
format->swapBe...::SingleBufferDescription
TRUEnever evaluated
FALSEnever evaluated
0
350 format->setSwapBehavior(QSurfaceFormat::SingleBuffer);-
351 return true;
never executed: return true;
0
352 }-
353-
354 if (format->samples() > 1) {
format->samples() > 1Description
TRUEnever evaluated
FALSEnever evaluated
0
355 format->setSamples(qMin(16, format->samples() / 2));-
356 return true;
never executed: return true;
0
357 }-
358-
359 if (format->depthBufferSize() >= 32) {
format->depthB...erSize() >= 32Description
TRUEnever evaluated
FALSEnever evaluated
0
360 format->setDepthBufferSize(24);-
361 return true;
never executed: return true;
0
362 }-
363-
364 if (format->depthBufferSize() > 1) {
format->depthBufferSize() > 1Description
TRUEnever evaluated
FALSEnever evaluated
0
365 format->setDepthBufferSize(1);-
366 return true;
never executed: return true;
0
367 }-
368-
369 if (format->depthBufferSize() > 0) {
format->depthBufferSize() > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
370 format->setDepthBufferSize(0);-
371 return true;
never executed: return true;
0
372 }-
373-
374 if (format->hasAlpha()) {
format->hasAlpha()Description
TRUEnever evaluated
FALSEnever evaluated
0
375 format->setAlphaBufferSize(0);-
376 return true;
never executed: return true;
0
377 }-
378-
379 if (format->stencilBufferSize() > 1) {
format->stenci...fferSize() > 1Description
TRUEnever evaluated
FALSEnever evaluated
0
380 format->setStencilBufferSize(1);-
381 return true;
never executed: return true;
0
382 }-
383-
384 if (format->stencilBufferSize() > 0) {
format->stenci...fferSize() > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
385 format->setStencilBufferSize(0);-
386 return true;
never executed: return true;
0
387 }-
388-
389 if (format->stereo()) {
format->stereo()Description
TRUEnever evaluated
FALSEnever evaluated
0
390 format->setStereo(false);-
391 return true;
never executed: return true;
0
392 }-
393-
394 return false;
never executed: return false;
0
395}-
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9