From 28295915bc43e07566cc1e5a5bee6f6d3b9e93d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 18 Mar 2015 16:34:15 +0100 Subject: iOS: Implement basic QPlatformOffscreenSurface subclass Offscreen surface support was added in fb3577039ca8, as the platform supports FBOs, but we need to return a subclass of QPlatformOffscreenSurface that returns true for isValid() and a valid surfaceFormat(). Task-number: QTBUG-39759 Change-Id: If6aa9ee1672984bb93a01a5323af8d93b3b0f2b8 Reviewed-by: Richard Moe Gustavsen Reviewed-by: Laszlo Agocs --- src/plugins/platforms/ios/qiosintegration.mm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/ios/qiosintegration.mm b/src/plugins/platforms/ios/qiosintegration.mm index e395c832f1..7cd4280f5e 100644 --- a/src/plugins/platforms/ios/qiosintegration.mm +++ b/src/plugins/platforms/ios/qiosintegration.mm @@ -46,6 +46,7 @@ #include +#include #include #include @@ -158,9 +159,22 @@ QPlatformOpenGLContext *QIOSIntegration::createPlatformOpenGLContext(QOpenGLCont return new QIOSContext(context); } +class QIOSOffscreenSurface : public QPlatformOffscreenSurface +{ +public: + QIOSOffscreenSurface(QOffscreenSurface *offscreenSurface) : QPlatformOffscreenSurface(offscreenSurface) {} + + QSurfaceFormat format() const Q_DECL_OVERRIDE + { + Q_ASSERT(offscreenSurface()); + return offscreenSurface()->requestedFormat(); + } + bool isValid() const Q_DECL_OVERRIDE { return true; } +}; + QPlatformOffscreenSurface *QIOSIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const { - return new QPlatformOffscreenSurface(surface); + return new QIOSOffscreenSurface(surface); } QAbstractEventDispatcher *QIOSIntegration::createEventDispatcher() const -- cgit v1.2.3