fdo#74702 Move common mask functionality to ApplyMask

There is code in OutputDevice that essentially carries out the same
functionality as ImplPrintMask, but for VirtualDevice and Window
instances. Therefore, renamed ImplPrintMask to ApplyMask and moved
OutputDevice functionality into new protected function ApplyMask.

Change-Id: Ia88469e9b149f7819dfc538ecbe014198e4534f6