summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@digia.com>2014-03-17 13:26:26 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-20 08:35:24 +0100
commita466743f744e41bfdf0f7333b452a02ecc31dbbb (patch)
treead0f13f5cd7aa2e7baef89215b65415df73abea2
parent1cc421eb250a2fabe55133155a5c5ab8a0e5dd31 (diff)
Cocoa: Enable QQuickWidget on Mac OS X.
Change-Id: I0635bf0bfcd49c20987a81c6f8895fc3343fbd20 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
-rw-r--r--src/plugins/platforms/cocoa/qcocoabackingstore.h1
-rw-r--r--src/plugins/platforms/cocoa/qcocoabackingstore.mm5
-rw-r--r--src/plugins/platforms/cocoa/qcocoaglcontext.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm1
4 files changed, 8 insertions, 1 deletions
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 &region, 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 &region, 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);