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
brcmbuffer.h
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// Qt-Security score:critical reason:network-protocol
4
5#ifndef BRCMBUFFER_H
6#define BRCMBUFFER_H
7
8#include <QtWaylandCompositor/private/qwayland-server-wayland.h>
9#include <QtWaylandCompositor/private/qwaylandutils_p.h>
10
11#include <QtCore/QList>
12#include <QtCore/QSize>
13
14#include <EGL/egl.h>
15
16QT_BEGIN_NAMESPACE
17
18class BrcmBuffer : public QtWaylandServer::wl_buffer
19{
20public:
21 BrcmBuffer(struct ::wl_client *client, uint32_t id, const QSize &size, EGLint *data, size_t count);
22 ~BrcmBuffer();
23
24 bool isYInverted() const { return m_invertedY; }
25 void setInvertedY(bool inverted) { m_invertedY = inverted; }
26
27 EGLint *handle() { return m_handle.data(); }
28
29 QSize size() { return m_size; }
30
31 static BrcmBuffer *fromResource(struct ::wl_resource *resource) { return QtWayland::fromResource<BrcmBuffer *>(resource); }
32
33protected:
34 void buffer_destroy_resource(Resource *resource) override;
35 void buffer_destroy(Resource *resource) override;
36
37private:
38 QList<EGLint> m_handle;
39 bool m_invertedY = false;
40 QSize m_size;
41};
42
43QT_END_NAMESPACE
44
45#endif // BRCMBUFFER_H