Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwlclientbuffer.cpp
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
5
6#if QT_CONFIG(opengl)
7#include "hardware_integration/qwlclientbufferintegration_p.h"
8#include <qpa/qplatformopenglcontext.h>
9#include <QOpenGLTexture>
10#endif
11
12#include <QtCore/QDebug>
13
14#include <QtWaylandCompositor/private/wayland-wayland-server-protocol.h>
16
17#include <QtWaylandCompositor/private/qwaylandcompositor_p.h>
18
20
21namespace QtWayland {
22
27
28
34
41
43{
44 m_destroyed = true;
45 m_committed = false;
46 m_buffer = nullptr;
47
49 delete this;
50}
51
53{
55}
56
58{
59 if (!m_refCount.deref()) {
60 if (isCommitted() && m_buffer && !m_destroyed)
62 if (m_destroyed)
63 delete this;
64 }
65}
66
73
78
84
94
99
100static void shmBufferCleanup(void *data)
101{
102 auto *pool = static_cast<struct wl_shm_pool *>(data);
103 wl_shm_pool_unref(pool);
104}
105
124
125#if QT_CONFIG(opengl)
127{
129 if (isSharedMemory()) {
130 if (!m_shmTexture) {
133 }
134 if (m_textureDirty) {
135 m_textureDirty = false;
138 // TODO: partial texture upload
139 QImage image = this->image();
141 if (image.hasAlphaChannel()) {
146 } else {
151 }
152 //we can release the buffer after uploading, since we have a copy
153 if (isCommitted())
154 sendRelease();
155 }
156 return m_shmTexture.data();
157 }
158 return nullptr;
159}
160#endif
161
162}
163
164QT_END_NAMESPACE
Combined button and popup list for selecting options.
static void shmBufferCleanup(void *data)