Re-added the fix for masking in CanvasRenderer.