move program descriptor generation to flush

BUG=skia:

Review URL: https://codereview.chromium.org/777673003
18 files changed