[webkit-changes] [WebKit/WebKit] 4729a9: [Materials] Add rendering support for vibrancy eff...

Aditya Keerthi noreply at github.com
Wed Feb 5 19:54:30 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4729a93d096e6934a2a4375977e885ef005eadea
      https://github.com/WebKit/WebKit/commit/4729a93d096e6934a2a4375977e885ef005eadea
  Author: Aditya Keerthi <akeerthi at apple.com>
  Date:   2025-02-05 (Wed, 05 Feb 2025)

  Changed paths:
    M LayoutTests/apple-visual-effects/apple-visual-effect-blur-material-chrome-expected.txt
    M LayoutTests/apple-visual-effects/apple-visual-effect-blur-material-expected.txt
    M LayoutTests/apple-visual-effects/apple-visual-effect-blur-material-thick-expected.txt
    M LayoutTests/apple-visual-effects/apple-visual-effect-blur-material-thin-expected.txt
    M LayoutTests/apple-visual-effects/apple-visual-effect-blur-material-ultra-thin-expected.txt
    A LayoutTests/apple-visual-effects/apple-visual-effect-vibrancy-effects-expected.txt
    A LayoutTests/apple-visual-effects/apple-visual-effect-vibrancy-effects.html
    M LayoutTests/platform/ios/apple-visual-effects/apple-visual-effect-blur-material-chrome-expected.txt
    M LayoutTests/platform/ios/apple-visual-effects/apple-visual-effect-blur-material-expected.txt
    M LayoutTests/platform/ios/apple-visual-effects/apple-visual-effect-blur-material-thick-expected.txt
    M LayoutTests/platform/ios/apple-visual-effects/apple-visual-effect-blur-material-thin-expected.txt
    M LayoutTests/platform/ios/apple-visual-effects/apple-visual-effect-blur-material-ultra-thin-expected.txt
    A LayoutTests/platform/ios/apple-visual-effects/apple-visual-effect-vibrancy-effects-expected.txt
    M Source/WebCore/PAL/pal/cocoa/CoreMaterialSoftLink.h
    M Source/WebCore/PAL/pal/cocoa/CoreMaterialSoftLink.mm
    M Source/WebCore/PAL/pal/spi/cocoa/CoreMaterialSPI.h
    M Source/WebCore/PAL/pal/spi/cocoa/QuartzCoreSPI.h
    M Source/WebCore/platform/cocoa/AppleVisualEffect.cpp
    M Source/WebCore/platform/cocoa/AppleVisualEffect.h
    M Source/WebCore/platform/graphics/GraphicsLayer.cpp
    M Source/WebCore/platform/graphics/GraphicsLayer.h
    M Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
    M Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
    M Source/WebCore/platform/graphics/ca/PlatformCALayer.h
    M Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h
    M Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm
    M Source/WebCore/rendering/RenderLayerBacking.cpp
    M Source/WebCore/rendering/style/RenderStyle.cpp
    M Source/WebCore/rendering/style/RenderStyle.h
    M Source/WebCore/rendering/style/RenderStyleInlines.h
    M Source/WebCore/rendering/style/RenderStyleSetters.h
    M Source/WebCore/rendering/style/StyleRareInheritedData.cpp
    M Source/WebCore/rendering/style/StyleRareInheritedData.h
    M Source/WebCore/style/StyleAdjuster.cpp
    M Source/WebKit/Shared/RemoteLayerTree/LayerProperties.h
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTree.serialization.in
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
    M Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h
    M Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.mm

  Log Message:
  -----------
  [Materials] Add rendering support for vibrancy effects
https://bugs.webkit.org/show_bug.cgi?id=286992
rdar://144138408

Reviewed by Megan Gardner, Richard Robinson, and Abrar Rahman Protyasha.

Apply filters from CoreMaterial when using `-apple-visual-effect` with one of
the `-apple-system-vibrancy` keywords. Note that this is not web-exposed.

