summaryrefslogtreecommitdiffstats
path: root/osdep/macOS_swift_compat.swift
diff options
context:
space:
mode:
authorder richter <der.richter@gmx.de>2019-05-25 19:29:34 +0200
committerder richter <der.richter@gmx.de>2019-09-26 00:02:02 +0200
commit41f290f54e385f28257bd24e8f399bcb7f3727b7 (patch)
tree582575468126b095b5dcb435b7b93bf283bf4716 /osdep/macOS_swift_compat.swift
parentff2aed2b56e43665e2b10acf06fa107877799bec (diff)
downloadmpv-41f290f54e385f28257bd24e8f399bcb7f3727b7.tar.bz2
mpv-41f290f54e385f28257bd24e8f399bcb7f3727b7.tar.xz
cocoa-cb: add support for 10bit opengl rendering
this will request a 16bit half-float framebuffer instead if a 8bit integer framebuffer. Fixes #3613
Diffstat (limited to 'osdep/macOS_swift_compat.swift')
-rw-r--r--osdep/macOS_swift_compat.swift14
1 files changed, 14 insertions, 0 deletions
diff --git a/osdep/macOS_swift_compat.swift b/osdep/macOS_swift_compat.swift
index 381398e1bf..c14aa08282 100644
--- a/osdep/macOS_swift_compat.swift
+++ b/osdep/macOS_swift_compat.swift
@@ -23,6 +23,13 @@ extension NSAppearance.Name {
static let accessibilityHighContrastVibrantLight: NSAppearance.Name = NSAppearance.Name(rawValue: "NSAppearanceNameAccessibilityVibrantLight")
static let accessibilityHighContrastVibrantDark: NSAppearance.Name = NSAppearance.Name(rawValue: "NSAppearanceNameAccessibilityVibrantDark")
}
+
+@available(OSX 10.12, *)
+extension String {
+ static let RGBA16Float: String = kCAContentsFormatRGBA16Float
+ static let RGBA8Uint: String = kCAContentsFormatRGBA8Uint
+ static let gray8Uint: String = kCAContentsFormatGray8Uint
+}
#endif
extension NSPasteboard.PasteboardType {
@@ -73,6 +80,13 @@ extension Array {
}
}
+extension Array where Element == [CGLPixelFormatAttribute] {
+
+ func contains(_ obj: [CGLPixelFormatAttribute]) -> Bool {
+ return self.contains(where:{ $0 == obj })
+ }
+}
+
extension NSWindow.Level {
static func +(left: NSWindow.Level, right: Int) -> NSWindow.Level {