[appkit] Change some NSOpenGL* types to be thread safe. Fixes #60826 (#3476)

Our thread safe checks ensure we're running on the main thread. This is
not the model used by OpenGL where the "same thread" must be used by
the context (but it does not need to be the main one)

https://developer.apple.com/library/content/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_threading/opengl_threading.html#//apple_ref/doc/uid/TP40001987-CH409-SW1

https://bugzilla.xamarin.com/show_bug.cgi?id=60826
This commit is contained in:
Sebastien Pouliot 2018-02-13 19:34:38 -05:00 коммит произвёл GitHub
Родитель 7472c8237d
Коммит 3355fdfc6e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -8201,6 +8201,7 @@ namespace AppKit {
//NSFetchRequest DefaultFetchRequest { get; } //NSFetchRequest DefaultFetchRequest { get; }
} }
[ThreadSafe]
[BaseType (typeof (NSObject))] [BaseType (typeof (NSObject))]
interface NSOpenGLPixelFormat : NSCoding { interface NSOpenGLPixelFormat : NSCoding {
[Export ("initWithData:")] [Export ("initWithData:")]
@ -8220,6 +8221,7 @@ namespace AppKit {
CGLPixelFormat CGLPixelFormat { get; } CGLPixelFormat CGLPixelFormat { get; }
} }
[ThreadSafe]
[Availability (Deprecated = Platform.Mac_10_7)] [Availability (Deprecated = Platform.Mac_10_7)]
[BaseType (typeof (NSObject))] [BaseType (typeof (NSObject))]
interface NSOpenGLPixelBuffer { interface NSOpenGLPixelBuffer {
@ -8249,6 +8251,7 @@ namespace AppKit {
int TextureMaxMipMapLevel { get; } /* GLint = int32_t */ int TextureMaxMipMapLevel { get; } /* GLint = int32_t */
} }
[ThreadSafe] // single thread - but not restricted to the main thread
[BaseType (typeof (NSObject))] [BaseType (typeof (NSObject))]
[DisableDefaultCtor] // warns with "invalid context" at runtime [DisableDefaultCtor] // warns with "invalid context" at runtime
interface NSOpenGLContext { interface NSOpenGLContext {