13#include <private/qwindow_p.h>
75 d->screen = targetScreen;
102 return d->surfaceType;
120 if (!
d->platformOffscreenSurface && !
d->offscreenWindow) {
123 if (!
d->platformOffscreenSurface) {
125 qWarning(
"Attempting to create QWindow-based QOffscreenSurface outside the gui thread. Expect failures.");
126 d->offscreenWindow =
new QWindow(
d->screen);
129 d->offscreenWindow->setFlags(
d->offscreenWindow->flags()
131 d->offscreenWindow->setObjectName(
"QOffscreenSurface"_L1);
136 d->offscreenWindow->setFormat(
d->requestedFormat);
139 d->offscreenWindow->setGeometry(0, 0,
d->size.width(),
d->size.height());
140 d->offscreenWindow->create();
160 delete d->platformOffscreenSurface;
161 d->platformOffscreenSurface =
nullptr;
162 if (
d->offscreenWindow) {
163 d->offscreenWindow->destroy();
164 delete d->offscreenWindow;
165 d->offscreenWindow =
nullptr;
179 return (
d->platformOffscreenSurface &&
d->platformOffscreenSurface->isValid())
180 || (
d->offscreenWindow &&
d->offscreenWindow->handle());
210 return d->requestedFormat;
225 if (
d->platformOffscreenSurface)
226 return d->platformOffscreenSurface->format();
227 if (
d->offscreenWindow)
228 return d->offscreenWindow->format();
229 return d->requestedFormat;
264 if (newScreen !=
d->screen) {
265 const bool wasCreated =
d->platformOffscreenSurface !=
nullptr ||
d->offscreenWindow !=
nullptr;
270 d->screen = newScreen;
285void QOffscreenSurface::screenDestroyed(
QObject *
object)
288 if (
object ==
static_cast<QObject *
>(
d->screen))
308 return d->platformOffscreenSurface;
332 if (
d->offscreenWindow)
333 return d->offscreenWindow->handle();
335 return d->platformOffscreenSurface;
340void *QOffscreenSurface::resolveInterface(
const char *
name,
int revision)
const
347#if defined(Q_OS_ANDROID)
356#include "moc_qoffscreensurface.cpp"
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
static QCoreApplication * instance() noexcept
Returns a pointer to the application's QCoreApplication (or QGuiApplication/QApplication) instance.
static QPlatformIntegration * platformIntegration()
static QWindowList window_list
QScreen * primaryScreen
the primary (or default) screen of the application.
bool removeOne(const AT &t)
Native interface to a offscreen surface on Android.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
void destroyed(QObject *=nullptr)
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointe...
QPlatformOffscreenSurface * handle() const
Returns the platform offscreen surface corresponding to the offscreen surface.
SurfaceType surfaceType() const override
Returns the surface type of the offscreen surface.
QPlatformSurface * surfaceHandle() const override
Returns the platform surface corresponding to the offscreen surface.
~QOffscreenSurface()
Destroys the offscreen surface.
QOffscreenSurface(QScreen *screen=nullptr, QObject *parent=nullptr)
QSurfaceFormat format() const override
Returns the actual format of this offscreen surface.
void setScreen(QScreen *screen)
Sets the screen to which the offscreen surface is connected.
QScreen * screen() const
Returns the screen to which the offscreen surface is connected.
QSurfaceFormat requestedFormat() const
Returns the requested surfaceformat of this offscreen surface.
void create()
Allocates the platform resources associated with the offscreen surface.
bool isValid() const
Returns true if this offscreen surface is valid; otherwise returns false.
void destroy()
Releases the native platform resources associated with this offscreen surface.
QSize size() const override
Returns the size of the offscreen surface.
void setFormat(const QSurfaceFormat &format)
Sets the offscreen surface format.
void screenChanged(QScreen *screen)
This signal is emitted when an offscreen surface's screen changes, either by being set explicitly wit...
The QScreen class is used to query screen properties. \inmodule QtGui.
SurfaceType
The SurfaceType enum describes what type of surface this is.
static QThread * currentThread()
void setAutomaticPositionAndResizeEnabled(bool a)
Combined button and popup list for selecting options.
#define QT_NATIVE_INTERFACE_RETURN_IF(NativeInterface, baseType)
GLint GLsizei GLsizei GLenum format
Q_GUI_EXPORT QWindowPrivate * qt_window_private(QWindow *window)
myObject disconnect()
[26]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent