diff --git a/src/plugins/platforms/ios/qiosintegration.mm b/src/plugins/platforms/ios/qiosintegration.mm index e395c832f1b..7cd4280f5e7 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