// has a canvas..
rootItem->setFocus(true);
- thread = qmlNoThreadedRenderer()
- ? static_cast<QSGCanvasRenderLoop *>(new QSGCanvasPlainRenderLoop())
- : static_cast<QSGCanvasRenderLoop *>(new QSGCanvasRenderThread());
+ bool threaded = !qmlNoThreadedRenderer();
+
+ if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedOpenGL)) {
+ qWarning("QSGCanvas: platform does not support threaded rendering!");
+ threaded = false;
+ }
+
+ if (threaded)
+ thread = new QSGCanvasRenderThread();
+ else
+ thread = new QSGCanvasPlainRenderLoop();
+
thread->renderer = q;
thread->d = this;
context = QSGContext::createDefaultContext();
- thread->moveCanvasToThread(context);
+ thread->moveContextToThread(context);
}
void QSGCanvasPrivate::sceneMouseEventForTransform(QGraphicsSceneMouseEvent &sceneEvent,
virtual bool isRunning() const = 0;
virtual void animationStarted() = 0;
virtual void animationStopped() = 0;
- virtual void moveCanvasToThread(QSGContext *) { }
+ virtual void moveContextToThread(QSGContext *) { }
protected:
void initializeSceneGraph() { d->initializeSceneGraph(); }
bool isRunning() const { return QThread::isRunning(); }
void setWindowSize(const QSize &size) { windowSize = size; }
void maybeUpdate();
- void moveCanvasToThread(QSGCanvas *c) { c->moveToThread(this); }
+ void moveContextToThread(QSGContext *c) { c->moveToThread(this); }
bool event(QEvent *);