| 1 | // Copyright (C) 2017 Jolla Ltd, author: <giulio.camuffo@jollamobile.com> |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | #include <QSGTexture> |
| 5 | #include <QQuickWindow> |
| 6 | #include <QDebug> |
| 7 | |
| 8 | #include "qwaylandquicksurface.h" |
| 9 | #include "qwaylandquicksurface_p.h" |
| 10 | #include "qwaylandquickcompositor.h" |
| 11 | #include "qwaylandquickitem.h" |
| 12 | #include <QtWaylandCompositor/qwaylandbufferref.h> |
| 13 | #include <QtWaylandCompositor/QWaylandView> |
| 14 | #include <QtWaylandCompositor/private/qwaylandsurface_p.h> |
| 15 | |
| 16 | QT_BEGIN_NAMESPACE |
| 17 | |
| 18 | QWaylandQuickSurface::QWaylandQuickSurface() |
| 19 | : QWaylandSurface(* new QWaylandQuickSurfacePrivate()) |
| 20 | { |
| 21 | |
| 22 | } |
| 23 | QWaylandQuickSurface::QWaylandQuickSurface(QWaylandCompositor *compositor, QWaylandClient *client, quint32 id, int version) |
| 24 | : QWaylandSurface(* new QWaylandQuickSurfacePrivate()) |
| 25 | { |
| 26 | initialize(compositor, client, id, version); |
| 27 | } |
| 28 | |
| 29 | QWaylandQuickSurface::QWaylandQuickSurface(QWaylandQuickSurfacePrivate &dptr) |
| 30 | : QWaylandSurface(dptr) |
| 31 | { |
| 32 | } |
| 33 | |
| 34 | QWaylandQuickSurface::~QWaylandQuickSurface() |
| 35 | { |
| 36 | |
| 37 | } |
| 38 | |
| 39 | /*! |
| 40 | * \qmlproperty bool QtWayland.Compositor::WaylandSurface::useTextureAlpha |
| 41 | * |
| 42 | * This property specifies whether the surface should use texture alpha. |
| 43 | */ |
| 44 | bool QWaylandQuickSurface::useTextureAlpha() const |
| 45 | { |
| 46 | Q_D(const QWaylandQuickSurface); |
| 47 | return d->useTextureAlpha; |
| 48 | } |
| 49 | |
| 50 | void QWaylandQuickSurface::setUseTextureAlpha(bool useTextureAlpha) |
| 51 | { |
| 52 | Q_D(QWaylandQuickSurface); |
| 53 | if (d->useTextureAlpha != useTextureAlpha) { |
| 54 | d->useTextureAlpha = useTextureAlpha; |
| 55 | emit useTextureAlphaChanged(); |
| 56 | emit configure(hasBuffer: d->bufferRef.hasBuffer()); |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | QT_END_NAMESPACE |
| 61 | |
| 62 | #include "moc_qwaylandquicksurface.cpp" |
| 63 |
