gsoc 2013 branch soc-2013-paint
merge with trunk version 57545
Secondary color support in the paint editors, and associated
operators:
* X key swaps secondary and primary colour
* Ctrl-lclick painting uses the secondary colour
* Shift-S samples colour for the secondary colour

This can obviously be used for background/foreground palettes it will
obviously be used for gradient effects later on.
Merge branch trunk -r57567 into soc-2013-paint
Expose material viewport mode for blender internal. This -should- be
exactly equivalent to GLSL mode on + textured view. I left the GLSL flag
inside so game engine devs can decide how to handle the flag.
Minor changes:

* Default mtex uses UV mapping.
* Default tex uses image type.
Expose drag dot mode UI for texpaint (still not functional)
Add first version of pressure influence for mask textures based on
feedback from David Revoy:

http://www.davidrevoy.com/article107/textured-brush-in-floss-digital-

There are two methods, cutoff and ramp.

Cutoff simply selects between 0 and 1 based on stylus pressure while
ramp distributes the mask effect above the pressure value.

Too many words, here is a screenshot with the effect:

http://www.pasteall.org/pic/show.php?id=53865

From top to bottom:
* Strength pressure influence ON:
     - No mask influence
     - Cutoff mask influence
     - Ramp mask influence
* Strength pressure influence OFF:
     - No mask influence
     - Cutoff mask influence
     - Ramp mask influence
     
The brush masking is still in need of attention because it behaves
erratically, still it's nice for an zero.alpha commit ;)
Merge trunk -r57626 into soc-2013-paint
Fix mask pressure masking issue in projection painting
Fix masks not working well with recent mask pressure cutoff feature in
projection painting (2d case coming next). Also revert 56986, it seems
to not be necessary anymore? At least bug #35426 seems to be working
without it now. I hope this won't backfire
Fix 2D painting masking for pressure masking. I need to understand
better the new 2d paint code but luckilly the fix is simple!
Yet another painter oriented commit: Add explicit way to deactivate
masking if user wants to based on artist feedback. This allows to
accumulate dabs on top of each other even in space or dab stroke mode.

The checkbox is located under the imagepaint colour settings and is
called "accumulate"
Fix blenderplayer link issue
Applying patch by Fredrik Hansson: Extra blend modes.

Actually should be called the blend mode imperialism commit, this commit
adds no more no less about 15 new blend modes.

The catch is that the float versions will probably have to work in
display colour spaces, but seeing how the rest of the blending code is I
think this can go in right now.

Thanks to Fredrik for the original patch and to Campbell for writing
uncrustify. A solid weapon in the war against the non-blender-style-

To painters out there: Test this extensively!
Yet another small fix for 2d painting with mask pressure: Make sure the
brush texture is recreated always in that case (possibly should check
the actual brush pressure but it will make little difference).
Yet another fix for mask pressure:

Tiled colour texture could activate partial update, make sure to test
separately for mask pressure options and always disable if they are
active.
Merge trunk -r 57692 into soc-2013-paint
Merge trunk -r57697 into soc-2013-paint
Change masking of 2d painting to be similar to 3d masking.

This fixes inconsistent behaviour where opacity masking is done using
only the curve and alpha offset when view mask mapping is used in 2d
painting. The key notion here is that masking converges to the maximum
value, which should be texmask*brush_alpha here. This happens already
for projective texturing.

Unfortunately this requires an extra allocation of a maximum mask value
imbuf during a stroke which introduces some performance regression when
using mask inages. This first version of the fix does not yet introduce
partial update of this maximum mask buffer like we do for colour image
buffers, and even though this bug exists in trunk as well, I decided to
only commit in this branch because it is not too obvious and because
there is some performance regression when using mask brushes.

Also, this commit may break pressure masking because I don't have a
tablet right now to test. Don't panic if this breaks it, I will fix it
when I get my hands on it again. However if this is not the case, this
commit should also fix the 2d behaviour of ramp style pressure masking.