[webkit-changes] [WebKit/WebKit] 444776: [macOS] Scrollbar corners fail to render with UI-s...

Aditya Keerthi noreply at github.com
Tue Dec 6 12:04:12 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 44477657ccd98fcf58206f2aa87b24ef84556d3a
      https://github.com/WebKit/WebKit/commit/44477657ccd98fcf58206f2aa87b24ef84556d3a
  Author: Aditya Keerthi <akeerthi at apple.com>
  Date:   2022-12-06 (Tue, 06 Dec 2022)

  Changed paths:
    M Source/WebCore/PAL/pal/spi/mac/NSAppearanceSPI.h
    M Source/WebCore/SourcesCocoa.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/platform/graphics/SystemImage.h
    A Source/WebCore/platform/graphics/mac/AppKitControlSystemImage.h
    A Source/WebCore/platform/graphics/mac/AppKitControlSystemImage.mm
    A Source/WebCore/platform/graphics/mac/ScrollbarTrackCornerSystemImageMac.h
    A Source/WebCore/platform/graphics/mac/ScrollbarTrackCornerSystemImageMac.mm
    M Source/WebCore/platform/mac/ScrollbarThemeMac.mm
    M Source/WebKit/Shared/WebCoreArgumentCoders.cpp
    M Source/WebKit/Shared/WebCoreArgumentCoders.h
    M Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm

  Log Message:
  -----------
  [macOS] Scrollbar corners fail to render with UI-side compositing
https://bugs.webkit.org/show_bug.cgi?id=248763
rdar://102906463

Reviewed by Simon Fraser.

Painting scrollbar corners is broken due to the lack of a platform context in
the web process. To fix, delegate drawing to the GPU process by using
`drawSystemImage` and introducing new `SystemImage` subclasses.

Scrollbar corners are currently drawn using AppKit and CoreUI.
`AppKitControlSystemImage` is introduced to provide a generic method of
rendering native controls, encapsulating the desired color scheme and tint
color. `ScrollbarTrackCornerSystemImageMac` is the concrete subclass
responsible for drawing the native control. Additional subclasses will be added
in subsequent patches, to support other controls that are drawn using CoreUI
options (progress bars and datalist dropdown buttons).

* Source/WebCore/PAL/pal/spi/mac/NSAppearanceSPI.h:
* Source/WebCore/SourcesCocoa.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/platform/graphics/SystemImage.h:
* Source/WebCore/platform/graphics/mac/AppKitControlSystemImage.h: Added.
(isType):
* Source/WebCore/platform/graphics/mac/AppKitControlSystemImage.mm: Added. Source/WebCore/platform/graphics/SystemImage.h.
(WebCore::AppKitControlSystemImage::AppKitControlSystemImage):
(WebCore::AppKitControlSystemImage::draw const):
* Source/WebCore/platform/graphics/mac/ScrollbarTrackCornerSystemImageMac.h: Added.
(isType):
* Source/WebCore/platform/graphics/mac/ScrollbarTrackCornerSystemImageMac.mm: Added.
(WebCore::ScrollbarTrackCornerSystemImageMac::ScrollbarTrackCornerSystemImageMac):
(WebCore::ScrollbarTrackCornerSystemImageMac::drawControl const):
* Source/WebCore/platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::paintScrollCorner):
* Source/WebKit/Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<SystemImage>::encode):
(IPC::ArgumentCoder<SystemImage>::decode):
* Source/WebKit/Shared/WebCoreArgumentCoders.h:
* Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<WebCore::AppKitControlSystemImage>::encode):
(IPC::ArgumentCoder<WebCore::AppKitControlSystemImage>::decode):

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




More information about the webkit-changes mailing list