uterm: dumb: optimize division by 255 in rendering path
authorDavid Herrmann <dh.herrmann@googlemail.com>
Thu, 24 Jan 2013 13:04:58 +0000 (14:04 +0100)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Thu, 24 Jan 2013 13:04:58 +0000 (14:04 +0100)
commit0344686417a6d9b759296013c0616178d5c39fa6
tree46bc58800dd8804b375ddb63cd12b446a1ecec69
parent717e193ea180788f2cf0c4ad71d7b7507ea4dadc
uterm: dumb: optimize division by 255 in rendering path

This was recommended by Soren Sandmann on the pixman ML. We can optimize a
real t /= 255 with:
  t += 0x80
  t = (t + (t >> 8)) >> 8;
Instead of using a single fake (t >> 8) shift as we used to.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/uterm_video_dumb.c