Paint clipping updated for non-rectangular shapes

Instead of `setClip(0, 0, w, h)` the method now uses
`clip(boundingShape)`. This allows for non-rectangular bounding shape
clipping; it will clip according to the result of the `getBoundingShape`
method.