r1016: Use the OpenGL mask renderer and fix it.
Currently, only the software mask render was used even if OpenGL was
available. This posed a problem when a fade was defined in addition: In
this case the fade took precedence and the rendered mask was ignored.
With this change the OpenGL mask renderer is used, and the result is
blended with the fader. However, the OpenGL mask renderer is of low
quality and only suitable as a preview for initial work. For fine-tuning
of masks (with large feather values) OpenGL should be switched off and
the software renderer be used.
The GLU tesselator is used to dissect the mask polygon into triangles.
The tesselator requires a callback that computes new vertices. This
callback was bogus in two ways:
- It did not take into account that the input can contain NULL pointers
and crashed. This happened if the mask outline was made up of splines.
It turns out that the interpolation that this callback normally must
perform is not needed anyway (we are painting only a single color), so
it is removed.
- The new vertex data was allocated with malloc, but the GLU would not free
this data, so the memory is leaked. The solution is to put the new
vertices into a global list, which is deleted after the tesselation is
completed.