performance improvements to pixel rendering
merging upstream master