buf is updated in renderRLayer_InBBox