Fix T40445: Disabled modifiers prevent cage edit mode.

No valid reason to make non-mapping modifiers break edit cage,
when they are disabled in 3DView/edit mode!
Fix T37618 Bevel mismatched offsets and bad profile plane.

Used a different technique to resolve "impossible" offset cases
that makes more consistency. Also changed the plane in which
the profile lies for the case with only one beveled edge and
more than 3 other edges.
Fix EdgeSlide behavior with boundry edges

- would flip in opposite directions sometimes on the same loop
- some vertices would get directions from adjacent vertices
Fix incorrect flag checks for project-paint face winding
Fix uninitialized var in recent change to cursor drawing
Add debug define for timing polyfill
Cycles: Small optimization for scenes without Transparent Shaders, helps a few percent.

Differential Revision: https://developer.blender.org/D570
Code cleanup, unused variables and comments.
Fix a typo in a comment.
Fix T40315: Boolean modifier with Freestyle edges.

The helper function `make_freestyle_edge_mark_hash()` was referring to the
original mesh to determine Freestyle edge marks for individual derived mesh edges.
This is no longer necessary now that derived meshes deliver CD_FREESTYLE_EDGE
and CD_FREESTYLE_FACE layers of their own.  The reference of the original mesh
was also inappropriate since the edges coming from one of the operands of a boolean
modifier don't have proper CD_ORIGINDEX values but ORIGINDEX_NONE's.

Many thanks to Sergey Sharybin for patch contributions and discussions.