move dirtiness check into rtb_window_draw()