clean up render_style code to avoid excessive function calls for marking a renderer as painted