This PR mainly moves some code and introduces `RenderContext.WithXxx` functions
Just functions move, no code change. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>