Initial revision of hwcomposer.cpp

Unsure if it works, but it's a start...