Skip to contentSkip to conversation

ui/cocoa: Use kCGColorSpaceSRGB

PATCH In review Akihiko Odaki 2 participants 2 messages Mar 5, 2021 – Mar 9, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 ui/cocoa: Use kCGColorSpaceSRGB

kCGColorSpaceGenericRGB | Apple Developer Documentation
https://developer.apple.com/documentation/coregraphics/kcgcolorspacegenericrgb

Quoted 2 lines

Deprecated
Use kCGColorSpaceSRGB instead.

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

---
 ui/cocoa.m | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
ui/cocoa.m +2 -7
index f27beb30e6e..3e1a7b7d519 100644
@@ -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
Signature · 1 line
2.24.3 (Apple Git-128)