summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylandviewport.cpp
blob: 3252718c0544ead3e329316df083e9f2d4c64f3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright (C) 2022 David Edmundson <davidedmundson@kde.org>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#include "qwaylandviewport_p.h"

QT_BEGIN_NAMESPACE

namespace QtWaylandClient {

QWaylandViewport::QWaylandViewport(::wp_viewport *viewport)
    : QtWayland::wp_viewport(viewport)
{
}

QWaylandViewport::~QWaylandViewport()
{
    destroy();
}

void QWaylandViewport::setSource(const QRectF &source)
{
    set_source(wl_fixed_from_double(source.x()),
               wl_fixed_from_double(source.y()),
               wl_fixed_from_double(source.width()),
               wl_fixed_from_double(source.height()));
}

void QWaylandViewport::setDestination(const QSize &destination)
{
    set_destination(destination.width(), destination.height());
}

}

QT_END_NAMESPACE