animationController->advance();
emit q->beforeRendering();
runAndClearJobs(&beforeRenderingJobs);
- int fboId = 0;
- const qreal devicePixelRatio = q->effectiveDevicePixelRatio();
- renderer->setDeviceRect(QRect(QPoint(0, 0), size * devicePixelRatio));
- if (renderTargetId) {
- fboId = renderTargetId;
- renderer->setViewportRect(QRect(QPoint(0, 0), renderTargetSize));
- } else {
- renderer->setViewportRect(QRect(QPoint(0, 0), size * devicePixelRatio));
- }
- renderer->setProjectionMatrixToRect(QRect(QPoint(0, 0), size));
- renderer->setDevicePixelRatio(devicePixelRatio);
+ if (!customRenderStage || !customRenderStage->render()) {
+ int fboId = 0;
- const qreal devicePixelRatio = q->devicePixelRatio();
++ const qreal devicePixelRatio = q->effectiveDevicePixelRatio();
+ renderer->setDeviceRect(QRect(QPoint(0, 0), size * devicePixelRatio));
+ if (renderTargetId) {
+ fboId = renderTargetId;
+ renderer->setViewportRect(QRect(QPoint(0, 0), renderTargetSize));
+ } else {
+ renderer->setViewportRect(QRect(QPoint(0, 0), size * devicePixelRatio));
+ }
+ renderer->setProjectionMatrixToRect(QRect(QPoint(0, 0), size));
- renderer->setDevicePixelRatio(q->devicePixelRatio());
++ renderer->setDevicePixelRatio(devicePixelRatio);
- context->renderNextFrame(renderer, fboId);
+ context->renderNextFrame(renderer, fboId);
+ }
-
emit q->afterRendering();
runAndClearJobs(&afterRenderingJobs);
}
if (profileFrames)
renderTime = renderTimer.nsecsElapsed();
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame);
if (data.grabOnly) {
- grabContent = qt_gl_read_framebuffer(window->size() * window->devicePixelRatio(), false, false);
+ grabContent = qt_gl_read_framebuffer(window->size() * window->effectiveDevicePixelRatio(), false, false);
data.grabOnly = false;
}
qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "syncAndRender()";
syncResultedInChanges = false;
+ QQuickWindowPrivate *d = QQuickWindowPrivate::get(window);
- uint pending = pendingUpdate;
+ bool repaintRequested = (pendingUpdate & RepaintRequest) || d->customRenderStage;
+ bool syncRequested = pendingUpdate & SyncRequest;
+ bool exposeRequested = (pendingUpdate & ExposeRequest) == ExposeRequest;
pendingUpdate = 0;
- if (pending & SyncRequest) {
+ if (syncRequested) {
qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "- updatePending, doing sync";
- sync(pending == ExposeRequest);
+ sync(exposeRequested);
}
+ #ifndef QSG_NO_RENDER_TIMING
+ if (profileFrames)
+ syncTime = threadTimer.nsecsElapsed();
+ #endif
++ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame);
- if (!syncResultedInChanges && ((pending & RepaintRequest) == 0)) {
+ if (!syncResultedInChanges && !repaintRequested) {
qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "- no changes, render aborted";
int waitTime = vsyncDelta - (int) waitTimer.elapsed();
if (waitTime > 0)
return;
}
- if (profileFrames)
- syncTime = threadTimer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame);
-
qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "- rendering started";
- QQuickWindowPrivate *d = QQuickWindowPrivate::get(window);
if (animatorDriver->isRunning()) {
d->animationController->lock();