api/cocoa: Allow Cocoa to cull occluded window regions to improve resizing performance.
api/cocoa: Allow Cocoa to cull occluded window regions to improve
resizing performance.

The hack we were using before that installed the OpenGL context into the
`NSThemeFrame` was quick and elegant, but it confused Cocoa's occlusion
culling. As a result, Cocoa thought the entire window background was
visible and painted it all on the CPU every frame. This made window
resizing slow.

This patch fixes this by overhauling our view hierarchy. We switch to
`NSBorderlessWindowMask`, augmented with a custom `NSWindow` subclass
and a custom `NSView` subclass for our content view. Although borderless
windows (`NSNextStepFrame`) start out without many UI affordances, it
turns out to be pretty easy to restore native behavior by overriding a
few methods.

We get proper occlusion culling by marking the content view as "opaque".
Although at first glance this seems wrong since the contents of the
content view may in fact be transparent, it's correct as far as Cocoa is
concerned, because "opaque" in Cocoa actually means "occludes parents'
backgrounds", which our content view in fact does.

In decoration-free mode, we emulate a title bar by making the window
background draggable and covering up the non-draggable area with a
custom view. This is surprisingly simple.

servo/glutin