Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1bfbf096b177ccd38479b4d3f890db5643efed34
      
https://github.com/WebKit/WebKit/commit/1bfbf096b177ccd38479b4d3f890db5643efed34
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-06-28 (Sun, 28 Jun 2026)

  Changed paths:
    M Source/WebCore/platform/graphics/GraphicsContext.cpp
    M Tools/TestWebKitAPI/Tests/WebCore/cocoa/GraphicsContextCGTests.mm

  Log Message:
  -----------
  GraphicsContext::fillRoundedRect and fillRect clobber an active non-Normal 
blend mode
https://bugs.webkit.org/show_bug.cgi?id=317999
rdar://180786679

Reviewed by Kimmo Kinnunen.

GraphicsContext::fillRoundedRect() and the
fillRect(rect, color, op, blendMode) overload save and restore only the
composite operator around their temporary state change. They read the
operator after the blend mode has already been mutated and restore it
with setCompositeOperation(), whose blendMode parameter defaults to
BlendMode::Normal. This silently drops any non-Normal blend mode that was
active on the context before the call.

Capture the full CompositeMode (operator + blend mode) before mutating
and restore it with setCompositeMode().

Test: Tools/TestWebKitAPI/Tests/WebCore/cocoa/GraphicsContextCGTests.mm

* Source/WebCore/platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::fillRoundedRect):
* Tools/TestWebKitAPI/Tests/WebCore/cocoa/GraphicsContextCGTests.mm:
(TestWebKitAPI::TEST(GraphicsContextTests, 
FillRoundedRectPreservesActiveBlendMode)):
(TestWebKitAPI::TEST(GraphicsContextTests, 
FillRectWithBlendModePreservesActiveBlendMode)):

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



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

Reply via email to