[PATCH v4] ui/cocoa: Use kCGColorSpaceSRGB

Akihiko Odaki posted 1 patch 3 years, 1 month ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210305121304.65096-1-akihiko.odaki@gmail.com
Maintainers: Gerd Hoffmann <kraxel@redhat.com>, Peter Maydell <peter.maydell@linaro.org>
ui/cocoa.m | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
[PATCH v4] ui/cocoa: Use kCGColorSpaceSRGB
Posted by Akihiko Odaki 3 years, 1 month ago
kCGColorSpaceGenericRGB | Apple Developer Documentation
https://developer.apple.com/documentation/coregraphics/kcgcolorspacegenericrgb
> Deprecated
> Use kCGColorSpaceSRGB instead.

This change also removes the legacy color space specification for
PowerPC.

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
---
 ui/cocoa.m | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/ui/cocoa.m b/ui/cocoa.m
index f27beb30e6e..3e1a7b7d519 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -463,13 +463,8 @@ - (void) drawRect:(NSRect) rect
             DIV_ROUND_UP(bitsPerPixel, 8) * 2, //bitsPerComponent
             bitsPerPixel, //bitsPerPixel
             stride, //bytesPerRow
-#ifdef __LITTLE_ENDIAN__
-            CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB), //colorspace for OS X >= 10.4
-            kCGBitmapByteOrder32Little | kCGImageAlphaNoneSkipFirst,
-#else
-            CGColorSpaceCreateDeviceRGB(), //colorspace for OS X < 10.4 (actually ppc)
-            kCGImageAlphaNoneSkipFirst, //bitmapInfo
-#endif
+            CGColorSpaceCreateWithName(kCGColorSpaceSRGB), //colorspace
+            kCGBitmapByteOrder32Little | kCGImageAlphaNoneSkipFirst, //bitmapInfo
             dataProviderRef, //provider
             NULL, //decode
             0, //interpolate
-- 
2.24.3 (Apple Git-128)


Re: [PATCH v4] ui/cocoa: Use kCGColorSpaceSRGB
Posted by Gerd Hoffmann 3 years, 1 month ago
On Fri, Mar 05, 2021 at 09:13:04PM +0900, Akihiko Odaki wrote:
> kCGColorSpaceGenericRGB | Apple Developer Documentation
> https://developer.apple.com/documentation/coregraphics/kcgcolorspacegenericrgb
> > Deprecated
> > Use kCGColorSpaceSRGB instead.
> 
> This change also removes the legacy color space specification for
> PowerPC.

Added to UI queue.

thanks,
  Gerd