1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#include "qwlhwintegration_p.h"
5
6#include <QtWaylandCompositor/QWaylandCompositor>
7
8QT_BEGIN_NAMESPACE
9
10namespace QtWayland {
11
12HardwareIntegration::HardwareIntegration(QWaylandCompositor *compositor)
13 : QWaylandCompositorExtensionTemplate<HardwareIntegration>(compositor)
14 , qt_hardware_integration(compositor->display(), 1)
15{
16}
17
18void HardwareIntegration::setClientBufferIntegrationName(const QString &name)
19{
20 m_client_buffer_integration_name = name;
21}
22void HardwareIntegration::setServerBufferIntegrationName(const QString &name)
23{
24 m_server_buffer_integration_name = name;
25}
26
27void HardwareIntegration::hardware_integration_bind_resource(Resource *resource)
28{
29 if (!m_client_buffer_integration_name.isEmpty())
30 send_client_backend(resource->handle, m_client_buffer_integration_name);
31 if (!m_server_buffer_integration_name.isEmpty())
32 send_server_backend(resource->handle, m_server_buffer_integration_name);
33}
34
35}
36
37QT_END_NAMESPACE
38

source code of qtwayland/src/compositor/hardware_integration/qwlhwintegration.cpp