[webkit-changes] [WebKit/WebKit] a8f57b: GraphicsContextCG should clip the paths via CGCont...

Kimmo Kinnunen noreply at github.com
Thu Nov 30 12:20:55 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a8f57b13f2c7937bbd719183f5e60ff868433d87
      https://github.com/WebKit/WebKit/commit/a8f57b13f2c7937bbd719183f5e60ff868433d87
  Author: Kimmo Kinnunen <kkinnunen at apple.com>
  Date:   2023-11-30 (Thu, 30 Nov 2023)

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

  Log Message:
  -----------
  GraphicsContextCG should clip the paths via CGContext in GPUP mode
https://bugs.webkit.org/show_bug.cgi?id=252833
rdar://105835901

Reviewed by Said Abou-Hallawa.

Construct the clipped path directly into the CGContext.
Instead of creating a CGPath object, add the path info upon need to
the CGContext.

Removes some of CG work in GPUP receive side where time is spent
just copying the CGPath objects.

The implementation has now duplicated logic:
 - Add path segments to CGPath via PathCG
 - Add path segments to CGContext path

The implementation of both are stored next to each other so that
they keep in sync.

* Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::setCGContextPath):
(WebCore::drawPathWithCGContext):
(WebCore::GraphicsContextCG::drawNativeImageInternal):
(WebCore::GraphicsContextCG::drawPattern):
(WebCore::GraphicsContextCG::drawPath):
(WebCore::GraphicsContextCG::fillPath):
(WebCore::GraphicsContextCG::strokePath):
(WebCore::GraphicsContextCG::fillRect):
(WebCore::GraphicsContextCG::fillRectWithRoundedHole):
(WebCore::GraphicsContextCG::clipOut):
(WebCore::GraphicsContextCG::clipPath):
(WebCore::GraphicsContextCG::beginTransparencyLayer):
(WebCore::GraphicsContextCG::drawLinesForText):
* Source/WebCore/platform/graphics/cg/PathCG.cpp:
(WebCore::addToContextPath):
(WebCore::copyClosingSubpathsApplierFunction):
(WebCore::addToCGContextPath):
* Source/WebCore/platform/graphics/cg/PathCG.h:

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




More information about the webkit-changes mailing list