Sync up Cocoa code between OpenGL and OpenGL2

Some changes were made in one but not the other.

Change-Id: Icc19a0f2052335681d8f36f5650bed78d358b864
Merge topic 'cocoa-merge' into master

ba2bbac2 Sync up Cocoa code between OpenGL and OpenGL2