Use a GCC #pragma to always optimize the Painter code with -O3. This code is performance critical and hotter than anything else in the system, and this helps quite a bit. The 2x, 3x and 4x upscaling fast paths benefit greatly from this.