Changed heatmap rendering.

It is now rendered using a sequence of drawing primitives instead of a
large pixmap.

Also implemented adaptive contingency resampling.
Speedup heatmap painting.

(bound the drawing to the exposed area only)