louisdem / plan9front

Automatically exported from code.google.com/p/plan9front
0 stars 0 forks source link

drawtest verify single pixel operation in libmemdraw fails #208

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
i only tested on amd64.

to reproduce:

cd /sys/src/libmemdraw && mk 6.drawtest && ./6.drawtest

it faults due to aborting after the verify single pixel test fails. the other 
tests are OK, at least for the default r8g8b8 channel.

Original issue reported on code.google.com by mischief@offblast.org on 14 Sep 2014 at 5:48

GoogleCodeExporter commented 9 years ago
test results from _sl: http://okturing.com/src/2389/body

if the first argument to drawtest is k1 or k2, the test passes. any other color 
channels combination i tried failed.

Original comment by mischief@offblast.org on 14 Sep 2014 at 6:04

GoogleCodeExporter commented 9 years ago
the error comes from drawtest and libmemdraw using different rounding for
the alpha calculation.

drawtest uses: a*x / 255
memdraw uses: (a*x + 127) / 255

solution was to update drawtest to use the new rounding commit reac5c537095c

Original comment by cinap_le...@felloff.net on 14 Sep 2014 at 3:09