diff options
author | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2015-03-18 16:34:15 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2015-03-25 19:43:24 +0000 |
commit | 28295915bc43e07566cc1e5a5bee6f6d3b9e93d7 (patch) | |
tree | 3f90130f01517f15b215843cc0ead03f23195073 | |
parent | 909e2b17cbc1e18f9347cb986b5af53f50aeddc5 (diff) |
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 <richard.gustavsen@theqtcompany.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
-rw-r--r-- | src/plugins/platforms/ios/qiosintegration.mm | 16 |
1 files changed, 15 insertions, 1 deletions
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 <QtGui/private/qguiapplication_p.h> +#include <qoffscreensurface.h> #include <qpa/qplatformoffscreensurface.h> #include <QtPlatformSupport/private/qcoretextfontdatabase_p.h> @@ -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 |