How to mask with cc.Graphics?

cc.Mask component have

type = IMAGE_STENCIL
sprite_frame = my_img.png

it works best with images but what if i want to create mask with cc.Graphics component as I not found any way to put cc.Graphics as a masking source.
Does there anyway to convert cc.Graphics to sprite frame and then use it in cc.Mask?

Hi,
Here is example:

@ccclass
export default class RoundMask extends cc.Component {
//Mask component instance
@property(cc.Mask)
public MaskComponent: cc.Mask = null;

//Corner
@property(Number)
public Round: number = 25;

//Rect 
public RoundRect: cc.Rect = new cc.Rect(0,0,0,0);

//Mask viewport
public Mask() {
    var graphics = this.MaskComponent._graphics;

    graphics.clear(false);
    
    graphics.roundRect(this.RoundRect.x, this.RoundRect.y, this.RoundRect.width, this.RoundRect.height, this.Round);        

    graphics.lineWidth = 0
    graphics.fillColor = cc.color(0, 0, 0, 255);

    graphics.fill();
}

}