[webkit-changes] [WebKit/WebKit] 1140e6: Support extended color animation interpolation

Sam Weinig noreply at github.com
Wed Sep 28 09:11:33 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1140e61c63402f8b7f84b620960a1a28a2ce4513
      https://github.com/WebKit/WebKit/commit/1140e61c63402f8b7f84b620960a1a28a2ce4513
  Author: Sam Weinig <weinig at apple.com>
  Date:   2022-09-28 (Wed, 28 Sep 2022)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/css/css-color/animation/color-interpolation-expected.txt
    M Source/WebCore/platform/graphics/ColorBlending.cpp
    M Source/WebCore/platform/graphics/ColorNormalization.h

  Log Message:
  -----------
  Support extended color animation interpolation
https://bugs.webkit.org/show_bug.cgi?id=245645
<rdar://100437917>

Reviewed by Dean Jackson and Antti Koivisto.

Adds support for animating non-sRGB colors by using the new default interpolation
method, OKLab, for cases where one or more of the two keyframes in an animation
interpolation are specified using a non-legacy color syntax (e.g. color(), lch(),
etc.).

For now, there is no syntax for specifying a specific interpolation method to use,
as none has been specified yet, so only the two default spaces, sRGB for legacy
and OKLab for non-legacy are available.

* LayoutTests/imported/w3c/web-platform-tests/css/css-color/animation/color-interpolation-expected.txt:
Update results for additional passing test cases.

* Source/WebCore/platform/graphics/ColorBlending.cpp:
(WebCore::requiresLegacyInterpolationRules): Helper to choose which
kind of interpolation to use.
(WebCore::blend): When using the legacy path, also continue to clamp
to the 8-bit per channel sRGB to avoid any change for existing content.

* Source/WebCore/platform/graphics/ColorNormalization.h:
(WebCore::makeColorTypeByNormalizingComponents):
(WebCore::makeColorTypeByNormalizingComponents<HWBA<float>>):
Interpolation can produce negative and otherwise out of range
values, so ensure we clamp here. Fixes test case where the
progress was set to -0.3.

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




More information about the webkit-changes mailing list