overlay: Wrap the colour index around the rgba array
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 19 Aug 2013 22:29:08 +0000 (23:29 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 19 Aug 2013 22:29:08 +0000 (23:29 +0100)
And stop assigning colours beyond the end of the array. Still needs a
better method for colour assignment, big list of good colours & ida?

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
overlay/overlay.c

index 070cd04..fbec7e8 100644 (file)
@@ -263,7 +263,7 @@ static void show_gpu_perf(struct overlay_context *ctx, struct overlay_gpu_perf *
                                              rgba[last_color][1],
                                              rgba[last_color][2],
                                              rgba[last_color][3]);
-                       last_color++;
+                       last_color = (last_color + 1) % 4;
                        chart_set_stroke_width(comm->user_data, 1);
                }