Discard invisible surfaces

* Jiwen found that we would try to post invisible layers, and this
  would cause a hang.
* Check to see if the surface is invisible, and if so, discard it

Test: Manually tested with particles
Change-Id: Id4a0813cb30bd48c3cfa4d13dcee59fcb5f58a8d
1 file changed