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. apidiff/
  2. cmd/
  3. ebnf/
  4. ebnflint/
  5. errors/
  6. fsnotify/
  7. inotify/
  8. io/
  9. mmap/
  10. notary/
  11. old/
  12. rand/
  13. shiny/
  14. shootout/
  15. utf8string/
  16. winfsnotify/
  17. .gitattributes
  18. .gitignore
  19. AUTHORS
  20. codereview.cfg
  21. CONTRIBUTING.md
  22. CONTRIBUTORS
  23. go.mod
  24. go.sum
  25. LICENSE
  26. PATENTS
  27. README.md
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.