Implement GPU-side display transform for clip editor

Implemented using GLSL API from OpenColorIO library and
some general functions were added to it's c-api:

- OCIO_setupGLSLDraw prepares OpenGL context for GPU-based
  transformation for a giver processor.

  This function compiles and links shader, sets  up it's
  argument. After this transformation would be applied
  on an image displaying as a 2D texture.

  So, glaDrawPixelsTex called after OCIO_setupGLSLDraw will
  do a proper color space transform.

- OCIO_finishGLSLDraw restores OpenGL context after all
  color-managed display is over.

- OCIO_freeOGLState frees allocated state structure used
  for cacheing some GLSL-related stuff.

There're some utility functions in IMB_colormanagent which
are basically proxies to lower level OCIO functions but
which could be used from any place in blender.

Chacheing of movie clip frame on GPU is also removed now,
and either glaDrawPixelsTex or glaDrawPixelsAuto are used
for display now. This is so no code duplication happens
now and no large textures are lurking around in GPU memory.

Known issues:
- Texture buffer and GLSL are no longer checking for
  video card capabilities, possibly could lead to some
  artifacts on crappy drivers/cards.

- Only float buffers are displaying using GLSL, byte
  buffers will still use fallback display method.

  This is to be addressed later.

- If RGB curves are used as a part of display transform,
  GLSL display will also be disabled. This is also thing
  to be solved later.

Additional changes:

- glaDrawPixelsTexScaled will now use RGBA16F as an
  internal format of storing textures when it's used
  to draw float buffer. This is needed so LUT are
  applied without precision loss.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55670 954f8c5b-7b00-dc11-b283-0030488c597c
SVN property for new file



git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55671 954f8c5b-7b00-dc11-b283-0030488c597c
Compile fix for recent OCIO commit, missing GLEW include.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55672 954f8c5b-7b00-dc11-b283-0030488c597c
code comments: bmesh operator doxy header descriptions.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55673 954f8c5b-7b00-dc11-b283-0030488c597c
code cleanup: move beauty fill calculation into its own function and some style cleanup


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55674 954f8c5b-7b00-dc11-b283-0030488c597c
Beautify - use a heap for the edge rotation queue rather then checking to rotate all edges until none can be rotated.

this means the best edges to rotate are done first, also speeds up execution ~20% in my tests.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55675 954f8c5b-7b00-dc11-b283-0030488c597c
Tidy up stroke options and make them sexy, aka the paint option
sculptification commit. We have a drop menu to select the stroke mode
now. Jitter controls appear under stroke panel under all modes (As they
should! They stroke control options). Also enable jittering for all
modes. I really fail to see why not.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55676 954f8c5b-7b00-dc11-b283-0030488c597c
Elbeem fluid: Remove hardcoded 16GB RAM limit on 64bit systems

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55678 954f8c5b-7b00-dc11-b283-0030488c597c
Woot woot commit.

Stencil style texture mapping. Ready for field testing and user feedback.

This commit adds stencil like brushes, like those that existed on old ptex branch.
(with the exception of clip colour)
To control the position of the stencil, you use

Q: translation
Shift - Q: scaling
Ctrl - Q: rotation

There's extra work that has been done to make this work:

* Support for coloured overlay in vertex/texture painting
* Also made A button do stroke mode selection like in sculpt mode,
when mask painting is inactive.

There are some TODOs to work on during bcon3:

* Support tiled and stencil mode in 2D painting. Support alpha textures also.
* Tidy up overlay code. There's some confusion there due
to the way we use the primary brush texture sometimes for alpha, other times
for colour control.

WIP design docs will be in

http://wiki.blender.org/index.php/User:Psy-Fi/New_Brush_Tool_Design

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55679 954f8c5b-7b00-dc11-b283-0030488c597c
Cycles / Shader Graph optimization:
* Unnecessary shader inputs inside the Mix Shader are now ignored, in case the factor is 0.0 / 1.0 and not connected. 
This way we save some render time for complex node graphs. 

Example: http://www.pasteall.org/pic/show.php?id=48226
Check the Mix Shader at the end: In this case, Cycles will now avoid the complete huge shader tree, and only calculate the Diffuse Shader.
Rendertime decreased from 1:50 min to 1:20 min on CPU. GPU rendering benefits as well from this. 

This only affects SVM, OSL was already doing these optimizations. 

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55681 954f8c5b-7b00-dc11-b283-0030488c597c
style cleanup


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55682 954f8c5b-7b00-dc11-b283-0030488c597c
UI cleanup:

* Using masking is determined only by the presence of the texture,
remove extraneous DNA flag (might cause issues later but in practice
brush options are not harmful)
* Overlay and angle sliders are active during stencil mapped brushes
* Only draw the overlay if there's a texture.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55684 954f8c5b-7b00-dc11-b283-0030488c597c
optimize away reloading of brush texture when rotating the stencil

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55685 954f8c5b-7b00-dc11-b283-0030488c597c
Changes to Stencil control:

* Add a poll function that only activates the operator when a stencil
brush is active
* Change shortcuts to RMouse - translate, Shift - RMouse Scale, Ctrl -
RMouse, rotate. MUCH faster and simpler workflow.
* Change shortcut of colour sampling to S. Sampling is important but not
as important as warranting the Right Mouse button.
* Add a notifier so that toolbar gets updated texture rotation when
rotating the stencil

Also,
* Slight rearrangement of options so that jittering is more accessible
(easily more often used than smooth stroke)

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55686 954f8c5b-7b00-dc11-b283-0030488c597c
Fix typo in recent i18n changes

Broke rigid body buttons in physics tab.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55687 954f8c5b-7b00-dc11-b283-0030488c597c
Fix for [#34821] Split Viewer node won't show the backdrop
* Regression introduced in r55451

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55688 954f8c5b-7b00-dc11-b283-0030488c597c
Draw relationship lines for rigid body constraints

Makes it easier to see what's connected to what.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55689 954f8c5b-7b00-dc11-b283-0030488c597c
Fix #34819: Background image gets pixelated when zooming in

Was a regression in glaDrawPixelsTex changes related on zoom filter.
For background image linear interpolation was used.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55690 954f8c5b-7b00-dc11-b283-0030488c597c
correct too-big allocation in mesh beautify.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55691 954f8c5b-7b00-dc11-b283-0030488c597c
Draw checker backdrop for sequencer when in RGBA mode

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55692 954f8c5b-7b00-dc11-b283-0030488c597c