summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTor Arne Vestbø <torarnv@gmail.com>2020-02-10 21:55:55 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-02-12 11:07:37 +0100
commit66e06b296357c12f037762ce50092dd230873e32 (patch)
tree3566db69b00e5da71c210f00790dfc9266cdb72e /src
parentabeee8157792d368839601516fc8aca10f19c264 (diff)
macOS: Tag sub-layer images with color space on flush
Failing to tag the image results in costly CPU-based color-space conversions. Change-Id: Ib65547f4b99b83e10d3603c27388f50eb4d3840c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit c3c5a58f654537059366ecd3fe9811716bc202d2) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/cocoa/qcocoabackingstore.mm3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoabackingstore.mm b/src/plugins/platforms/cocoa/qcocoabackingstore.mm
index 68ca98f224..94eb471f5d 100644
--- a/src/plugins/platforms/cocoa/qcocoabackingstore.mm
+++ b/src/plugins/platforms/cocoa/qcocoabackingstore.mm
@@ -586,7 +586,8 @@ void QCALayerBackingStore::flush(QWindow *flushedWindow, const QRegion &region,
qCInfo(lcQpaBackingStore) << "Flushing" << subImage
<< "to" << flushedView.layer << "of subview" << flushedView;
- QCFType<CGImageRef> cgImage = subImage.toCGImage();
+ QCFType<CGImageRef> cgImage = CGImageCreateCopyWithColorSpace(
+ QCFType<CGImageRef>(subImage.toCGImage()), colorSpace());
flushedView.layer.contents = (__bridge id)static_cast<CGImageRef>(cgImage);
}