Bug 249248 - [GPU Process] [FormControls] Route drawing the ControlPart through GraphicsContext
Summary: [GPU Process] [FormControls] Route drawing the ControlPart through GraphicsCo...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords: InRadar
Depends on:
Blocks: 249168
  Show dependency treegraph
 
Reported: 2022-12-13 12:56 PST by Said Abou-Hallawa
Modified: 2022-12-16 07:06 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2022-12-13 12:56:17 PST
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().
Comment 1 Radar WebKit Bug Importer 2022-12-13 12:56:48 PST
<rdar://problem/103315944>
Comment 2 Simon Fraser (smfr) 2022-12-13 12:57:33 PST
> RenderBox::paintBoxDecorations() will call GraphicsContext::drawControlPart()

What role will RenderTheme play in this code path?
Comment 3 Said Abou-Hallawa 2022-12-13 13:07:40 PST
Pull request: https://github.com/WebKit/WebKit/pull/7566
Comment 4 EWS 2022-12-16 02:33:23 PST
Committed 257981@main (27e83068fe9e): <https://commits.webkit.org/257981@main>

Reviewed commits have been landed. Closing PR #7566 and removing active labels.
Comment 5 Said Abou-Hallawa 2022-12-16 07:06:54 PST
(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.