gui: move clean of dirty regions to afterrender and call that from app

This allows multiple render passes with same dirty regions