Fix T38987 Dope sheet is inoperable with "view slected" when nothing is selected.

Code was unconditionnaly setting view's xmin and xmax, even when it was aborting afterward.
Fix T38955: Misleading tooltip for Clean Tool in Weight Tools Toolshelf.
Hiding plane tracks was never implemented
Solve partial redraw issues in sculpting.

* Do union with previous partial redraw before overwriting with self and
store unmodified new rect to avoid rect getting bigger.
* Make rect one pixel wider instead of smaller so edges do not get left
outside. Overall this looks quite better.
Fix error in previous commit. Included dubious fix for smooth brush by mistake
Fix T37510 Knife missed cuts on small faces.

For very thin faces, knife sometimes missed cutting a few.
Problem was that a test for edges being totally inside a face
was being applied in inappropriate circumstances. An assumed
invariant about the knife hit structure is not true when
actually in the middle of making cuts.
Also make a 'big epsilon' a little smaller, though don't think
that was the problem in this bug.
Better handling for previous fix: Make sure previous redraw rect stays
after the stroke so that it can be unioned with current rect correctly
during the draw update. For some reason dyntopo clipping misbehaved
before that.
Fix X11 mouse cursor flickering briefly to the standard cursor when changing it.

Not very visible now but it matters for the next commit.
Fix T37867: scroll bar in text editor shows the wrong mouse cursor.

Patch by chipgw.
Final fix (I hope!) for partial redraw.

The problem here is that the redraw rectangle can be calculated many
times before actual redraw (for instance due to repetitive calls to the
paint step function for space strokes). Those redraw rectangles need to
be accumulated and finally flushed when the draw call is done.

Also, it is this accumulated rectangle that must account for the
previously drawn rectangle to avoid artifacts due to drawing.

Now all looks like it works correctly :)
Forgo one rect union function, partial rect is inferred from nodes that
are tagged for update anyway. The important part of the fix was updating
the previous rectangle in the draw function.
Experimental dyntopo feature:

Dyntopo detail in object space. This allows to set the detail in
percentage of blender units and sculpt in this detail constantly,
regardless of the distance to the mesh.

This commit just enables the functionality, which is really trivial.
There will be some more commits like detail flood fill and
detail sampling in the future.
Cuda use streams and async to avoid busywaiting

This switches api usage for cuda towards using more of the Async calls.

Updating only once every second is sufficiently cheap that I don't think it is worth doing it less often.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D262
Cycles: Use Displacement type in OSL ShadingSystem.

Reviewed by: brecht
Differential Revision: https://developer.blender.org/D386
Fix T39000: Align Objects Axis button is not redraw.

We have to apply button *before* checking others in the ROW, else changes are not propagated to them yet.
BMesh: simple edge boundary walker
Mesh: loopselect return cancelled when no selection made

also un-indent main function body.
Editmesh: Toggle between all edge-loop boundaries when selecting

Now Alt+RMB,RMB will select all connected boundaries.

There are times when you just want to select an entire boundary loop
ignoring face topology, previously there was no way to do this.
Code cleanup: style
Fix T38990: Crash in mask shape re-key