Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7bac2024cb8c59ad65d1a66d849efc90a6cb45af
      
https://github.com/WebKit/WebKit/commit/7bac2024cb8c59ad65d1a66d849efc90a6cb45af
  Author: Matt Woodrow <[email protected]>
  Date:   2026-01-26 (Mon, 26 Jan 2026)

  Changed paths:
    M Source/WebCore/Headers.cmake
    M Source/WebCore/SaferCPPExpectations/UncountedCallArgsCheckerExpectations
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/platform/Cairo.cmake
    M Source/WebCore/platform/Skia.cmake
    M Source/WebCore/platform/graphics/Path.cpp
    M Source/WebCore/platform/graphics/Path.h
    M Source/WebCore/platform/graphics/PathImpl.cpp
    M Source/WebCore/platform/graphics/PathImpl.h
    M Source/WebCore/platform/graphics/PathStream.h
    M Source/WebCore/platform/graphics/PlatformPathImpl.h
    M Source/WebCore/platform/graphics/RenderingResource.h
    M Source/WebCore/platform/graphics/cairo/PathCairo.cpp
    M Source/WebCore/platform/graphics/cairo/PathCairo.h
    M Source/WebCore/platform/graphics/cg/PathCG.h
    M Source/WebCore/platform/graphics/skia/PathSkia.cpp
    M Source/WebCore/platform/graphics/skia/PathSkia.h
    M Source/WebCore/rendering/svg/legacy/LegacyRenderSVGResourceClipper.cpp
    M Source/WebCore/rendering/svg/legacy/LegacyRenderSVGShape.cpp
    M Source/WebCore/svg/SVGPathSegList.h
    M Source/WebKit/GPUProcess/graphics/RemoteGraphicsContext.cpp
    M Source/WebKit/GPUProcess/graphics/RemoteGraphicsContext.h
    M Source/WebKit/GPUProcess/graphics/RemoteGraphicsContext.messages.in
    M Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp
    M Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.h
    M Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.messages.in
    M Source/WebKit/GPUProcess/graphics/RemoteResourceCache.cpp
    M Source/WebKit/GPUProcess/graphics/RemoteResourceCache.h
    M Source/WebKit/Scripts/webkit/messages.py
    M Source/WebKit/Scripts/webkit/tests/MessageArgumentDescriptions.cpp
    M Source/WebKit/Shared/WTFArgumentCoders.serialization.in
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    M Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextProxy.cpp
    M Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextProxy.h
    A Source/WebKit/WebProcess/GPU/graphics/RemotePathImplIdentifier.h
    M Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp
    M Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h
    M Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp
    M Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.h

  Log Message:
  -----------
  Support caching PathImpl instance in the RemoteResourceCache.
https://bugs.webkit.org/show_bug.cgi?id=302209
<rdar://problem/164338336>

Reviewed by Kimmo Kinnunen and Simon Fraser.

Serializing paths can be expensive. Having a retained IPC object for paths that
get reused frequently would improve performance.

Path itself isn't refcounted, and is mutable. The contained PathImpl is
copy-on-write immutable (using DataRef), so this is used as the cached object.

Opts in to the cached paths for svg fill and clip paths, as these are likely to
be rendered multiple times.

