Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d6d04572bb96566d4ecb88adea1516bbb4cf628b
      
https://github.com/WebKit/WebKit/commit/d6d04572bb96566d4ecb88adea1516bbb4cf628b
  Author: Nikolas Zimmermann <[email protected]>
  Date:   2026-08-09 (Sun, 09 Aug 2026)

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

  Log Message:
  -----------
  Skip fill/stroke CGColor conversion for gradient and pattern brushes
https://bugs.webkit.org/show_bug.cgi?id=321376

Reviewed by Simon Fraser.

GraphicsContextCG::didUpdateState() converted the brush color to a CGColor on
every FillBrush/StrokeBrush state change, even when the brush is a gradient or
pattern. Those paint directly and never consume the stored fill/stroke color, so
the conversion is wasted.

Guard both cases with SourceBrush::hasPatternOrGradient(). Switching back to a
solid color re-flags the brush change and sets the color again, so state stays
correct.

Covered by existing tests.

* Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContextCG::didUpdateState):

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



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

Reply via email to