Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 63b37855fc3948f0eb24803617ea9fae57bf501e
      
https://github.com/WebKit/WebKit/commit/63b37855fc3948f0eb24803617ea9fae57bf501e
  Author: Kimmo Kinnunen <[email protected]>
  Date:   2025-04-23 (Wed, 23 Apr 2025)

  Changed paths:
    M Source/WebCore/platform/graphics/Path.cpp
    M Source/WebCore/platform/graphics/Path.h
    M Source/WebCore/platform/graphics/cg/PathCG.cpp
    M Source/WebCore/rendering/EventRegion.cpp
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in

  Log Message:
  -----------
  GPUP: Drawing paths spends time in copying path data
https://bugs.webkit.org/show_bug.cgi?id=291630
rdar://149387451

Reviewed by Simon Fraser.

WebCore::Path would have two PathImpl implementations:
  - PathStream where storage is Vector<PathSegment>
  - PathCG, PathCairo, PathSkia where storage is platform path.

Path IPC works on list of PathSegments. This would mean that
since the platform implementation variant could not guarantee a list of
PathSegments storage in place, Vector<PathSegment> would be created for
sending the segments, even for PathStream. This would be slower than
neccesary.

Fix by migrating platform path back to PathStream when the segments are
needed. This way the IPC serialization can always refer to
std::span<PathSegments>, which does not copy redundantly on send side.
Note that the migration is rare. Holding path data with platform path
only happens in WCP if Path::addPath(), Path::transform() or
Path::strokeBoundingRect has been called.

Later commits will work on moving PathStream to Path, simplifying the
implementation further.

* Source/WebCore/platform/graphics/Path.cpp:
(WebCore::Path::Path):
(WebCore::Path::platformPathIfExists const):
(WebCore::Path::segments const):
(WebCore::Path::segmentsIfExists const): Deleted.
* Source/WebCore/platform/graphics/Path.h:
* Source/WebCore/platform/graphics/cg/PathCG.cpp:
(WebCore::addToCGContextPath):
* Source/WebCore/rendering/EventRegion.cpp:
(WebCore::guardRectForRegionBounds):
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:

Canonical link: https://commits.webkit.org/294018@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