Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b42f9106d95496499bb100f76585a40fc666d7c0
      
https://github.com/WebKit/WebKit/commit/b42f9106d95496499bb100f76585a40fc666d7c0
  Author: Simon Fraser <[email protected]>
  Date:   2025-07-04 (Fri, 04 Jul 2025)

  Changed paths:
    M Source/WebCore/platform/graphics/cg/GradientRendererCG.cpp

  Log Message:
  -----------
  REGRESSION (294844@main): Choppy scrolling on kottke.org
https://bugs.webkit.org/show_bug.cgi?id=295434
rdar://152254822

Reviewed by Abrar Rahman Protyasha.

kottke.org has some repeating gradients with `background-attachment:fixed`,
which means they paint on every scroll. The color stop colorspace conversion
added in 294844@main runs on every stop, so we end up doing hundreds of
redundant conversions per paint.

Fix by adding a 32-entry cache of converted color components, which is
cleared if the destination colorspace changes. It's locked since this code
has to be threadsafe for offscreen canvas.

I considered using a TinyLRUCache, but it's entry creation callback doesn't
have a way to provide context.

* Source/WebCore/platform/graphics/cg/GradientRendererCG.cpp:
(WebCore::getResolvedColorComponentsInColorSpace):
(WebCore::GradientRendererCG::makeGradient const):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to