Fix repainting problems in Draw.

Regression from 465730622e2eb77828c1cf4845f8e8a40b92f1b2; unfortunately the
hierarchy can contain more than just the sdr shapes, in which case it fails to
recognize that there is still something to paint.

We need to improve the way getPrimitive2DSequenceHierarchy() works, and come
up with a way how to cut early the primitives that are not interesting for the
area that we are redrawing.

Change-Id: Ieb2e40a576e9a394fe28f248e582c132ab5b6578