shiny/driver/gldriver: fix 2 warnings on macOS 10.14

This CL iterates upon CL 171033 and resolves two remaining C compiler
warnings when building on macOS 10.14:

	# golang.org/x/exp/shiny/driver/gldriver
	cocoa.m:63:39: warning: 'NSOpenGLCPSwapInterval' is deprecated: first deprecated in macOS 10.14 [-Wdeprecated-declarations]
	/Applications/Xcode.app/.../NSOpenGL.h:281:39: note: 'NSOpenGLCPSwapInterval' has been explicitly marked deprecated here
	cocoa.m:72:1: warning: method possibly missing a [super prepareOpenGL] call [-Wobjc-missing-super-calls]

NSOpenGLContextParameterSwapInterval is the less-deprecated version of
NSOpenGLCPSwapInterval and respects the GL_SILENCE_DEPRECATION define.
However, we can't use it because it's available only in macOS 10.12+,
but Go currently supports older macOS versions (e.g., Go 1.12 requires
macOS 10.10+). Use a targeted #pragma clang diagnostic ignored instead.

Add a [super prepareOpenGL] call to ScreenGLView.prepareOpenGL method.
I can't quite tell if it was omitted intentionally, but based on its
documentation┬╣, it seems reasonable to have it. I didn't notice problems
in local testing. If it turns out it shouldn't be there, then it can be
removed in a way that doesn't generate a compiler warning.

┬╣ https://developer.apple.com/documentation/appkit/nsopenglview/1414940-prepareopengl

Updates golang/go#11811

Change-Id: I10b6522a7af64eadeb6586fad44ef4c1ece40ab2
Reviewed-on: https://go-review.googlesource.com/c/exp/+/171034
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
1 file changed
tree: 0da0125174a66b37f2c5d33fa1db89c50a81404a
  1. .gitattributes
  2. .gitignore
  3. AUTHORS
  4. CONTRIBUTING.md
  5. CONTRIBUTORS
  6. LICENSE
  7. PATENTS
  8. README.md
  9. apidiff/
  10. cmd/
  11. codereview.cfg
  12. ebnf/
  13. ebnflint/
  14. errors/
  15. fsnotify/
  16. go.mod
  17. go.sum
  18. inotify/
  19. io/
  20. mmap/
  21. notary/
  22. old/
  23. rand/
  24. shiny/
  25. shootout/
  26. utf8string/
  27. winfsnotify/
README.md

exp

This subrepository holds experimental and deprecated (in the old directory) packages.

The idea for this subrepository originated as the pkg/exp directory of the main repository, but its presence there made it unavailable to users of the binary downloads of the Go installation. The subrepository has therefore been created to make it possible to go get these packages.

Warning: Packages here are experimental and unreliable. Some may one day be promoted to the main repository or other subrepository, or they may be modified arbitrarily or even disappear altogether.

In short, code in this subrepository is not subject to the Go 1 compatibility promise. (No subrepo is, but the promise is even more likely to be violated by go.exp than the others.)

Caveat emptor.