We will make RenderBox create a ControlPart from its DOM element. We will start by the MeterPart as an example for the whole workflow since it is a simple control. RenderBox::paintBoxDecorations() will call GraphicsContext::drawControlPart() which will delegate the call to ControlPart::draw(). ControlPart::draw() will create the PlatformControl using its ControlFactory. On macOS the ControlFactory will be of type ControlFactoryMac and the PlatformControl will be of type MeterMac. ControlPart::draw() will call MeterMac::draw() which will call AppKit to draw the NSLevelIndicatorCell. For GPUP a new DisplayList item named DrawControlPart will be added. This will route the display to RemoteDisplayListRecorder which will call drawControlPart() from its ImageBuffer context. Because ControlFactoryMac will use a single NSLevelIndicatorCell for all MeterMac it creates, there should be a ControlFactoryMac per rendering thread in GPUP. So each RemoteDisplayListRecorder should have one ControlFactoryMac and should set it all in the ControlParts its renders through ControlPart::setControlFactory().
<rdar://problem/103315944>
> RenderBox::paintBoxDecorations() will call GraphicsContext::drawControlPart() What role will RenderTheme play in this code path?
Pull request: https://github.com/WebKit/WebKit/pull/7566
Committed 257981@main (27e83068fe9e): <https://commits.webkit.org/257981@main> Reviewed commits have been landed. Closing PR #7566 and removing active labels.
(In reply to Simon Fraser (smfr) from comment #2) > > RenderBox::paintBoxDecorations() will call GraphicsContext::drawControlPart() > > What role will RenderTheme play in this code path? RenderTheme will create the ControlPart from the RenderBox and its renderer. RenderThemeMac will answer questions specific to macOS when creating the ControlPart.