Qt draws the backing store to the window using CoreGrahics,
which will trigger a slow RGB32 -> RGB64 conversion
when the output display is a deep color display.
Disable NSWindow dynamicDepthLimit and force the depthLimit
to WindowDepthTwentyforBitRGB for the common case of
8-bit-per-component raster surfaces.
This was benchmarked by resizing a simple QRasterWindow
test case which fills the window area using QPainter::fillRect().
Before:
67.1% rgba64_image_mark_rgb32
10.8% __vImageCopyBuffer_block_invoke
6.0% madvise
5.0% _kernelrpc_mach_vm_deallocate_trap
4.1% qt_memfill32(unsigned int*, unsigned int, int)
After:
30.7% __vImageCopyBuffer_block_invoke
20.3% madvise
12.3% __vOverwriteChannelsWithScalar_ARGB8888_block_invoke
12.2% qt_memfill32(unsigned int*, unsigned int, int)
4.6% _kernelrpc_mach_vm_deallocate_trap
The test program now spends significantly more of its
time allocating/deallocating the backing store (madvise),
and running the Qt paint event (qt_memfill32).
Task-number: QTBUG-47660
Change-Id: I878be7a0e6eee4ad798f7a53f7f9f79b7950af26
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>