Fix T39397: Leaving leaving camera from quadview set ortho
Fix T39395: Switching to "Textured solid" and "GLSL" view will cause the FPS drop to 0

Issue was caused by the cache limitor which was removing 4k textures from the
memory when accessing other images.

This is pretty much awful situation and solved by making it so only image sequences
and movies ace cache-guarded.

Could be optimized further so images used by viewport are not being freed, but
that's much more tricky to do..

This is a nice candidature for 'a'.
Build file macro for testing unordered_map C++ container support.

Using unordered_map and unordered_set C++ container types currently
requires careful testing or usage of boost, due to the various confusing
C++ version differences in include paths and namespaces.

Libmv defines tests for these cases in cmake and scons, such that ceres
can use any available implementation, or fall back too std::map/std::set
if none can be found.

This patch generalizes this buildfile code by providing a Blender macro.
* cmake: defines both the variables used by libmv at them moment as well
as 2 variables UNORDERED_MAP_INCLUDE_PREFIX and UNORDERED_MAP_NAMESPACE,
which can later be used in other C++ parts for convenience.
* scons: adds a tool script returning the include prefix and namespace.
Libmv checks these to define the appropriate definitions for ceres.

Differential Revision: https://developer.blender.org/D425
Fix for own commit: mixed up ceres build defines when replacing cmake
check with a generalized macro.

rBbbfcb0b1e44636b73b8c46f1cb800fa53dda5277
Followup to Ceres changes -- need to update bundling script
Code cleanup: editmode opengl drawing
Editmode drawing: avoid glBegin/End for every tri (emDM_drawMappedFacesMat,GLSL)
Fix T38870: Freezes when jumping in front of a keyframe.

Issue was caused by inverting a degenerate matrix when
evaluating drivers.

Solved by using tweaked inverse code (same as used in Cycles).

Should have no affect on cases when matrix is not degenerate.
Correction to the previous commit
Fix T39319: Particle System Bug on Cycles Render.

Crashes due to bad dm face calculation in particle RNA/cycles hair.
This stuff is a total mess, but this kind of check is used in other
places and prevents crashing at least.
Zoom to mouse position didn't work in MCE when locked to a selection
CMake: only nag about requests py module once
Follow Blender slangs! ;)
Code cleanup: style and warnings
Code cleanup: remove unused flags
revert 0da3e97, fix for T39279

Following problems:
- painting onto a cube asserts immediately (vpaint/wpaint)
- crashes with valgrind (bad memory use)
- the original intended behavior of vertex projection paint no longer works as I intended.
  (its constantly refreshing geometry even when no modifiers are applied).

Best get code review for these kinds of changes.
Code cleanup: add _v2 suffix to resolve_tri/quad functions
New resolve_tri_uv_v3 util function

Compute barycentric coordinates (u, v) for a point with respect to a
triangle.

This is needed for Cycles baking but we decided to push this
independently of the upcoming main baking changes.

Code adapted from Christer Ericson's Real-Time Collision Detection.

Cleanup, refactoring and review from Campbell Barton.
Fix T39279: Vertex paint fails with mirror modifier
Fix T39420: Cycles viewport/preview flickers, when moving mouse across editors

Issue was caused by the wrong usage of OCIO GLSL binding API. To make it
work properly on pre-GLSL-1.3 drivers shader is to be enabled after the
texture is binded to the opengl context. Otherwise it wouldn't know the
proper texture size.

This is actually a regression in 2.70 and to be ported to 'a'.