/src/qtbase/src/gui/kernel/qplatformsurface.cpp
Line | Count | Source |
1 | | // Copyright (C) 2016 The Qt Company Ltd. |
2 | | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | | // Qt-Security score:significant reason:default |
4 | | |
5 | | #include "qplatformsurface.h" |
6 | | #ifndef QT_NO_DEBUG_STREAM |
7 | | #include <QtCore/qdebug.h> |
8 | | #include <QtGui/qwindow.h> |
9 | | #endif |
10 | | |
11 | | QT_BEGIN_NAMESPACE |
12 | | |
13 | | /*! |
14 | | \class QPlatformSurface |
15 | | \since 5.0 |
16 | | \internal |
17 | | \preliminary |
18 | | \ingroup qpa |
19 | | |
20 | | \brief The QPlatformSurface class provides an abstraction for a surface. |
21 | | */ |
22 | | QPlatformSurface::~QPlatformSurface() |
23 | 0 | { |
24 | |
|
25 | 0 | } |
26 | | |
27 | | QSurface *QPlatformSurface::surface() const |
28 | 0 | { |
29 | 0 | return m_surface; |
30 | 0 | } |
31 | | |
32 | 0 | QPlatformSurface::QPlatformSurface(QSurface *surface) : m_surface(surface) |
33 | 0 | { |
34 | 0 | } |
35 | | |
36 | | #ifndef QT_NO_DEBUG_STREAM |
37 | | Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QPlatformSurface *surface) |
38 | 0 | { |
39 | 0 | QDebugStateSaver saver(debug); |
40 | 0 | debug.nospace(); |
41 | 0 | debug << "QPlatformSurface(" << (const void *)surface; |
42 | 0 | if (surface) { |
43 | 0 | QSurface *s = surface->surface(); |
44 | 0 | auto surfaceClass = s->surfaceClass(); |
45 | 0 | debug << ", class=" << surfaceClass; |
46 | 0 | debug << ", type=" << s->surfaceType(); |
47 | 0 | if (surfaceClass == QSurface::Window) |
48 | 0 | debug << ", window=" << static_cast<QWindow *>(s); |
49 | 0 | else |
50 | 0 | debug << ", surface=" << s; |
51 | 0 | } |
52 | 0 | debug << ')'; |
53 | 0 | return debug; |
54 | 0 | } |
55 | | #endif // !QT_NO_DEBUG_STREAM |
56 | | |
57 | | QT_END_NAMESPACE |
58 | | |