draw: implement pipeline statistics in the draw module