[webkit-changes] [WebKit/WebKit] c31a03: [threaded-animation-resolution] add support for bl...

Antoine Quint noreply at github.com
Mon Feb 5 10:01:18 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c31a0356b67ea73b401b95a0062ea2d393003de9
      https://github.com/WebKit/WebKit/commit/c31a0356b67ea73b401b95a0062ea2d393003de9
  Author: Antoine Quint <graouts at webkit.org>
  Date:   2024-02-05 (Mon, 05 Feb 2024)

  Changed paths:
    M Source/WebCore/PAL/pal/spi/cocoa/QuartzCoreSPI.h
    M Source/WebCore/platform/animation/AcceleratedEffect.cpp
    M Source/WebCore/platform/animation/AcceleratedEffect.h
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteAcceleratedEffectStack.h
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteAcceleratedEffectStack.mm
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm

  Log Message:
  -----------
  [threaded-animation-resolution] add support for blending `opacity` values
https://bugs.webkit.org/show_bug.cgi?id=268738
rdar://122304627

Reviewed by Simon Fraser.

In order to add support for blending `opacity` values we make `AcceleratedEffect`
adopt the `KeyframeInterpolation::interpolateKeyframes()` method and its various
callbacks to deal with `AcceleratedEffect::Keyframe` values. We wrap this into
the new `AcceleratedEffect::apply()` method which is called from `RemoteAcceleratedEffectStack`
in the `computeValues()` method.

We compute the blended values in three different places in `RemoteAcceleratedEffectStack`.

When we resolve effects on the main thread (macOS) we have an `initEffectsFromScrollingThread()`
method to initialize the `CAPresentationModifier` objects which will apply the blended
values, and then on subsequent display updates we call `applyEffectsFromScrollingThread()`.

When we resolve effects on the scrolling thread (iOS) there is no initialization step
required and the single `applyEffectsFromScrollingThread()` method suffices.

Future patches will add support for the other transform-related and filter-related
accelerated properties.

* Source/WebCore/PAL/pal/spi/cocoa/QuartzCoreSPI.h:
* Source/WebCore/platform/animation/AcceleratedEffect.cpp:
(WebCore::blend):
(WebCore::AcceleratedEffect::apply):
* Source/WebCore/platform/animation/AcceleratedEffect.h:
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteAcceleratedEffectStack.h:
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteAcceleratedEffectStack.mm:
(WebKit::RemoteAcceleratedEffectStack::initEffectsFromScrollingThread):
(WebKit::RemoteAcceleratedEffectStack::applyEffectsFromScrollingThread const):
(WebKit::RemoteAcceleratedEffectStack::applyEffectsFromMainThread const):
(WebKit::RemoteAcceleratedEffectStack::computeValues const):
(WebKit::RemoteAcceleratedEffectStack::clear):

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




More information about the webkit-changes mailing list