diff options
Diffstat (limited to 'src/gui/kernel/qoffscreensurface.cpp')
-rw-r--r-- | src/gui/kernel/qoffscreensurface.cpp | 81 |
1 files changed, 14 insertions, 67 deletions
diff --git a/src/gui/kernel/qoffscreensurface.cpp b/src/gui/kernel/qoffscreensurface.cpp index fbd5c6a079..9875911d30 100644 --- a/src/gui/kernel/qoffscreensurface.cpp +++ b/src/gui/kernel/qoffscreensurface.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtGui module of the Qt Toolkit. @@ -42,7 +42,7 @@ #include "qguiapplication_p.h" #include "qscreen.h" #include "qplatformintegration.h" -#include "qplatformoffscreensurface.h" +#include "qoffscreensurface_p.h" #include "qwindow.h" #include "qplatformwindow.h" @@ -50,6 +50,18 @@ QT_BEGIN_NAMESPACE + +/*! + \fn T QOffScreenSurface::platformInterface<T>() + + Returns a platform interface of type T for the surface. + + This function provides access to platform specific functionality + of QOffScreenSurface, as defined in the QPlatformInterface namespace. + + If the requested interface is not available a \nullptr is returned. +*/ + /*! \class QOffscreenSurface \inmodule QtGui @@ -91,36 +103,6 @@ QT_BEGIN_NAMESPACE native surface. For the use cases of QOffscreenSurface (rendering to FBOs, texture upload) this is not a problem. */ -class Q_GUI_EXPORT QOffscreenSurfacePrivate : public QObjectPrivate -{ - Q_DECLARE_PUBLIC(QOffscreenSurface) - -public: - QOffscreenSurfacePrivate() - : QObjectPrivate() - , surfaceType(QSurface::OpenGLSurface) - , platformOffscreenSurface(nullptr) - , offscreenWindow(nullptr) - , requestedFormat(QSurfaceFormat::defaultFormat()) - , screen(nullptr) - , size(1, 1) - , nativeHandle(nullptr) - { - } - - ~QOffscreenSurfacePrivate() - { - } - - QSurface::SurfaceType surfaceType; - QPlatformOffscreenSurface *platformOffscreenSurface; - QWindow *offscreenWindow; - QSurfaceFormat requestedFormat; - QScreen *screen; - QSize size; - void *nativeHandle; -}; - /*! \since 5.10 @@ -228,8 +210,6 @@ void QOffscreenSurface::destroy() delete d->offscreenWindow; d->offscreenWindow = nullptr; } - - d->nativeHandle = nullptr; } /*! @@ -344,26 +324,6 @@ void QOffscreenSurface::setScreen(QScreen *newScreen) } /*! - Sets the native handle to which the offscreen surface is connected to \a handle. - - The native handle will be resolved in the create() function. Calling - this function after create() will not re-create a native surface. - - \note The interpretation of the native handle is platform specific. Only - some platforms will support adopting native handles of offscreen surfaces - and platforms that do not implement this support will ignore the handle. - - \since 5.9 - \sa nativeHandle() -*/ - -void QOffscreenSurface::setNativeHandle(void *handle) -{ - Q_D(QOffscreenSurface); - d->nativeHandle = handle; -} - -/*! Called when the offscreen surface's screen is destroyed. \internal @@ -395,19 +355,6 @@ QPlatformOffscreenSurface *QOffscreenSurface::handle() const } /*! - Returns an optional native handle to which the offscreen surface is connected. - - \since 5.9 - \sa setNativeHandle() -*/ - -void *QOffscreenSurface::nativeHandle() const -{ - Q_D(const QOffscreenSurface); - return d->nativeHandle; -} - -/*! Returns the platform surface corresponding to the offscreen surface. \internal |