Make sure we stay within our bounds. Also initialise the background to transparent so there's no data from past renders. (cherry picked from commit 07c994fb)