Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 27e83068fe9e1feb64ac96d8f8b0c76d43a5e0fc https://github.com/WebKit/WebKit/commit/27e83068fe9e1feb64ac96d8f8b0c76d43a5e0fc Author: Said Abou-Hallawa <s...@apple.com> Date: 2022-12-16 (Fri, 16 Dec 2022)
Changed paths: M Source/WebCore/CMakeLists.txt M Source/WebCore/Headers.cmake M Source/WebCore/Sources.txt M Source/WebCore/SourcesCocoa.txt M Source/WebCore/WebCore.xcodeproj/project.pbxproj M Source/WebCore/platform/graphics/GraphicsContext.cpp M Source/WebCore/platform/graphics/GraphicsContext.h A Source/WebCore/platform/graphics/controls/ControlFactory.cpp A Source/WebCore/platform/graphics/controls/ControlFactory.h A Source/WebCore/platform/graphics/controls/ControlPart.cpp A Source/WebCore/platform/graphics/controls/ControlPart.h A Source/WebCore/platform/graphics/controls/ControlPartType.cpp A Source/WebCore/platform/graphics/controls/ControlPartType.h A Source/WebCore/platform/graphics/controls/ControlStyle.h A Source/WebCore/platform/graphics/controls/MeterPart.cpp A Source/WebCore/platform/graphics/controls/MeterPart.h A Source/WebCore/platform/graphics/controls/PlatformControl.h R Source/WebCore/platform/graphics/formcontrols/ControlPartType.cpp R Source/WebCore/platform/graphics/formcontrols/ControlPartType.h A Source/WebCore/platform/graphics/mac/controls/ControlFactoryMac.h A Source/WebCore/platform/graphics/mac/controls/ControlFactoryMac.mm A Source/WebCore/platform/graphics/mac/controls/ControlMac.h A Source/WebCore/platform/graphics/mac/controls/ControlMac.mm A Source/WebCore/platform/graphics/mac/controls/MeterMac.h A Source/WebCore/platform/graphics/mac/controls/MeterMac.mm A Source/WebCore/platform/graphics/mac/controls/WebControlView.h A Source/WebCore/platform/graphics/mac/controls/WebControlView.mm M Source/WebCore/platform/mac/ThemeMac.h M Source/WebCore/platform/mac/ThemeMac.mm M Source/WebCore/rendering/RenderBox.cpp M Source/WebCore/rendering/RenderBox.h M Source/WebCore/rendering/RenderMeter.cpp M Source/WebCore/rendering/RenderObject.h M Source/WebCore/rendering/RenderTheme.cpp M Source/WebCore/rendering/RenderTheme.h M Source/WebCore/rendering/RenderThemeMac.h M Source/WebCore/rendering/RenderThemeMac.mm M Source/WebCore/rendering/RenderThemeWin.cpp M Source/WebCore/rendering/RenderThemeWin.h Log Message: ----------- [GPU Process] [FormControls] Route drawing the ControlPart through GraphicsContext https://bugs.webkit.org/show_bug.cgi?id=249248 rdar://103315944 Reviewed by Aditya Keerthi and Simon Fraser. We will make RenderTheme create a ControlPart from DOM element of RenderBox. We will start with MeterPart as an example for the WebProcess drawing workflow. RenderTheme::paint() will call GraphicsContext::drawControlPart() which will call 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. * Source/WebCore/CMakeLists.txt: * Source/WebCore/Headers.cmake: * Source/WebCore/Sources.txt: * Source/WebCore/SourcesCocoa.txt: * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::drawControlPart): * Source/WebCore/platform/graphics/GraphicsContext.h: * Source/WebCore/platform/graphics/controls/ControlFactory.cpp: Added. (WebCore::ControlFactory::createControlFactory): (WebCore::ControlFactory::sharedControlFactory): * Source/WebCore/platform/graphics/controls/ControlFactory.h: Added. * Source/WebCore/platform/graphics/controls/ControlPart.cpp: Added. (WebCore::ControlPart::ControlPart): (WebCore::ControlPart::controlFactory const): (WebCore::ControlPart::platformControl const): (WebCore::ControlPart::sizeForBounds): (WebCore::ControlPart::draw const): * Source/WebCore/platform/graphics/controls/ControlPart.h: Added. (WebCore::ControlPart::type const): (WebCore::ControlPart::setControlFactory): * Source/WebCore/platform/graphics/controls/ControlPartType.cpp: Renamed from Source/WebCore/platform/graphics/formcontrols/ControlPartType.cpp. * Source/WebCore/platform/graphics/controls/ControlPartType.h: Renamed from Source/WebCore/platform/graphics/formcontrols/ControlPartType.h. * Source/WebCore/platform/graphics/controls/ControlStyle.h: Added. * Source/WebCore/platform/graphics/controls/MeterPart.cpp: Added. (WebCore::MeterPart::create): (WebCore::MeterPart::MeterPart): (WebCore::MeterPart::createPlatformControl): * Source/WebCore/platform/graphics/controls/MeterPart.h: Added. (WebCore::MeterPart::gaugeRegion const): (WebCore::MeterPart::value const): (WebCore::MeterPart::minimum const): (WebCore::MeterPart::maximum const): * Source/WebCore/platform/graphics/controls/PlatformControl.h: Added. (WebCore::PlatformControl::PlatformControl): (WebCore::PlatformControl::setFocusRingClipRect): (WebCore::PlatformControl::updateCellStates): (WebCore::PlatformControl::sizeForBounds const): (WebCore::PlatformControl::draw): * Source/WebCore/platform/graphics/mac/controls/ControlFactoryMac.h: Added. * Source/WebCore/platform/graphics/mac/controls/ControlFactoryMac.mm: Added. (WebCore::ControlFactory::createControlFactory): (WebCore::ControlFactoryMac::drawingView const): (WebCore::ControlFactoryMac::levelIndicatorCell const): (WebCore::ControlFactoryMac::createPlatformMeter): * Source/WebCore/platform/graphics/mac/controls/ControlMac.h: Added. * Source/WebCore/platform/graphics/mac/controls/ControlMac.mm: Added. (WebCore::ControlMac::ControlMac): (WebCore::ControlMac::setFocusRingClipRect): (WebCore::ControlMac::updateCellStates): (WebCore::drawFocusRing): (WebCore::drawCellOrFocusRing): (WebCore::ControlMac::draw): * Source/WebCore/platform/graphics/mac/controls/MeterMac.h: Added. (WebCore::MeterMac::owningMeterPart const): * Source/WebCore/platform/graphics/mac/controls/MeterMac.mm: Added. (WebCore::MeterMac::MeterMac): (WebCore::MeterMac::updateCellStates): (WebCore::MeterMac::sizeForBounds const): (WebCore::MeterMac::draw): * Source/WebCore/platform/graphics/mac/controls/WebControlView.h: Added. * Source/WebCore/platform/graphics/mac/controls/WebControlView.mm: Added. (+[WebControlWindow hasKeyAppearance]): (+[WebControlWindow setHasKeyAppearance:]): (-[WebControlWindow hasKeyAppearance]): (-[WebControlWindow isKeyWindow]): (-[WebControlWindow _needsToResetDragMargins]): (-[WebControlWindow _setNeedsToResetDragMargins:]): (+[WebControlView clipBounds]): (+[WebControlView setClipBounds:]): (-[WebControlView init]): (-[WebControlView window]): (-[WebControlView isFlipped]): (-[WebControlView currentEditor]): (-[WebControlView _automaticFocusRingDisabled]): (-[WebControlView _focusRingVisibleRect]): (-[WebControlView _focusRingClipAncestor]): (-[WebControlView addSubview:]): * Source/WebCore/platform/mac/ThemeMac.h: * Source/WebCore/platform/mac/ThemeMac.mm: (WebCore::ThemeMac::ensuredView): (WebCore::ThemeMac::useFormSemanticContext): (WebCore::ThemeMac::setUseFormSemanticContext): * Source/WebCore/rendering/RenderBox.cpp: (WebCore::RenderBox::ensureControlPart): (WebCore::RenderBox::paintBoxDecorations): * Source/WebCore/rendering/RenderBox.h: * Source/WebCore/rendering/RenderMeter.cpp: (WebCore::RenderMeter::updateLogicalWidth): (WebCore::RenderMeter::computeLogicalHeight const): * Source/WebCore/rendering/RenderObject.h: * Source/WebCore/rendering/RenderTheme.cpp: (WebCore::createMeterPartForRenderer): (WebCore::RenderTheme::createControlPartForRenderer const): (WebCore::RenderTheme::extractControlStyleStatesForRenderer const): (WebCore::RenderTheme::extractControlStyleForRenderer const): (WebCore::RenderTheme::paint): (WebCore::RenderTheme::meterSizeForBounds const): * Source/WebCore/rendering/RenderTheme.h: (WebCore::RenderTheme::canCreateControlPartForRenderer const): (WebCore::RenderTheme::useFormSemanticContext const): (WebCore::RenderTheme::supportsLargeFormControls const): * Source/WebCore/rendering/RenderThemeMac.h: * Source/WebCore/rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::canCreateControlPartForRenderer const): (WebCore::RenderThemeMac::useFormSemanticContext const): (WebCore::RenderThemeMac::supportsLargeFormControls const): (WebCore::RenderThemeMac::meterSizeForBounds const): (WebCore::RenderThemeMac::paintMeter): Deleted. (WebCore::RenderThemeMac::levelIndicatorFor const): Deleted. * Source/WebCore/rendering/RenderThemeWin.cpp: (WebCore::RenderThemeWin::meterSizeForBounds const): Deleted. * Source/WebCore/rendering/RenderThemeWin.h: Canonical link: https://commits.webkit.org/257981@main _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes