Fix T40456: cycles bug with branched path + sss + no sample all direct lights.
Fix issues when ungrouping meta changes the final sequencer render

Seems to be caused by the way how the most bottom strip in the stack
used to apply effect. Just rendering strip in this cases will not give
proper results.

Made it so effect is applying between empty imbuf and actual strip.
Seems to work by tests, but more intense testing is required.
Fix T40478: wrong cycles fresnel with GLSL materials in the viewport.
Fix T40482: Cycles matlib file crashes

it's possible that runtime optimizer would call get_attribute
with NULL renderstate. As per documentation, it's valid to
return false in that cases and in worst case we'll just miss
some possible optimization.

Supporting such cases would require some bigger changes to
Cycles since attributes are only set to up for the kernel
after shader compilation.

Thanks Brecht for review!
BMesh: avoid using OpenMP when nothing to do

Gave slowdown drawing on high poly meshes
Freestyle: Fix for a wrong formula used for RGB to grayscale conversion.

This bug fix is likely to affect the visual results of existing Freestyle setups using the
Material color/alpha/thickness modifiers with the 'material_attribute' parameter set to
either 'Diffuse' (default) or 'Specular', and also the Ramp option enabled in the case
of the Material color modifier.
Fix T40423: UV Editing 'Draw Other Objects' fails with Cycles
Freestyle: Fix for Interface0DIterator.object docstring with additional notes.
Correct hard-coded height for UV-Vertex buttons
Blender Internal: Fix for lamp option "Specular" not working when "Only Shadow" is enabled.

This is followup to rB8008d9bdfd57. Blender Render and GLSL preview
now produce the same results.
Fix T40436: No preview in Brush with Cycles

More like a feature request, but after i've implemented preview for
icons it was rather simple to support nodes previews.
Code cleanup: mixup hflag/htype
Avoid openmp sections in BM_mesh_elem_index_ensure
Fix T40382: 2D stabilization uses disabled markers

This lead to unpredictable results in some cases.
Tweak to previous commit
Fix subpixel precision in transform node

The node was using sampler from the callee node and passed
it to the input nodes. Since the fact that compositor output
node uses NEAREST interpolation (why it uses nearest is the
whole separate story) it's not possible to have subpixel
precision in such cases:

  <image> -> <translate> -> <output>

For now solving by hard-coding translate node to use BILINEAR
interpolation. It can't become worse in this node anyway and
the sampling pipeline is to be re-visited from scratch.
Fix T40429: cycles CUDA + use persistent images problem.
Fix T40228: cycles CUDA multi GPU + world MIS giving error.
OSX: replace deprecated (10.8 ) Gestalt function with utsname, no functional change
Code cleanup: style