Qt
6.x
The Qt SDK
Loading...
Searching...
No Matches
qsurface.cpp
Go to the documentation of this file.
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 "
qsurface.h
"
5
#include "
qopenglcontext.h
"
6
#include <qpa/qplatformintegration.h>
7
#include <QtGui/private/qguiapplication_p.h>
8
9
QT_BEGIN_NAMESPACE
10
11
QT_IMPL_METATYPE_EXTERN_TAGGED
(
QSurface
*, QSurface_ptr)
12
13
70
bool
QSurface
::supportsOpenGL()
const
71
{
72
SurfaceType
type
= surfaceType();
73
if
(
type
== RasterSurface) {
74
QPlatformIntegration
*integ =
QGuiApplicationPrivate::instance
()->
platformIntegration
();
75
return
integ->
hasCapability
(
QPlatformIntegration::OpenGLOnRasterSurface
);
76
}
77
return
type
== OpenGLSurface ||
type
== RasterGLSurface;
78
}
79
101
QSurface::QSurface
(
SurfaceClass
type
)
102
: m_type(
type
), m_reserved(
nullptr
)
103
{
104
}
105
109
QSurface::~QSurface
()
110
{
111
#ifndef QT_NO_OPENGL
112
QOpenGLContext
*
context
=
QOpenGLContext::currentContext
();
113
if
(
context
&&
context
->surface() ==
this
)
114
context
->doneCurrent();
115
#endif
116
}
117
121
QSurface::SurfaceClass
QSurface::surfaceClass
()
const
122
{
123
return
m_type
;
124
}
125
126
QT_END_NAMESPACE
127
128
#include "moc_qsurface.cpp"
129
QGuiApplicationPrivate::platformIntegration
static QPlatformIntegration * platformIntegration()
Definition
qguiapplication_p.h:88
QGuiApplicationPrivate::instance
static QGuiApplicationPrivate * instance()
Definition
qguiapplication_p.h:181
QOpenGLContext
\inmodule QtGui
Definition
qopenglcontext.h:67
QOpenGLContext::currentContext
static QOpenGLContext * currentContext()
Returns the last context which called makeCurrent in the current thread, or \nullptr,...
Definition
qopenglcontext.cpp:209
QPlatformIntegration
The QPlatformIntegration class is the entry for WindowSystem specific functionality.
Definition
qplatformintegration.h:73
QPlatformIntegration::hasCapability
virtual bool hasCapability(Capability cap) const
Definition
qplatformintegration.cpp:252
QPlatformIntegration::OpenGLOnRasterSurface
@ OpenGLOnRasterSurface
Definition
qplatformintegration.h:97
QSurface
\inmodule QtGui
Definition
qsurface.h:21
QSurface::surfaceClass
SurfaceClass surfaceClass() const
Returns the surface class of this surface.
Definition
qsurface.cpp:121
QSurface::SurfaceType
SurfaceType
The SurfaceType enum describes what type of surface this is.
Definition
qsurface.h:30
QSurface::QSurface
QSurface(SurfaceClass type)
Creates a surface with the given type.
Definition
qsurface.cpp:101
QSurface::~QSurface
virtual ~QSurface()
Destroys the surface.
Definition
qsurface.cpp:109
QSurface::m_type
SurfaceClass m_type
Definition
qsurface.h:56
QSurface::SurfaceClass
SurfaceClass
The SurfaceClass enum describes the actual subclass of the surface.
Definition
qsurface.h:24
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1545
context
static void * context
Definition
qandroidaudiosource.cpp:42
QT_IMPL_METATYPE_EXTERN_TAGGED
#define QT_IMPL_METATYPE_EXTERN_TAGGED(TYPE, TAG)
Definition
qmetatype.h:1363
qopenglcontext.h
type
GLenum type
Definition
qopengles2ext.h:150
qsurface.h
nullptr
QObject::connect nullptr
Definition
src_corelib_kernel_qobject.cpp:255
qtbase
src
gui
kernel
qsurface.cpp
Generated by
1.9.7