Fix #1179, Add Cpu rendering for ref-test.

Add a env variable "RENDER_WITH_CPU" to make check-ref with both cpu and gpu rendering.