Bug 550350 - Improve performance of annotation ruler paint method

The old code gets particular bad when the range between lowest used and
highest used layer grows. If someone decides to provide an Annotation
with layer Integer.MAX_VALUE to get it always on top we get a serious
performance issue.
Old code iterates from lowest to highest used layer on each step
checking for each annotation if it belongs to this layer. Even for all
layers without any annotation.
New code simply sort them by layer first and iterate straight over this
list. Same result but much faster.

Change-Id: I6d723207f4d12b1b10001034e82a9c9d741881ce
Signed-off-by: Paul Pazderski <paul-eclipse@ppazderski.de>
1 file changed