gfx: Implement CPU painting with texture upload on the painting side.