QWaylandGLContext: init fields in default ctor
Coverity complains that the =default'ed default ctor leaves m_decorationsContext and m_api uninitialized, which is true. To fix, use NSDMI for the former. For m_api, initialize it in the default constructor's member initializer list, because the default value is closely related to the other constructor's choice of value¹, and so should be more proximal to the other constructor's initialization of m_api (which is dynamic). Using NSDMI for m_api would also remove tooling's ability to detect faults in the other constructor. ¹ I had to track into QSurfaceFormat to verify which of the possible values is the correct one (= the one that gets mapped from DefaultSurfaceFormat by the switch in the other QWaylandGLContext ctor). Amends 7c0a96785fee4fea8ef1452166b1dde88957445c. Task-number: QTBUG-110758 Coverity-Id: 481857 Change-Id: I837d0a3a63bd6e2948ef1c9757e250bfba7dd957 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit e51675b891d2a4c64dda0094be0c84070833b82a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
33f8d08343
commit
a4db2f7313
@ -191,13 +191,16 @@ public:
|
||||
int m_textureWrap;
|
||||
};
|
||||
|
||||
QWaylandGLContext::QWaylandGLContext() = default;
|
||||
QWaylandGLContext::QWaylandGLContext()
|
||||
: QEGLPlatformContext(),
|
||||
m_api(EGL_OPENGL_ES_API)
|
||||
{
|
||||
}
|
||||
|
||||
QWaylandGLContext::QWaylandGLContext(EGLDisplay eglDisplay, QWaylandDisplay *display,
|
||||
const QSurfaceFormat &fmt, QPlatformOpenGLContext *share)
|
||||
: QEGLPlatformContext(fmt, share, eglDisplay)
|
||||
, m_display(display)
|
||||
, m_decorationsContext(EGL_NO_CONTEXT)
|
||||
{
|
||||
m_reconnectionWatcher = QObject::connect(m_display, &QWaylandDisplay::connected,
|
||||
m_display, [this] { invalidateContext(); });
|
||||
|
@ -57,7 +57,7 @@ protected:
|
||||
|
||||
private:
|
||||
QWaylandDisplay *m_display = nullptr;
|
||||
EGLContext m_decorationsContext;
|
||||
EGLContext m_decorationsContext = EGL_NO_CONTEXT;
|
||||
DecorationsBlitter *m_blitter = nullptr;
|
||||
bool m_supportNonBlockingSwap = true;
|
||||
EGLenum m_api;
|
||||
|
Loading…
x
Reference in New Issue
Block a user