summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-01-02 13:21:58 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-01-07 11:40:00 +0100
commit25e20ae39eb4adf76fc847454efc643778e00b51 (patch)
tree6346eb006c1158cd7164ba0df65ececabbe3a9e9 /src
parent2a0186420c7b85eb1d6bc434846f6c2d1cbb604a (diff)
macOS: Handle missing color space information in IOSurface backingstore
Fixes: QTBUG-80972 Change-Id: Iab3f1a9cf03251340e5f32bcc73103428e93282d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 105e662221cc90d5002e06c97febf50c5c601336)
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.mm13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.mm b/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.mm
index 285e316d4a..fc187e0f51 100644
--- a/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.mm
+++ b/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.mm
@@ -89,9 +89,16 @@ QIOSurfaceGraphicsBuffer::~QIOSurfaceGraphicsBuffer()
void QIOSurfaceGraphicsBuffer::setColorSpace(QCFType<CGColorSpaceRef> colorSpace)
{
- Q_ASSERT(colorSpace);
- IOSurfaceSetValue(m_surface, CFSTR("IOSurfaceColorSpace"),
- QCFType<CFPropertyListRef>(CGColorSpaceCopyPropertyList(colorSpace)));
+ static const auto kIOSurfaceColorSpace = CFSTR("IOSurfaceColorSpace");
+
+ qCDebug(lcQpaIOSurface) << "Tagging" << this << "with color space" << colorSpace;
+
+ if (colorSpace) {
+ IOSurfaceSetValue(m_surface, kIOSurfaceColorSpace,
+ QCFType<CFPropertyListRef>(CGColorSpaceCopyPropertyList(colorSpace)));
+ } else {
+ IOSurfaceRemoveValue(m_surface, kIOSurfaceColorSpace);
+ }
}
const uchar *QIOSurfaceGraphicsBuffer::data() const