* Source/WebCore/Headers.cmake:
* Source/WebCore/SaferCPPExpectations/UncountedCallArgsCheckerExpectations:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/platform/Cairo.cmake:
* Source/WebCore/platform/Skia.cmake:
* Source/WebCore/platform/graphics/Path.cpp:
(WebCore::Path::definitelyEqual const):
(WebCore::Path::ensureProtectedPlatformPathImpl):
(WebCore::Path::setNotTransient):
(WebCore::Path::addPath):
(WebCore::Path::applyElements const):
(WebCore::Path::transform):
(WebCore::Path::platformPath const):
(WebCore::Path::segmentsIfExists const):
(WebCore::Path::contains const):
(WebCore::Path::strokeContains const):
(WebCore::Path::strokeBoundingRect const):
* Source/WebCore/platform/graphics/Path.h:
* Source/WebCore/platform/graphics/PathImpl.cpp:
(WebCore::lockedPathImplObserversMapSingleton):
(WebCore::PathImpl::~PathImpl):
(WebCore::PathImpl::segments const):
(WebCore::PathImpl::addObserver const):
* Source/WebCore/platform/graphics/PathImpl.h:
(WebCore::PathImpl::segmentsIfExists const):
(WebCore::PathImpl::isTransient const):
(WebCore::PathImpl::setNotTransient):
* Source/WebCore/platform/graphics/PathStream.h:
* Source/WebCore/platform/graphics/PlatformPathImpl.h:
* Source/WebCore/platform/graphics/RenderingResource.h:
* Source/WebCore/platform/graphics/cairo/PathCairo.cpp:
* Source/WebCore/platform/graphics/cairo/PathCairo.h:
* Source/WebCore/platform/graphics/cg/PathCG.h:
* Source/WebCore/platform/graphics/skia/PathSkia.cpp:
* Source/WebCore/platform/graphics/skia/PathSkia.h:
* Source/WebCore/rendering/svg/legacy/LegacyRenderSVGResourceClipper.cpp:
(WebCore::LegacyRenderSVGResourceClipper::pathOnlyClipping):
* Source/WebCore/rendering/svg/legacy/LegacyRenderSVGShape.cpp:
(WebCore::LegacyRenderSVGShape::ensurePath):
* Source/WebCore/svg/SVGPathSegList.h:
* Source/WebKit/GPUProcess/graphics/RemoteGraphicsContext.cpp:
(WebKit::RemoteGraphicsContext::clipCachedPath):
(WebKit::RemoteGraphicsContext::fillCachedPath):
* Source/WebKit/GPUProcess/graphics/RemoteGraphicsContext.h:
* Source/WebKit/GPUProcess/graphics/RemoteGraphicsContext.messages.in:
* Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp:
(WebKit::RemoteRenderingBackend::cachePathImpl):
(WebKit::RemoteRenderingBackend::releasePathImpl):
* Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.h:
* Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.messages.in:
* Source/WebKit/GPUProcess/graphics/RemoteResourceCache.cpp:
(WebKit::RemoteResourceCache::cachePathImpl):
(WebKit::RemoteResourceCache::releasePathImpl):
(WebKit::RemoteResourceCache::cachedPathImpl const):
(WebKit::RemoteResourceCache::releaseMemory):
* Source/WebKit/GPUProcess/graphics/RemoteResourceCache.h:
* Source/WebKit/Scripts/webkit/messages.py:
(atomic_object_identifier):
(serialized_identifiers):
* Source/WebKit/Scripts/webkit/tests/MessageArgumentDescriptions.cpp:
(IPC::serializedIdentifiers):
* Source/WebKit/Shared/WTFArgumentCoders.serialization.in:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextProxy.cpp:
(WebKit::RemoteGraphicsContextProxy::clipPath):
(WebKit::RemoteGraphicsContextProxy::fillPath):
(WebKit::RemoteGraphicsContextProxy::recordResourceUse):
* Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextProxy.h:
* Source/WebKit/WebProcess/GPU/graphics/RemotePathImplIdentifier.h: Added.
* Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:
(WebKit::RemoteRenderingBackendProxy::cachePathImpl):
(WebKit::RemoteRenderingBackendProxy::releasePathImpl):
* Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h:
* Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp:
(WebKit::RemoteResourceCacheProxy::recordPathImplUse):
(WebKit::RemoteResourceCacheProxy::willDestroyPathImpl):
(WebKit::RemoteResourceCacheProxy::releaseMemory):
(WebKit::RemoteResourceCacheProxy::disconnect):
* Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.h:

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



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

Reply via email to