* LayoutTests/apple-visual-effects/apple-visual-effect-blur-material-chrome-expected.txt:
* LayoutTests/apple-visual-effects/apple-visual-effect-blur-material-expected.txt:
* LayoutTests/apple-visual-effects/apple-visual-effect-blur-material-thick-expected.txt:
* LayoutTests/apple-visual-effects/apple-visual-effect-blur-material-thin-expected.txt:
* LayoutTests/apple-visual-effects/apple-visual-effect-blur-material-ultra-thin-expected.txt:
* LayoutTests/apple-visual-effects/apple-visual-effect-vibrancy-effects-expected.txt: Added.
* LayoutTests/apple-visual-effects/apple-visual-effect-vibrancy-effects.html: Added.
* LayoutTests/platform/ios/apple-visual-effects/apple-visual-effect-blur-material-chrome-expected.txt:
* LayoutTests/platform/ios/apple-visual-effects/apple-visual-effect-blur-material-expected.txt:
* LayoutTests/platform/ios/apple-visual-effects/apple-visual-effect-blur-material-thick-expected.txt:
* LayoutTests/platform/ios/apple-visual-effects/apple-visual-effect-blur-material-thin-expected.txt:
* LayoutTests/platform/ios/apple-visual-effects/apple-visual-effect-blur-material-ultra-thin-expected.txt:
* LayoutTests/platform/ios/apple-visual-effects/apple-visual-effect-vibrancy-effects-expected.txt: Added.
* Source/WebCore/PAL/pal/cocoa/CoreMaterialSoftLink.h:
* Source/WebCore/PAL/pal/cocoa/CoreMaterialSoftLink.mm:
* Source/WebCore/PAL/pal/spi/cocoa/CoreMaterialSPI.h:
* Source/WebCore/PAL/pal/spi/cocoa/QuartzCoreSPI.h:
* Source/WebCore/platform/cocoa/AppleVisualEffect.cpp:
(WebCore::appleVisualEffectAppliesFilter):
(WebCore::operator<<):
* Source/WebCore/platform/cocoa/AppleVisualEffect.h:

Introduce `AppleVisualEffectData` to encompass a primary effect and a context
effect. This is necessary as vibrancy effects are dependent on the nearest blur
material.

* Source/WebCore/platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::needsBackdrop const):
(WebCore::GraphicsLayer::dumpProperties const):
* Source/WebCore/platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::appleVisualEffectData const):
(WebCore::GraphicsLayer::setAppleVisualEffectData):
(WebCore::GraphicsLayer::appleVisualEffect const): Deleted.
(WebCore::GraphicsLayer::setAppleVisualEffect): Deleted.
* Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setAppleVisualEffectData):
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::updateBackdropFilters):
(WebCore::GraphicsLayerCA::updateAppleVisualEffectData):

Apply the vibrancy effect to the main layer.

(WebCore::GraphicsLayerCA::purposeNameForInnerLayer const):
(WebCore::GraphicsLayerCA::setAppleVisualEffect): Deleted.
(WebCore::GraphicsLayerCA::updateAppleVisualEffect): Deleted.
* Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h:
* Source/WebCore/platform/graphics/ca/PlatformCALayer.h:
* Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayerCocoa::appleVisualEffectData const):

Make this method an actual stub, since it does nothing right now.

(WebCore::PlatformCALayerCocoa::setAppleVisualEffectData):

Make this method an actual stub, since it does nothing right now.

(WebCore::PlatformCALayerCocoa::appleVisualEffect const): Deleted.
(WebCore::PlatformCALayerCocoa::setAppleVisualEffect): Deleted.
* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateAppleVisualEffect):

Ensure the context effect is also provided, so that the vibrancy effect may be resolved.

* Source/WebCore/rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayerRepaint const):
* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/rendering/style/RenderStyleInlines.h:
(WebCore::RenderStyle::usedAppleVisualEffectForSubtree const):
* Source/WebCore/rendering/style/RenderStyleSetters.h:
(WebCore::RenderStyle::setUsedAppleVisualEffectForSubtree):
* Source/WebCore/rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):
(WebCore::StyleRareInheritedData::dumpDifferences const):
* Source/WebCore/rendering/style/StyleRareInheritedData.h:
* Source/WebCore/style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjust const):

Ensure the used blur (material) effect is propagated down the tree, so that
vibrancy effects may be resolved correctly.

* Source/WebKit/Shared/RemoteLayerTree/LayerProperties.h:
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTree.serialization.in:
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
(WebKit::materialRecipeForAppleVisualEffect):
(WebKit::materialVisualStyleForAppleVisualEffect):
(WebKit::materialVisualStyleCategoryForAppleVisualEffect):
(WebKit::applyVisualStylingToLayer):

Read the filter definition from CoreMaterial, and apply to the layer.

(WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer):
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::dumpChangedLayers):
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.mm:
(WebKit::PlatformCALayerRemote::appleVisualEffectData const):
(WebKit::PlatformCALayerRemote::setAppleVisualEffectData):
(WebKit::PlatformCALayerRemote::appleVisualEffect const): Deleted.
(WebKit::PlatformCALayerRemote::setAppleVisualEffect): Deleted.

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list