Bug 262198 - [CG] Add the path segments directly to the CGContext instead of creating a CGPath then adding it
Summary: [CG] Add the path segments directly to the CGContext instead of creating a CG...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-09-27 10:26 PDT by Said Abou-Hallawa
Modified: 2023-09-27 10:53 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2023-09-27 10:26:02 PDT
If the Path is represented as PathStream, it is better to directly add these segments to the CGContext instead of creating a CGPath then adding the CGPath to the CGContext. CGContextBeginPath() creates a CGPath to receive the PathSegments to the intermediate CGPath.

With GPUProcess and before 265569@main we used to create three CGPaths when calling GraphicsContext::fillPath() for example:

1. The first we create to hold the PathSegments in WebProcess
2. The second is created when decoding the PathSegments in GPUProcess
3. The third is created by CGContextBeginPath() to receive the second CGPath

After 265569@main, the first CGPath is eliminated because the PathSegments are now stored as PathStream and it can be use for encoding and decoding the Path.

With this change, we can eliminate the second one also.
Comment 1 Said Abou-Hallawa 2023-09-27 10:27:19 PDT
rdar://116090971
Comment 2 Said Abou-Hallawa 2023-09-27 10:53:38 PDT
Pull request: https://github.com/WebKit/WebKit/pull/18293