-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore Path cheap copying (refcount/COW PathStream)
https://bugs.webkit.org/show_bug.cgi?id=258758 rdar://111595182 Reviewed by Myles C. Maxfield. 265569@main undid the "copy on write" behavior of class; assigning a Path would copy the underlying PathStream. To fix this, store the Vector<PathSegment> in an internal, thread-safe ref-counted SegmentsData struct, and have PathStream hold a DataRef to this struct. All functions that mutate the path segments call `access()` on the DataRef to trigger a copy. * Source/WebCore/platform/graphics/PathStream.cpp: (WebCore::PathStream::create): (WebCore::PathStream::PathStream): (WebCore::PathStream::clone const): (WebCore::PathStream::operator== const): (WebCore::PathStream::lastIfMoveTo const): (WebCore::PathStream::moveTo): (WebCore::PathStream::addLineTo): (WebCore::PathStream::addQuadCurveTo): (WebCore::PathStream::addBezierCurveTo): (WebCore::PathStream::addArcTo): (WebCore::PathStream::addArc): (WebCore::PathStream::addRect): (WebCore::PathStream::addEllipse): (WebCore::PathStream::addEllipseInRect): (WebCore::PathStream::addRoundedRect): (WebCore::PathStream::closeSubpath): (WebCore::PathStream::segments const): (WebCore::PathStream::applySegments const): (WebCore::PathStream::applyElements const): (WebCore::PathStream::singleSegment const): (WebCore::PathStream::isClosed const): (WebCore::PathStream::currentPoint const): (WebCore::PathStream::fastBoundingRect const): (WebCore::PathStream::boundingRect const): * Source/WebCore/platform/graphics/PathStream.h: Canonical link: https://commits.webkit.org/265810@main
- Loading branch information
Showing
2 changed files
with
94 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters