void canvasDestroyed(QQuickCanvas *canvas);
- void paint(QQuickCanvas *canvas);
+ void exposureChanged(QQuickCanvas *canvas);
QImage grab(QQuickCanvas *canvas);
void resize(QQuickCanvas *canvas, const QSize &size);
void handleDeferredUpdate();
void initializeGL();
void renderCanvas(QQuickCanvas *canvas);
- void paint(QQuickCanvas *canvas);
+ void exposureChanged(QQuickCanvas *canvas);
QImage grab(QQuickCanvas *canvas);
void resize(QQuickCanvas *canvas, const QSize &size);
void wakeup();
static QQuickWindowManager *theInstance;
if (!theInstance) {
- bool fancy = QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedOpenGL);
+
+ theInstance = QSGContext::createWindowManager();
+
+ bool fancy = QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::BufferQueueingOpenGL);
if (qmlNoThreadedRenderer())
fancy = false;
+
if (qmlFixedAnimationStep())
QUnifiedTimer::instance(true)->setConsistentTiming(true);
- theInstance = fancy
- ? (QQuickWindowManager*) new QQuickRenderThreadSingleContextWindowManager
- : (QQuickWindowManager*) new QQuickTrivialWindowManager;
+
+ if (!theInstance) {
+ theInstance = fancy
+ ? (QQuickWindowManager*) new QQuickRenderThreadSingleContextWindowManager
+ : (QQuickWindowManager*) new QQuickTrivialWindowManager;
+ }
}
return theInstance;
}
}
-void QQuickRenderThreadSingleContextWindowManager::paint(QQuickCanvas *canvas)
+void QQuickRenderThreadSingleContextWindowManager::exposureChanged(QQuickCanvas *canvas)
{
Q_UNUSED(canvas);
#ifdef THREAD_DEBUG
- printf("GUI: paint called: %p\n", canvas);
+ printf("GUI: exposure changed: %p\n", canvas);
#endif
- lockInGui();
- exhaustSyncEvent();
-
- isPaintCompleted = false;
- while (isRunning() && !isPaintCompleted) {
- if (isRenderBlocked)
- wake();
- wait();
- }
- unlockInGui();
-
#ifdef THREAD_DEBUG
- printf("GUI: paint done: %p\n", canvas);
+ printf("GUI: exposure changed done: %p\n", canvas);
#endif
}
maybeUpdate(canvas);
}
-void QQuickTrivialWindowManager::paint(QQuickCanvas *canvas)
+void QQuickTrivialWindowManager::exposureChanged(QQuickCanvas *canvas)
{
- if (!m_windows.contains(canvas))
- return;
-
- m_windows[canvas].updatePending = true;
- renderCanvas(canvas);
}
QImage QQuickTrivialWindowManager::grab(QQuickCanvas *canvas)
#define QQUICKWINDOWMANAGER_P_H
#include <QtGui/QImage>
+#include <qtquickglobal.h>
QT_BEGIN_NAMESPACE
class QQuickCanvas;
class QSGContext;
-class QQuickWindowManager
+class Q_QUICK_EXPORT QQuickWindowManager
{
public:
virtual ~QQuickWindowManager();
virtual void canvasDestroyed(QQuickCanvas *canvas) = 0;
- virtual void paint(QQuickCanvas *canvas) = 0;
+ virtual void exposureChanged(QQuickCanvas *canvas) = 0;
virtual QImage grab(QQuickCanvas *canvas) = 0;
virtual void resize(QQuickCanvas *canvas, const QSize &size) = 0;
class QSGContext;
+class QQuickWindowManager;
+
struct Q_QUICK_EXPORT QSGContextFactoryInterface : public QFactoryInterface
{
virtual QSGContext *create(const QString &key) const = 0;
virtual QQuickTextureFactory *createTextureFactoryFromImage(const QImage &image) = 0;
+ virtual QQuickWindowManager *createWindowManager() = 0;
};
#define QSGContextFactoryInterface_iid \
virtual QSGContext *create(const QString &key) const = 0;
virtual QQuickTextureFactory *createTextureFactoryFromImage(const QImage &) { return 0; }
+ virtual QQuickWindowManager *createWindowManager() { return 0; }
};
QT_END_NAMESPACE