mirror of https://github.com/qt/qtbase.git
macOS: Don’t color convert the backing store
The backing store was assigned the sRGB color profile
as an unintended side effect of the QImage -> CGImage
conversion function refactoring in ac899f6d
. This
caused Core Graphics to add a color convert step, which
in some cases caused performance issues.
Restore fast, previous behavior by assigning the target
display color profile to the backing store image.
Color correctness is still a goal, but we’ll add API
for it and make it opt-in.
Task-number: QTBUG-61384
Change-Id: I107f06a881a34fa711b386265d8dc2edfb246624
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
c7766a41e3
commit
0adc14d8db
|
@ -516,7 +516,13 @@ static bool _q_dontOverrideCtrlLMB = false;
|
|||
dirtyBackingRect.size.height
|
||||
);
|
||||
CGImageRef bsCGImage = qt_mac_toCGImage(m_backingStore->toImage());
|
||||
CGImageRef cleanImg = CGImageCreateWithImageInRect(bsCGImage, backingStoreRect);
|
||||
|
||||
// Prevent potentially costly color conversion by assiging the display
|
||||
// color space to the backingstore image.
|
||||
CGImageRef displayColorSpaceImage = CGImageCreateCopyWithColorSpace(bsCGImage,
|
||||
self.window.screen.colorSpace.CGColorSpace);
|
||||
|
||||
CGImageRef cleanImg = CGImageCreateWithImageInRect(displayColorSpaceImage, backingStoreRect);
|
||||
|
||||
// Optimization: Copy frame buffer content instead of blending for
|
||||
// top-level windows where Qt fills the entire window content area.
|
||||
|
@ -531,6 +537,7 @@ static bool _q_dontOverrideCtrlLMB = false;
|
|||
CGImageRelease(cleanImg);
|
||||
CGImageRelease(subMask);
|
||||
CGImageRelease(bsCGImage);
|
||||
CGImageRelease(displayColorSpaceImage);
|
||||
}
|
||||
|
||||
- (BOOL) isFlipped
|
||||
|
|
Loading…
Reference in New Issue