Migrate canvas handling to the Engine class.