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>
bb10
Tor Arne Vestbø 2020-02-10 21:55:55 +01:00 committed by Tor Arne Vestbø
parent dd04fb639b
commit c3c5a58f65
1 changed files with 2 additions and 1 deletions

View File

@ -574,7 +574,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);
}