[webkit-changes] [WebKit/WebKit] d9b43d: [GPU Process][FormControls] Don't create a fake NS...

Said Abou-Hallawa noreply at github.com
Wed Feb 22 21:54:41 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d9b43d246262ba0832806f7aa7dcb6e6fbc4806f
      https://github.com/WebKit/WebKit/commit/d9b43d246262ba0832806f7aa7dcb6e6fbc4806f
  Author: Said Abou-Hallawa <said at apple.com>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M Source/WebCore/platform/graphics/mac/controls/ButtonMac.mm
    M Source/WebCore/platform/graphics/mac/controls/ColorWellMac.mm
    M Source/WebCore/platform/graphics/mac/controls/ControlMac.h
    M Source/WebCore/platform/graphics/mac/controls/ControlMac.mm
    M Source/WebCore/platform/graphics/mac/controls/ImageControlsButtonMac.mm
    M Source/WebCore/platform/graphics/mac/controls/InnerSpinButtonMac.mm
    M Source/WebCore/platform/graphics/mac/controls/MenuListButtonMac.mm
    M Source/WebCore/platform/graphics/mac/controls/MenuListMac.mm
    M Source/WebCore/platform/graphics/mac/controls/MeterMac.mm
    M Source/WebCore/platform/graphics/mac/controls/ProgressBarMac.mm
    M Source/WebCore/platform/graphics/mac/controls/SearchFieldCancelButtonMac.mm
    M Source/WebCore/platform/graphics/mac/controls/SearchFieldMac.mm
    M Source/WebCore/platform/graphics/mac/controls/SearchFieldResultsMac.mm
    M Source/WebCore/platform/graphics/mac/controls/SliderThumbMac.mm
    M Source/WebCore/platform/graphics/mac/controls/SliderTrackMac.mm
    M Source/WebCore/platform/graphics/mac/controls/TextAreaMac.mm
    M Source/WebCore/platform/graphics/mac/controls/TextFieldMac.mm
    M Source/WebCore/platform/graphics/mac/controls/ToggleButtonMac.mm

  Log Message:
  -----------
  [GPU Process][FormControls] Don't create a fake NSView if viewless cell drawing is supported
https://bugs.webkit.org/show_bug.cgi?id=252723
rdar://105778966

Reviewed by Aditya Keerthi.

Currently, we create an NSView unconditionally which may or may not be used.
Creating the fake NSView should be restricted to the case when the viewless
drawing is not supported.

Because viewless cell drawing is still in progress, we are going to enable it if
GPUP is enabled on macOS only for now.

This will require moving the call to ControlFactoryMac::drawingView() from the
super classes `draw()` methods deeper inside the base class ControlMac methods
after we check `supportsViewlessCells()` and find it is false.

The call to `[window setDefaultButtonCell:buttonCell]` was removed from drawing
the default button. We call `[m_defaultButtonCell setKeyEquivalent:@"\r"]` when
creating the NSButtonCell for the default button. And this is sufficient to make
the drawing correct: the dark background and the white text.

The calls to [sliderCell startTrackingAt:] and [sliderCell stopTracking:] were
removed also. The methods seem to be related to interacting with NSSliderCell
and they do not affect the drawing. The interaction with the SliderThumb part is
managed by WebKit which decides where to display this control part.

ControlMac::drawCellOrFocusRing() should be responsible of creating an instance
of LocalCurrentGraphicsContext because the caller which is `ControlMac::drawCell()`
may change the drawing GraphicsContext to an intermediate ImageBuffer for scaling.

For clarity, make instantiating an instance of LocalDefaultSystemAppearance and
an instance of GraphicsContextStateSaver if needed be the responsibility of the
super classes `draw()` methods.

Another clean-up was added. The exception block controls can be moved from the
super classes `draw()` methods to ControlMac::drawCellOrFocusRing().

* Source/WebCore/platform/graphics/mac/controls/ButtonMac.mm:
(WebCore::ButtonMac::draw):
* Source/WebCore/platform/graphics/mac/controls/ColorWellMac.mm:
(WebCore::ColorWellMac::draw):
* Source/WebCore/platform/graphics/mac/controls/ControlMac.h:
* Source/WebCore/platform/graphics/mac/controls/ControlMac.mm:
(WebCore::supportsViewlessCells):
(WebCore::drawViewlessCell):
(WebCore::ControlMac::drawCellInternal):
(WebCore::drawViewlessCellFocusRing):
(WebCore::ControlMac::drawCellFocusRingInternal):
(WebCore::ControlMac::drawCellFocusRing):
(WebCore::ControlMac::drawCellOrFocusRing):
(WebCore::ControlMac::drawCell):
(WebCore::ControlMac::drawListButton):
(WebCore::drawCellFocusRing): Deleted.
* Source/WebCore/platform/graphics/mac/controls/ImageControlsButtonMac.mm:
(WebCore::ImageControlsButtonMac::draw):
* Source/WebCore/platform/graphics/mac/controls/MenuListMac.mm:
(WebCore::MenuListMac::draw):
* Source/WebCore/platform/graphics/mac/controls/MeterMac.mm:
(WebCore::MeterMac::draw):
* Source/WebCore/platform/graphics/mac/controls/SearchFieldCancelButtonMac.mm:
(WebCore::SearchFieldCancelButtonMac::draw):
* Source/WebCore/platform/graphics/mac/controls/SearchFieldMac.mm:
(WebCore::SearchFieldMac::draw):
* Source/WebCore/platform/graphics/mac/controls/SearchFieldResultsMac.mm:
(WebCore::SearchFieldResultsMac::draw):
* Source/WebCore/platform/graphics/mac/controls/SliderThumbMac.mm:
(WebCore::SliderThumbMac::updateCellStates):
(WebCore::SliderThumbMac::draw):
* Source/WebCore/platform/graphics/mac/controls/SliderTrackMac.mm:
(WebCore::SliderTrackMac::draw):
* Source/WebCore/platform/graphics/mac/controls/TextFieldMac.mm:
(WebCore::TextFieldMac::draw):
* Source/WebCore/platform/graphics/mac/controls/ToggleButtonMac.mm:
(WebCore::ToggleButtonMac::draw):

Canonical link: https://commits.webkit.org/260726@main




More information about the webkit-changes mailing list