/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 | | |
4 | | #include "qplatformsurface.h" |
5 | | #ifndef QT_NO_DEBUG_STREAM |
6 | | #include <QtCore/qdebug.h> |
7 | | #include <QtGui/qwindow.h> |
8 | | #endif |
9 | | |
10 | | QT_BEGIN_NAMESPACE |
11 | | |
12 | | /*! |
13 | | \class QPlatformSurface |
14 | | \since 5.0 |
15 | | \internal |
16 | | \preliminary |
17 | | \ingroup qpa |
18 | | |
19 | | \brief The QPlatformSurface class provides an abstraction for a surface. |
20 | | */ |
21 | | QPlatformSurface::~QPlatformSurface() |
22 | 0 | { |
23 | |
|
24 | 0 | } |
25 | | |
26 | | QSurface *QPlatformSurface::surface() const |
27 | 0 | { |
28 | 0 | return m_surface; |
29 | 0 | } |
30 | | |
31 | 0 | QPlatformSurface::QPlatformSurface(QSurface *surface) : m_surface(surface) |
32 | 0 | { |
33 | 0 | } |
34 | | |
35 | | #ifndef QT_NO_DEBUG_STREAM |
36 | | Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QPlatformSurface *surface) |
37 | 0 | { |
38 | 0 | QDebugStateSaver saver(debug); |
39 | 0 | debug.nospace(); |
40 | 0 | debug << "QPlatformSurface(" << (const void *)surface; |
41 | 0 | if (surface) { |
42 | 0 | QSurface *s = surface->surface(); |
43 | 0 | auto surfaceClass = s->surfaceClass(); |
44 | 0 | debug << ", class=" << surfaceClass; |
45 | 0 | debug << ", type=" << s->surfaceType(); |
46 | 0 | if (surfaceClass == QSurface::Window) |
47 | 0 | debug << ", window=" << static_cast<QWindow *>(s); |
48 | 0 | else |
49 | 0 | debug << ", surface=" << s; |
50 | 0 | } |
51 | 0 | debug << ')'; |
52 | 0 | return debug; |
53 | 0 | } |
54 | | #endif // !QT_NO_DEBUG_STREAM |
55 | | |
56 | | QT_END_NAMESPACE |
57 | | |