diff --git a/src/plugins/platforms/cocoa/qcocoabackingstore.h b/src/plugins/platforms/cocoa/qcocoabackingstore.h index ce8ebbc79e..a33373c4c1 100644 --- a/src/plugins/platforms/cocoa/qcocoabackingstore.h +++ b/src/plugins/platforms/cocoa/qcocoabackingstore.h @@ -59,6 +59,7 @@ public: QPaintDevice *paintDevice(); void flush(QWindow *widget, const QRegion ®ion, const QPoint &offset); + QImage toImage() const Q_DECL_OVERRIDE; void resize (const QSize &size, const QRegion &); bool scroll(const QRegion &area, int dx, int dy); CGImageRef getBackingStoreCGImage(); diff --git a/src/plugins/platforms/cocoa/qcocoabackingstore.mm b/src/plugins/platforms/cocoa/qcocoabackingstore.mm index 2222b51a42..d76645c668 100644 --- a/src/plugins/platforms/cocoa/qcocoabackingstore.mm +++ b/src/plugins/platforms/cocoa/qcocoabackingstore.mm @@ -96,6 +96,11 @@ void QCocoaBackingStore::flush(QWindow *win, const QRegion ®ion, const QPoint } } +QImage QCocoaBackingStore::toImage() const +{ + return m_qImage; +} + void QCocoaBackingStore::resize(const QSize &size, const QRegion &) { m_requestedSize = size; diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm index 9b4d8fd96f..3f61bd81ee 100644 --- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm +++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm @@ -194,7 +194,7 @@ void QCocoaGLContext::swapBuffers(QPlatformSurface *surface) bool QCocoaGLContext::makeCurrent(QPlatformSurface *surface) { - Q_ASSERT(surface->surface()->surfaceType() == QSurface::OpenGLSurface); + Q_ASSERT(surface->surface()->supportsOpenGL()); QCocoaAutoReleasePool pool; diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index d612c7ff28..65a9f87e2d 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -375,6 +375,7 @@ bool QCocoaIntegration::hasCapability(QPlatformIntegration::Capability cap) cons case WindowMasks: case MultipleWindows: case ForeignWindows: + case RasterGLSurface: return true; default: return QPlatformIntegration::hasCapability(cap);