diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2018-02-27 11:32:15 +0100 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2018-02-27 17:03:41 +0000 |
commit | c4bd9198b4a0fac809903dd2c09276c2c3c1b22e (patch) | |
tree | 83325fe11d258c922ede480e0ad3de3df45032fa /src/hardwareintegration | |
parent | 72999738489b5251d025c954a77c93e8e1fdfd9d (diff) |
Init variables where they are declared when possible (clang-tidy)
clang-tidy -p compile_commands.json $file \
-checks='-*,modernize-use-default-member-init,readability-redundant-member-init' \
-config='{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: "1"}]}' \
-header-filter='qtwayland' \
-fix
Afterwards I ran search and replace on the diff to clean up some whitespace errors:
- Replaced '(\n\+[^:\n]*)(:\s+\+\s+)' with '$1: '
- Replaced '(\n\+[^,\n]*)(,\s+\+\s+)' with '$1, '
- Replaced '\n\+\s*\n' with '\n'
I also had to do some manual edits, because for some reason, this particular
clang-tidy check doesn't trigger for some files.
Change-Id: I3b3909bac4bf20108bbe8ad1e01bcc54236dae1b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/hardwareintegration')
36 files changed, 62 insertions, 128 deletions
diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.cpp b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.cpp index 430b455f4..4478b9fdf 100644 --- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.cpp +++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.cpp @@ -53,7 +53,6 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { QWaylandBrcmEglIntegration::QWaylandBrcmEglIntegration() - : m_waylandDisplay(0) { qDebug() << "Using Brcm-EGL"; } diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h index 0a913bcdf..8d89ebf74 100644 --- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h +++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h @@ -85,7 +85,7 @@ public: private: static void wlDisplayHandleGlobal(void *data, struct wl_registry *registry, uint32_t id, const QString &interface, uint32_t version); - struct wl_display *m_waylandDisplay; + struct wl_display *m_waylandDisplay = nullptr; struct qt_brcm *m_waylandBrcm; EGLDisplay m_eglDisplay; diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp index f2709983e..6b3c614a5 100644 --- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp +++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp @@ -67,7 +67,6 @@ public: int count, struct wl_event_queue *eventQueue) : m_size(size) - , m_released(true) , m_display(display) , m_eventQueue(eventQueue) { @@ -119,7 +118,7 @@ public: private: QSize m_size; - bool m_released; + bool m_released = true; wl_array m_array; EGLint *m_data; QWaylandDisplay *m_display; @@ -129,11 +128,8 @@ private: QWaylandBrcmEglWindow::QWaylandBrcmEglWindow(QWindow *window) : QWaylandWindow(window) , m_eglIntegration(static_cast<QWaylandBrcmEglIntegration *>(mDisplay->clientBufferIntegration())) - , m_eglConfig(0) , m_format(window->format()) , m_eventQueue(wl_display_create_queue(mDisplay->wl_display())) - , m_current(0) - , m_count(0) { } diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.h b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.h index be88df9af..28376669d 100644 --- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.h +++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.h @@ -77,7 +77,7 @@ private: const QWaylandWindow *m_parentWindow; - EGLConfig m_eglConfig; + EGLConfig m_eglConfig = 0; EGLint m_globalImages[3*5]; EGLSurface m_eglSurfaces[3]; @@ -87,8 +87,8 @@ private: struct wl_event_queue *m_eventQueue; - int m_current; - int m_count; + int m_current = 0; + int m_count = 0; }; } diff --git a/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp b/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp index fe2adbf56..754196468 100644 --- a/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp +++ b/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp @@ -55,8 +55,7 @@ DrmServerBuffer::DrmServerBuffer(DrmEglServerBufferIntegration *integration , int32_t height , int32_t stride , int32_t format) - : QWaylandServerBuffer() - , m_integration(integration) + : m_integration(integration) { m_size = QSize(width, height); EGLint egl_format; diff --git a/src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.cpp b/src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.cpp index 51b904e75..252ceb698 100644 --- a/src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.cpp +++ b/src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.cpp @@ -60,7 +60,6 @@ LibHybrisServerBuffer::LibHybrisServerBuffer(LibHybrisEglServerBufferIntegration , int32_t format) : QWaylandServerBuffer() , m_integration(integration) - , m_texture(nullptr) , m_stride(stride) , m_hybrisFormat(format) { diff --git a/src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.h b/src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.h index b3c9c464d..1ba38e6e4 100644 --- a/src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.h +++ b/src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.h @@ -83,7 +83,7 @@ protected: private: LibHybrisEglServerBufferIntegration *m_integration; EGLImageKHR m_image; - QOpenGLTexture *m_texture; + QOpenGLTexture *m_texture = nullptr; int m_numFds; QVector<int32_t> m_ints; QVector<int32_t> m_fds; diff --git a/src/hardwareintegration/client/shm-emulation-server/shmserverbufferintegration.cpp b/src/hardwareintegration/client/shm-emulation-server/shmserverbufferintegration.cpp index bc597ebf8..0c43b089a 100644 --- a/src/hardwareintegration/client/shm-emulation-server/shmserverbufferintegration.cpp +++ b/src/hardwareintegration/client/shm-emulation-server/shmserverbufferintegration.cpp @@ -89,9 +89,7 @@ static QOpenGLTexture *createTextureFromShm(const QString &key, int w, int h, in namespace QtWaylandClient { ShmServerBuffer::ShmServerBuffer(ShmServerBufferIntegration *integration, const QString &key, int32_t width, int32_t height, int32_t bytes_per_line, int32_t format) - : QWaylandServerBuffer() - , m_integration(integration) - , m_texture(nullptr) + : m_integration(integration) , m_key(key) , m_bpl(bytes_per_line) , m_format(format) diff --git a/src/hardwareintegration/client/shm-emulation-server/shmserverbufferintegration.h b/src/hardwareintegration/client/shm-emulation-server/shmserverbufferintegration.h index ce4032ba4..788344ff6 100644 --- a/src/hardwareintegration/client/shm-emulation-server/shmserverbufferintegration.h +++ b/src/hardwareintegration/client/shm-emulation-server/shmserverbufferintegration.h @@ -62,7 +62,7 @@ public: QOpenGLTexture* toOpenGlTexture() override; private: ShmServerBufferIntegration *m_integration; - QOpenGLTexture *m_texture; + QOpenGLTexture *m_texture = nullptr; QString m_key; int m_bpl; int m_format; diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp index 8a1009fa8..4b3a635c7 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp @@ -64,9 +64,6 @@ static const char *qwaylandegl_threadedgl_blacklist_vendor[] = { }; QWaylandEglClientBufferIntegration::QWaylandEglClientBufferIntegration() - : m_display(0) - , m_eglDisplay(EGL_NO_DISPLAY) - , m_supportsThreading(false) { qDebug() << "Using Wayland-EGL"; } diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.h b/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.h index 427a30d8e..93edfcc58 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.h +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.h @@ -72,10 +72,10 @@ public: EGLDisplay eglDisplay() const; private: - QWaylandDisplay *m_display; + QWaylandDisplay *m_display = nullptr; - EGLDisplay m_eglDisplay; - bool m_supportsThreading; + EGLDisplay m_eglDisplay = EGL_NO_DISPLAY; + bool m_supportsThreading = false; }; QT_END_NAMESPACE diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp index 87f3e2d4e..870b71c1a 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp @@ -57,10 +57,6 @@ namespace QtWaylandClient { QWaylandEglWindow::QWaylandEglWindow(QWindow *window) : QWaylandWindow(window) , m_clientBufferIntegration(static_cast<QWaylandEglClientBufferIntegration *>(mDisplay->clientBufferIntegration())) - , m_waylandEglWindow(0) - , m_eglSurface(0) - , m_contentFBO(0) - , m_resize(false) { QSurfaceFormat fmt = window->requestedFormat(); if (mDisplay->supportsWindowDecoration()) diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h index 77aee56dc..94947365c 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h @@ -82,14 +82,14 @@ private Q_SLOTS: private: QWaylandEglClientBufferIntegration *m_clientBufferIntegration; - struct wl_egl_window *m_waylandEglWindow; + struct wl_egl_window *m_waylandEglWindow = nullptr; const QWaylandWindow *m_parentWindow; - EGLSurface m_eglSurface; + EGLSurface m_eglSurface = EGL_NO_SURFACE; EGLConfig m_eglConfig; - mutable QOpenGLFramebufferObject *m_contentFBO; - mutable bool m_resize; + mutable bool m_resize = false; + mutable QOpenGLFramebufferObject *m_contentFBO = nullptr; QSurfaceFormat m_format; }; diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp index 967028861..740ad6b10 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp @@ -229,9 +229,6 @@ QWaylandGLContext::QWaylandGLContext(EGLDisplay eglDisplay, QWaylandDisplay *dis : QPlatformOpenGLContext() , m_eglDisplay(eglDisplay) , m_display(display) - , m_blitter(0) - , mUseNativeDefaultFbo(false) - , mSupportNonBlockingSwap(true) { QSurfaceFormat fmt = format; if (static_cast<QWaylandIntegration *>(QGuiApplicationPrivate::platformIntegration())->display()->supportsWindowDecoration()) diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h index 6d9887de6..af1c4e04d 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h +++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h @@ -89,10 +89,10 @@ private: EGLContext m_shareEGLContext; EGLConfig m_config; QSurfaceFormat m_format; - DecorationsBlitter *m_blitter; - bool mUseNativeDefaultFbo; + DecorationsBlitter *m_blitter = nullptr; + bool mUseNativeDefaultFbo = false; uint m_api; - bool mSupportNonBlockingSwap; + bool mSupportNonBlockingSwap = true; friend class DecorationsBlitter; }; diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp index 2a7de6b72..aa5367e02 100644 --- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp +++ b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp @@ -54,8 +54,6 @@ namespace QtWaylandClient { QWaylandXCompositeEGLClientBufferIntegration::QWaylandXCompositeEGLClientBufferIntegration() : QWaylandClientBufferIntegration() - , mWaylandDisplay(0) - , mDisplay(0) { qDebug() << "Using XComposite-EGL"; } diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h index cdc071e55..3742e1f56 100644 --- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h +++ b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h @@ -92,10 +92,10 @@ public: bool supportsWindowDecoration() const override { return false; } private: - QWaylandDisplay *mWaylandDisplay; + QWaylandDisplay *mWaylandDisplay = nullptr; struct qt_xcomposite *mWaylandComposite; - Display *mDisplay; + Display *mDisplay = nullptr; EGLDisplay mEglDisplay; int mScreen; Window mRootWindow; diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.cpp b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.cpp index 9c3dee3fc..57a7ba7b6 100644 --- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.cpp +++ b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.cpp @@ -57,10 +57,7 @@ namespace QtWaylandClient { QWaylandXCompositeEGLWindow::QWaylandXCompositeEGLWindow(QWindow *window, QWaylandXCompositeEGLClientBufferIntegration *glxIntegration) : QWaylandWindow(window) , m_glxIntegration(glxIntegration) - , m_buffer(0) - , m_xWindow(0) , m_config(q_configFromGLFormat(glxIntegration->eglDisplay(), window->format(), true, EGL_WINDOW_BIT | EGL_PIXMAP_BIT)) - , m_surface(0) { } diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.h b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.h index 90b4cc73e..d90159fa7 100644 --- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.h +++ b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.h @@ -66,11 +66,11 @@ private: void createEglSurface(); QWaylandXCompositeEGLClientBufferIntegration *m_glxIntegration; - QWaylandBuffer *m_buffer; + QWaylandBuffer *m_buffer = nullptr; - Window m_xWindow; + Window m_xWindow = 0; EGLConfig m_config; - EGLSurface m_surface; + EGLSurface m_surface = EGL_NO_SURFACE; }; } diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.cpp b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.cpp index dbd7761e3..090cfb8a0 100644 --- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.cpp +++ b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.cpp @@ -52,11 +52,6 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { QWaylandXCompositeGLXIntegration::QWaylandXCompositeGLXIntegration() - : mWaylandDisplay(0) - , mWaylandComposite(0) - , mDisplay(0) - , mScreen(0) - , mRootWindow(0) { qDebug() << "Using XComposite-GLX"; } diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h index 288bf3111..746678f7a 100644 --- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h +++ b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h @@ -86,12 +86,12 @@ public: bool supportsWindowDecoration() const override { return false; } private: - QWaylandDisplay *mWaylandDisplay; - struct qt_xcomposite *mWaylandComposite; + QWaylandDisplay *mWaylandDisplay = nullptr; + struct qt_xcomposite *mWaylandComposite = nullptr; - Display *mDisplay; - int mScreen; - Window mRootWindow; + Display *mDisplay = nullptr; + int mScreen = 0; + Window mRootWindow = 0; static void wlDisplayHandleGlobal(void *data, struct wl_registry *registry, uint32_t id, const QString &interface, uint32_t version); diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.cpp b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.cpp index 9cca9e46e..2b491e24d 100644 --- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.cpp +++ b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.cpp @@ -54,9 +54,7 @@ namespace QtWaylandClient { QWaylandXCompositeGLXWindow::QWaylandXCompositeGLXWindow(QWindow *window, QWaylandXCompositeGLXIntegration *glxIntegration) : QWaylandWindow(window) , m_glxIntegration(glxIntegration) - , m_xWindow(0) , m_config(qglx_findConfig(glxIntegration->xDisplay(), glxIntegration->screen(), window->format(), GLX_WINDOW_BIT | GLX_PIXMAP_BIT)) - , mBuffer(0) { } diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.h b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.h index aeb5c14ec..c2df592ee 100644 --- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.h +++ b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.h @@ -69,9 +69,9 @@ private: QWaylandXCompositeGLXIntegration *m_glxIntegration; - Window m_xWindow; + Window m_xWindow = 0; GLXFBConfig m_config; - QWaylandBuffer *mBuffer; + QWaylandBuffer *mBuffer = nullptr; }; } diff --git a/src/hardwareintegration/compositor/brcm-egl/brcmbuffer.cpp b/src/hardwareintegration/compositor/brcm-egl/brcmbuffer.cpp index 768545772..f5573fefd 100644 --- a/src/hardwareintegration/compositor/brcm-egl/brcmbuffer.cpp +++ b/src/hardwareintegration/compositor/brcm-egl/brcmbuffer.cpp @@ -48,7 +48,6 @@ QT_BEGIN_NAMESPACE BrcmBuffer::BrcmBuffer(struct ::wl_client *client, uint32_t id, const QSize &size, EGLint *data, size_t count) : QtWaylandServer::wl_buffer(client, id, 1) , m_handle(count) - , m_invertedY(false) , m_size(size) { for (size_t i = 0; i < count; ++i) diff --git a/src/hardwareintegration/compositor/brcm-egl/brcmbuffer.h b/src/hardwareintegration/compositor/brcm-egl/brcmbuffer.h index 605adef7f..3028fbed5 100644 --- a/src/hardwareintegration/compositor/brcm-egl/brcmbuffer.h +++ b/src/hardwareintegration/compositor/brcm-egl/brcmbuffer.h @@ -70,7 +70,7 @@ protected: private: QVector<EGLint> m_handle; - bool m_invertedY; + bool m_invertedY = false; QSize m_size; }; diff --git a/src/hardwareintegration/compositor/brcm-egl/brcmeglintegration.cpp b/src/hardwareintegration/compositor/brcm-egl/brcmeglintegration.cpp index 312dfbcfa..852ec3dee 100644 --- a/src/hardwareintegration/compositor/brcm-egl/brcmeglintegration.cpp +++ b/src/hardwareintegration/compositor/brcm-egl/brcmeglintegration.cpp @@ -60,15 +60,12 @@ QT_BEGIN_NAMESPACE class BrcmEglIntegrationPrivate { public: - BrcmEglIntegrationPrivate() - : egl_display(EGL_NO_DISPLAY) - , valid(false) - { } + BrcmEglIntegrationPrivate() = default; static BrcmEglIntegrationPrivate *get(BrcmEglIntegration *integration); - EGLDisplay egl_display; - bool valid; + EGLDisplay egl_display = EGL_NO_DISPLAY; + bool valid = false; PFNEGLQUERYGLOBALIMAGEBRCMPROC eglQueryGlobalImageBRCM; PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOES; PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR; @@ -76,9 +73,7 @@ public: }; BrcmEglIntegration::BrcmEglIntegration() - : QtWayland::ClientBufferIntegration() - , QtWaylandServer::qt_brcm() - , d_ptr(new BrcmEglIntegrationPrivate) + : d_ptr(new BrcmEglIntegrationPrivate) { } @@ -188,7 +183,6 @@ void BrcmEglIntegration::brcm_create_buffer(Resource *resource, uint32_t id, int BrcmEglClientBuffer::BrcmEglClientBuffer(BrcmEglIntegration *integration, wl_resource *buffer) : ClientBuffer(buffer) , m_integration(integration) - , m_texture(nullptr) { } diff --git a/src/hardwareintegration/compositor/brcm-egl/brcmeglintegration.h b/src/hardwareintegration/compositor/brcm-egl/brcmeglintegration.h index dea61b4bb..89e53bc30 100644 --- a/src/hardwareintegration/compositor/brcm-egl/brcmeglintegration.h +++ b/src/hardwareintegration/compositor/brcm-egl/brcmeglintegration.h @@ -79,8 +79,8 @@ public: QWaylandSurface::Origin origin() const override; QOpenGLTexture *toOpenGlTexture(int plane) override; private: - BrcmEglIntegration *m_integration; - QOpenGLTexture *m_texture; + BrcmEglIntegration *m_integration = nullptr; + QOpenGLTexture *m_texture = nullptr; }; diff --git a/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp b/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp index c7dbe1bea..ef14aa2a2 100644 --- a/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp +++ b/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp @@ -47,7 +47,6 @@ QT_BEGIN_NAMESPACE DrmEglServerBuffer::DrmEglServerBuffer(DrmEglServerBufferIntegration *integration, const QImage &qimage, QtWayland::ServerBuffer::Format format) : QtWayland::ServerBuffer(qimage.size(),format) , m_integration(integration) - , m_texture(nullptr) { m_format = format; diff --git a/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.h b/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.h index e1cc8768f..b3bcc3109 100644 --- a/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.h +++ b/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.h @@ -89,7 +89,7 @@ private: int32_t m_name; int32_t m_stride; - QOpenGLTexture *m_texture; + QOpenGLTexture *m_texture = nullptr; QtWaylandServer::qt_drm_egl_server_buffer::format m_drm_format; }; diff --git a/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.cpp b/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.cpp index de9e1cf6e..5a42c00dc 100644 --- a/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.cpp +++ b/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.cpp @@ -48,7 +48,6 @@ QT_BEGIN_NAMESPACE LibHybrisEglServerBuffer::LibHybrisEglServerBuffer(LibHybrisEglServerBufferIntegration *integration, const QImage &qimage, QtWayland::ServerBuffer::Format format) : QtWayland::ServerBuffer(qimage.size(),format) , m_integration(integration) - , m_texture(nullptr) { m_format = format; diff --git a/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.h b/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.h index 0e1593447..f99dacd99 100644 --- a/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.h +++ b/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.h @@ -91,7 +91,7 @@ private: int32_t m_name; int32_t m_stride; - QOpenGLTexture *m_texture; + QOpenGLTexture *m_texture = nullptr; QtWaylandServer::qt_libhybris_egl_server_buffer::format m_hybris_format; QVector<int32_t> m_ints; QVector<int32_t> m_fds; diff --git a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp index a088027a3..6de664564 100644 --- a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp +++ b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp @@ -151,7 +151,7 @@ egl_error_string(EGLint code) struct BufferState { - BufferState(); + BufferState() = default; enum EglMode { ModeUninitialized, @@ -159,14 +159,14 @@ struct BufferState ModeEGLStream }; - EGLint egl_format; + EGLint egl_format = EGL_TEXTURE_RGBA; QVarLengthArray<EGLImageKHR, 3> egl_images; QOpenGLTexture *textures[3] = {}; - EGLStreamKHR egl_stream; + EGLStreamKHR egl_stream = EGL_NO_STREAM_KHR; - bool isYInverted; + bool isYInverted = true; QSize size; - EglMode eglMode; + EglMode eglMode = ModeUninitialized; }; class WaylandEglClientBufferIntegrationPrivate @@ -181,22 +181,22 @@ public: void handleEglstreamTexture(WaylandEglClientBuffer *buffer, wl_resource *bufferHandle); void registerBuffer(struct ::wl_resource *buffer, BufferState state); - EGLDisplay egl_display; - bool valid; - bool display_bound; + EGLDisplay egl_display = EGL_NO_DISPLAY; + bool valid = false; + bool display_bound = false; QOffscreenSurface *offscreenSurface = nullptr; QOpenGLContext *localContext = nullptr; - PFNEGLBINDWAYLANDDISPLAYWL egl_bind_wayland_display; - PFNEGLUNBINDWAYLANDDISPLAYWL egl_unbind_wayland_display; - PFNEGLQUERYWAYLANDBUFFERWL_compat egl_query_wayland_buffer; + PFNEGLBINDWAYLANDDISPLAYWL egl_bind_wayland_display = nullptr; + PFNEGLUNBINDWAYLANDDISPLAYWL egl_unbind_wayland_display = nullptr; + PFNEGLQUERYWAYLANDBUFFERWL_compat egl_query_wayland_buffer = nullptr; - PFNEGLCREATEIMAGEKHRPROC egl_create_image; - PFNEGLDESTROYIMAGEKHRPROC egl_destroy_image; + PFNEGLCREATEIMAGEKHRPROC egl_create_image = nullptr; + PFNEGLDESTROYIMAGEKHRPROC egl_destroy_image = nullptr; - PFNGLEGLIMAGETARGETTEXTURE2DOESPROC gl_egl_image_target_texture_2d; + PFNGLEGLIMAGETARGETTEXTURE2DOESPROC gl_egl_image_target_texture_2d = nullptr; - QEGLStreamConvenience *funcs; + QEGLStreamConvenience *funcs = nullptr; static WaylandEglClientBufferIntegrationPrivate *get(WaylandEglClientBufferIntegration *integration) { return shuttingDown ? nullptr : integration->d_ptr.data(); } @@ -206,24 +206,7 @@ public: bool WaylandEglClientBufferIntegrationPrivate::shuttingDown = false; -BufferState::BufferState() - : egl_format(EGL_TEXTURE_RGBA) - , egl_stream(EGL_NO_STREAM_KHR) - , isYInverted(true) - , eglMode(ModeUninitialized) -{} - WaylandEglClientBufferIntegrationPrivate::WaylandEglClientBufferIntegrationPrivate() - : egl_display(EGL_NO_DISPLAY) - , valid(false) - , display_bound(false) - , egl_bind_wayland_display(nullptr) - , egl_unbind_wayland_display(nullptr) - , egl_query_wayland_buffer(nullptr) - , egl_create_image(nullptr) - , egl_destroy_image(nullptr) - , gl_egl_image_target_texture_2d(nullptr) - , funcs(nullptr) { } @@ -394,8 +377,7 @@ void WaylandEglClientBufferIntegrationPrivate::handleEglstreamTexture(WaylandEgl } WaylandEglClientBufferIntegration::WaylandEglClientBufferIntegration() - : QtWayland::ClientBufferIntegration() - , d_ptr(new WaylandEglClientBufferIntegrationPrivate) + : d_ptr(new WaylandEglClientBufferIntegrationPrivate) { } diff --git a/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp b/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp index 049b8b3fe..37932447c 100644 --- a/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp +++ b/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp @@ -68,8 +68,6 @@ QVector<EGLint> eglbuildSpec() } XCompositeEglClientBufferIntegration::XCompositeEglClientBufferIntegration() - : QtWayland::ClientBufferIntegration() - , mDisplay(nullptr) { } @@ -100,7 +98,6 @@ QtWayland::ClientBuffer *XCompositeEglClientBufferIntegration::createBufferFor(w XCompositeEglClientBuffer::XCompositeEglClientBuffer(XCompositeEglClientBufferIntegration *integration, wl_resource *bufferResource) : QtWayland::ClientBuffer(bufferResource) - , m_texture(nullptr) , m_integration(integration) { } diff --git a/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.h b/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.h index 16d9591ba..f57f741c2 100644 --- a/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.h +++ b/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.h @@ -61,7 +61,7 @@ public: inline EGLDisplay eglDisplay() const { return mEglDisplay; } private: - Display *mDisplay; + Display *mDisplay = nullptr; EGLDisplay mEglDisplay; }; @@ -78,7 +78,7 @@ public: } private: - QOpenGLTexture *m_texture; + QOpenGLTexture *m_texture = nullptr; XCompositeEglClientBufferIntegration *m_integration; }; diff --git a/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.cpp b/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.cpp index b1c947b53..511a8f6b8 100644 --- a/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.cpp +++ b/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.cpp @@ -71,9 +71,6 @@ QVector<int> qglx_buildSpec() XCompositeGLXClientBufferIntegration::XCompositeGLXClientBufferIntegration() - : QtWayland::ClientBufferIntegration() - , mDisplay(nullptr) - , mHandler(nullptr) { qDebug() << "Loading GLX integration"; } @@ -122,9 +119,7 @@ QtWayland::ClientBuffer *XCompositeGLXClientBufferIntegration::createBufferFor(w XCompositeGLXClientBuffer::XCompositeGLXClientBuffer(XCompositeGLXClientBufferIntegration *integration, wl_resource *bufferResource) : QtWayland::ClientBuffer(bufferResource) - , m_texture(nullptr) , m_integration(integration) - , m_glxPixmap(0) { } diff --git a/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.h b/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.h index ccdca7613..23b856e93 100644 --- a/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.h +++ b/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.h @@ -68,9 +68,9 @@ public: PFNGLXRELEASETEXIMAGEEXTPROC m_glxReleaseTexImageEXT; private: - Display *mDisplay; + Display *mDisplay = nullptr; int mScreen; - XCompositeHandler *mHandler; + XCompositeHandler *mHandler = nullptr; }; class XCompositeGLXClientBuffer : public QtWayland::ClientBuffer @@ -86,9 +86,9 @@ public: } private: - QOpenGLTexture *m_texture; + QOpenGLTexture *m_texture = nullptr; XCompositeGLXClientBufferIntegration *m_integration; - GLXPixmap m_glxPixmap; + GLXPixmap m_glxPixmap = 0; }; QT_END_NAMESPACE |