Simplify and refactor the frame renderization.

We want a fixed size of the frame, so we calculate the proper
percentage to use with the linear gradient cairo functions.