7#include <QtCore/QCoreApplication>
9#include <QtQuick/private/qquickanimatorcontroller_p.h>
10#include <QtQuick/private/qsgdefaultrendercontext_p.h>
11#include <QtQuick/private/qsgrhisupport_p.h>
13#include <private/qsgrhishadereffectnode_p.h>
15#include <QtGui/private/qguiapplication_p.h>
16#include <qpa/qplatformintegration.h>
17#include <QtGui/qoffscreensurface.h>
19#include <QtQml/private/qqmlglobal_p.h>
21#include <QtQuick/QQuickWindow>
22#include <QtQuick/QQuickRenderTarget>
23#include <QtQuick/private/qquickwindow_p.h>
24#include <QtQuick/private/qquickitem_p.h>
25#include <QtQuick/private/qsgsoftwarerenderer_p.h>
26#include <QtCore/private/qobject_p.h>
28#include <QtQuick/private/qquickwindow_p.h>
125 frameStatus(NotRecordingFrame)
178 d->windowDestroyed();
200#if QT_CONFIG(quick_shadereffect)
218 d->rc->moveToThread(targetThread);
238 d->sampleCount =
qMax(1, sampleCount);
249 return d->sampleCount;
292 qWarning(
"QQuickRenderControl::initialize called with no associated window");
306 params.sampleCount =
d->sampleCount;
307 params.initialSurfacePixelSize =
d->window->size() *
d->window->effectiveDevicePixelRatio();
308 params.maybeSurface =
d->window;
310 d->initialized =
true;
312 qWarning(
"QRhi is only compatible with default adaptation");
334 emit d->window->afterAnimating();
355 if (!
d->rhi->isRecordingFrame()) {
356 qWarning(
"QQuickRenderControl can only sync when beginFrame() has been called");
360 qWarning(
"QQuickRenderControl cannot be used with QRhi when no QRhiCommandBuffer is provided");
408 d->initialized =
false;
423 if (!
d->rhi->isRecordingFrame()) {
424 qWarning(
"QQuickRenderControl can only render when beginFrame() has been called");
428 qWarning(
"QQuickRenderControl cannot be used with QRhi when no QRhiCommandBuffer is provided");
480 if (softwareRenderer) {
494 qWarning(
"QQuickRenderControl: grabs are not supported with the current Qt Quick backend");
503 emit q->renderRequested();
509 emit q->sceneChanged();
557 return q->renderWindowFor(
window,
nullptr) ==
w;
653 if (!
d->rhi ||
d->rhi->isRecordingFrame())
656 emit d->window->beforeFrameBegin();
692 if (!
d->rhi || !
d->rhi->isRecordingFrame())
695 d->rhi->endOffscreenFrame();
699 emit d->window->afterFrameEnd();
716 qWarning(
"QQuickRenderControl: No QVulkanInstance set for QQuickWindow, cannot initialize");
727 qWarning(
"QQuickRenderControl: Failed to initialize QRhi");
750#include "moc_qquickrendercontrol.cpp"
@ Format_ARGB32_Premultiplied
void setDevicePixelRatio(qreal scaleFactor)
Sets the device pixel ratio for the image.
void moveToThread(QThread *thread)
Changes the thread affinity for this object and its children.
\inmodule QtCore\reentrant
void flushFrameSynchronousEvents(QQuickWindow *win)
QQuickGraphicsConfiguration controls lower level graphics settings for the QQuickWindow.
void resetRhi(const QQuickGraphicsConfiguration &config)
QQuickRenderControlPrivate(QQuickRenderControl *renderControl)
QOffscreenSurface * offscreenSurface
static QQuickRenderControlPrivate * get(QQuickRenderControl *renderControl)
virtual bool isRenderWindow(const QWindow *w)
static bool isRenderWindowFor(QQuickWindow *quickWin, const QWindow *renderWin)
The QQuickRenderControl class provides a mechanism for rendering the Qt Quick scenegraph onto an offs...
virtual QWindow * renderWindow(QPoint *offset)
Reimplemented in subclasses to return the real window this render control is rendering into.
bool initialize()
Initializes the scene graph resources.
void endFrame()
Specifies the end of a graphics frame.
void prepareThread(QThread *targetThread)
Prepares rendering the Qt Quick scene outside the GUI thread.
void render()
Renders the scenegraph using the current context.
void setSamples(int sampleCount)
Sets the number of samples to use for multisampling.
~QQuickRenderControl() override
Destroys the instance.
QQuickRenderControl(QObject *parent=nullptr)
Constructs a QQuickRenderControl object, with parent object parent.
static QWindow * renderWindowFor(QQuickWindow *win, QPoint *offset=nullptr)
Returns the real window that win is being rendered to, if any.
QRhiCommandBuffer * commandBuffer() const
void beginFrame()
Specifies the start of a graphics frame.
void polishItems()
This function should be called as late as possible before sync().
QQuickWindow * window() const
bool sync()
This function is used to synchronize the QML scene with the rendering scene graph.
void invalidate()
Stop rendering and release resources.
QQuickGraphicsConfiguration graphicsConfig
static QQuickWindowPrivate * get(QQuickWindow *c)
QQuickRenderControl * renderControl
void cleanupNodesOnShutdown()
void setCustomCommandBuffer(QRhiCommandBuffer *cb)
QQuickDeliveryAgentPrivate * deliveryAgentPrivate() const
QScopedPointer< QQuickAnimatorController > animationController
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
FrameOpResult
Describes the result of operations that can have a soft failure.
@ FrameOpSwapChainOutOfDate
The QSGContext holds the scene graph entry points for one QML engine.
virtual QSGRenderContext * createRenderContext()=0
static QSGContext * createDefaultContext()
Creates a default scene graph context for the current hardware.
void initialize(const QSGRenderContext::InitParams *params) override
Initializes the scene graph render context with the GL context context.
virtual void invalidate()
virtual GraphicsApi graphicsApi() const =0
Returns the graphics API that is in use by the Qt Quick scenegraph.
static void resetMaterialTypeCache(void *materialTypeCacheKey)
QOffscreenSurface * maybeCreateOffscreenSurface(QWindow *window)
QRhi::Implementation rhiBackend() const
void destroyRhi(QRhi *rhi, const QQuickGraphicsConfiguration &config)
static QSGRhiSupport * instance()
RhiCreateResult createRhi(QQuickWindow *window, QSurface *offscreenSurface)
QPaintDevice * currentPaintDevice() const
void setCurrentPaintDevice(QPaintDevice *device)
void reset(T *other=nullptr) noexcept(noexcept(Cleanup::cleanup(std::declval< T * >())))
Deletes the existing object it is pointing to (if any), and sets its pointer to other.
Combined button and popup list for selecting options.
void qAddPostRoutine(QtCleanUpFunction p)
constexpr const T & qMax(const T &a, const T &b)
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr offset
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei imageSize
GLdouble GLdouble GLdouble GLdouble q
static QT_BEGIN_NAMESPACE qreal dpr(const QWindow *w)
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent