improve rendering performance by precalculating grayscale LUT
Merge remote-tracking branch 'upstream/master'
Merge branch 'master' into portable