Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d74fea7adbbd16841696dc3a899233e1570151de
      
https://github.com/WebKit/WebKit/commit/d74fea7adbbd16841696dc3a899233e1570151de
  Author: Dan Glastonbury <[email protected]>
  Date:   2026-04-16 (Thu, 16 Apr 2026)

  Changed paths:
    A LayoutTests/fast/gradients/alpha-premultiplied-sampled-expected.html
    A LayoutTests/fast/gradients/alpha-premultiplied-sampled.html
    M LayoutTests/platform/ios/TestExpectations
    M Source/WebCore/Configurations/AllowedSPI-legacy.toml
    M Source/WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/platform/graphics/GradientColorStop.h
    A Source/WebCore/platform/graphics/SampledGradientBuilder.h
    M Source/WebCore/platform/graphics/cg/GradientRendererCG.cpp
    M Source/WebCore/platform/graphics/cg/GradientRendererCG.h

  Log Message:
  -----------
  [Re-landing] Draw non-sRGB gradients via CGGradient using sampling
https://bugs.webkit.org/show_bug.cgi?id=312431
rdar://174880197

Reviewed by Matt Woodrow.

The standard colorspace for interpolating colors in gradient on the web is now
OKLab, instead of sRGB. Because CoreGraphics doesn't support OKLab, gradients
are drawn via CGShading, not CGGradient. The overhead of performing colorstop
interpolation shows up in profiles of MotionMark 1.4 Chess subtest.

This change moves the interpolation for non-sRGB colorstops to an upfront
expense of sampling the gradient. Colorstop ranges are sub-divided into segments
that can be linearly interpolated by granularly dividing the stop ranges and
then bisecting the range til an acceptable tolerance is reached. The total
number of stops and tolerance was determined experimentally by comparing to
CoreGraphics.

The resulting colorstops are cached as CGGradient in an LRU cache to amortise
the overhead of the interpolation.

Originally-landed-as: 310405@main (5e93c4d3d62c). rdar://168525666
Canonical link: https://commits.webkit.org/311406@main



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

Reply via email to