Patch drawing performance: improved pixel manipulation and big/little endian implementation