This would likely require some kind of refactoring: Move the Paint() function in CSSPaintImageGeneratorImpl to PaintWorklet. In that function, it should try to find an available PaintWorkletGlobalScope, get the document paint definition, and call paint.
We follow the same pattern as the animationWorklet and audioWorklet implementation
Comment 1 by xidac...@chromium.org
, Jun 1 2017