Screen: Remove old dead texture render swap code.

It was disabled and dead since may years and now got in the way. Remove
it.
Screen: Use windowRecord->VBL_Startline instead of recomputing.

No point recomputing at various places when we have the cached setting.
Also fixup ol’ Screen(‘WaitBlanking’) to handle non-fullscreen windows
better.
Screen: Add new screen glue function PsychGetScreenPixelSize()

Reports size of screens frame buffer in pixels, instead of logical size
units (points), as PsychGetScreenSize() / GetScreenRect() /
GetScreenGlobalRect() do.

In the past, size in points was equal to size in pixels, so no need for
this.
On OS X with Retina displays (HiDPI displays) the logical/virtual size
in points can be different from the “physical” size in pixels. E.g., on
a Retina panel in “best for Retina” scaled mode, 1 point == 2 pixels.
Sometimes we need the true size of the display in pixels, therefore
this new function.
On Linux and Windows, the new function is just an alias for
PsychGetScreenSize().
Screen/OSX: Fix misreporting of pixel color depth in PsychGetScreenDepths()

… ok, only for debug output, so this was irrelevant for production use.
Screen/OSX: Also report scaled HiDPI/Retina video modes.

So far these didn’t get enumerated, but some new optional parameter
kCGDisplayShowDuplicateLowResolutionModes for
CGDisplayCopyAllDisplayModes() now allows enumeration since OS X 10.8.

-> Fixes some whining of PTB about misdirected or omitted video modes
on Retina panels.
-> Allow video mode switching to and from Retina modes on OS X.
-> Our first hard requirement for OS X 10.8 as minimum operating system
version.
Screen/OSX: Move windowRecord->globalRect assignment where it belongs.
Screen/OSX: Assign windowRecord->VBL_Startline in Window glue.

Use new PsychGetScreenPixelSize() so it can cope with Retina scaled
modes and still report proper vblank startline.
Screen/OSX: Track windowRecord->globalRect and ->rect in glue code.

Cocoa glue now not only updates globalRect with virtual global display
coordinates in resolution independent unit of points, but also updates
the true backbuffer size of the window in pixels. Assignment is done at
OpenGL context assignment and for GUI windows at each move/resize.

This is needed because ‘rect’ must contain the true size of the windows
backbuffer in pixels, and this size can differ from the size in points
on HiDPI/Retina displays.
Screen('Rect'/'WindowSize'): Honor realFBSize flag also for screens.

In the past the flag was only taken into account for onscreen window
handles.
Now it also works for display screens, aka screenIds. This is important
so M-Files like PsychImaging() can query the true size of the frame
buffer in pixels (as opposed to points) before an onscreen window is
opened. Needed for proper PanelFitter setup and similar tasks on Retina
displays.
PsychImaging: Fix panel fitter setup for HiDPI/Retina displays.

Query true screen size in pixels, so we can cope with differences
points != pixels on HiDPI display modes.
Screen/OSX: Retina mode: Unconditionally request a frame buffer of native resolution.

On OS X we always unconditionally request an OpenGL window backbuffer
the full true scanout size of the video mode in pixels. This makes sure
that if a Retina panel is connected, and a scaled video mode (HiDPI) is
in use, our OpenGL frame buffer for the onscreen window has the full
native panel resolution.

-> Allows to take full advantage of HiDPI Retina displays.
-> Should avoid any rescaling by the OS and thereby make visual onset
timing and timestamping less worse - i’d say good, but that seems to be
an elusive goal on the most broken OS in existence. At least it
shouldn’t be worse than on a non-Retina panel.

Remaining issues:

* If GUI windows get manually resized by user interaction, we get lots
of pixel trash, although all our window and rendering parameters get
properly updated. Possibly a bug in Apples Retina implementation when
the compositor is active? Nothing we could do about it, except maybe
disable Retina rendering for GUI windows?

* Mismatch between reported mouse cursor locations and rendering
locations, as the cursor position seems to be reported in virtual
points, not true pixels.

* Should we use our panel fitter automatically by default on  a Retina
panel? Otherwise resolution and rendering load will be very high on
such panels, which causes tiny rendering on old Psychtoolbox scripts
and reduced performance due to the possibly overtaxed gpu.

-> Screen for 64-Bit Octave/Matlab on OS X rebuilt and tested.
Screen: Tone down some warning messages a bit.

They are not that important so don’t make them that scary.
Screen: Default to scaled low-res mode on Retina displays.

If a Retina style HiDPI display with a scaled video mode is detected,
enable the panel fitter by default to provide backward compatible
rendering and display behaviour. The apparent resolution of the frame
buffer is artificially limited to the resolution of the scaled video
mode (typically half horizontal and vertical resolution for about 1
quarter the total pixel resolution), then the panel fitter upscales the
stimulus image to full native Retina resolution before display. This
saves computation time on the GPU and some coordinate system conversion
headaches for user code, but obviously also throws away the high
resolution advantage.
The behaviour is basically the same as with PTB 3.0.11 and how OS X
behaves by default for any application which is not specifically
prepared for Retina support.

A new PsychImaging task ‘UseRetinaResolution’ allows to override this
and get the full native panel resolution, performance impact and
coordinate transformation fun included.

If the panel fitter is used by user code then this auto-scaling won’t
kick in and user code is fully responsible for setting up a scaling
that suits it.

-> Code is generic for all operating systems, but currently only
affects OS X with Retina displays.
-> Screen for OS X 64-Bit Octave/Matlab rebuilt and lightly tested.
MouseTraceDemos: Fix fractional mouse cursor coordinates.

For some weird display resolutions (e.g., Retina simulation),
fractional cursor coordinates were passed to Screen(), causing error
abort.
-> Fixed in MouseTraceDemo and MouseTraceDemo2.
SetMouse: Always round input (x,y) coordinates to integers.

Needed so Screen() doesn’t bail. Fix it here instead of all scripts.
RemapMouse(): Handle Retina display mode remapping.

Need to convert GetMouse() reported positions in points to equivalent
positions in pixels, before we go through the other inversion and panel
fitter remapping.

-> This automatically no-ops on non-Retina display modes or Retina
compat modes, because either the backingScaleFactor is 1 or it cancels
itself out with the inversion of the panel fitter transformations.

-> Need it for use of geometric image transformations as applied via
PsychImaging, and for regular panel fitter operations, and for using
Retina displays at full resolution.
-> Don’t need it for regular operation with regular display modes or in
Retina backward compatibility mode, just as in PTB 3.0.11.
ImagingStereoDemo, ImagingVideoCaptureDemo: Fix quirks uncovered by Retina stuff.

ImagingStereoDemo: Restricting the processing ROI is harmful in yet
another use case - Retina stuff. This did more harm than good in that
demo, so comment it out.
ImagingVideoCaptureDemo: Coordinate transform for blur region was wrong
or at least icky, but multiple “bugs” cancelled each other out. Not so
with Retina anymore, so fix the transformation to work in all cases.
Screen/OSX: Add query method for backing store scale factor.

Just in case we need it sometime, the proper Cocoa query for this.
Not used at the moment.
Screen for OS X rebuilt. Also some minor help text improvements.
PanelFitterDemo: Show where remapped mouse positions end up.

Shows that we don’t implement undo of rotation transforms properly yet.