-
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.
Cherry-pick 271199@main (d132cc1). rdar://119538536
PathSegments cannot be used with anything else than PathImpl https://bugs.webkit.org/show_bug.cgi?id=265247 rdar://118717060 Reviewed by Said Abou-Hallawa. PathImpl and PathSegment were coupled: PathImpl::appendSegment would call into PathSegment::addToImpl PathSegment::addToImpl would call into PathImpl This would be more complex than needed and also limit the PathSegments to be only used with PathImpl. Instead: - PathSegment is the data that is being held -- no actions toward any class that does actual work on the data. - PathImpl knows how to use the path segment types: PathImpl::add() for each path segment type. - PathImpl knows how to use the PathSegment variant: PathImpl::addSegment() for the PathSegment, doing generic add() over the variants. - Make each member function for adding segments PathImpl::add(). This way generic algorithms over the variants are consistent to write. - The PathImpl::add() parameters are by-value to avoid introducing indirection, the arguments are always used. Construct PathCG, PathCairo from PathStream without applySegments, as the PathStream segment list can be just iterated. This works towards being able to play back a PathSegment list to a CGContext. * Source/WebCore/platform/graphics/PathImpl.cpp: (WebCore::PathImpl::appendSegment): Deleted. * Source/WebCore/platform/graphics/PathImpl.h: (WebCore::addPathSegment): * Source/WebCore/platform/graphics/PathSegment.cpp: (WebCore::PathSegment::addToImpl const): Deleted. * Source/WebCore/platform/graphics/PathSegment.h: (WebCore::PathSegment::addTo const): * Source/WebCore/platform/graphics/PathSegmentData.cpp: (WebCore::PathMoveTo::addToImpl const): Deleted. (WebCore::PathLineTo::addToImpl const): Deleted. (WebCore::PathQuadCurveTo::addToImpl const): Deleted. (WebCore::PathBezierCurveTo::addToImpl const): Deleted. (WebCore::PathArcTo::addToImpl const): Deleted. (WebCore::PathArc::addToImpl const): Deleted. (WebCore::PathEllipse::addToImpl const): Deleted. (WebCore::PathEllipseInRect::addToImpl const): Deleted. (WebCore::PathRect::addToImpl const): Deleted. (WebCore::PathRoundedRect::addToImpl const): Deleted. (WebCore::PathDataLine::addToImpl const): Deleted. (WebCore::PathDataQuadCurve::addToImpl const): Deleted. (WebCore::PathDataBezierCurve::addToImpl const): Deleted. (WebCore::PathDataArc::addToImpl const): Deleted. (WebCore::PathCloseSubpath::addToImpl const): Deleted. * Source/WebCore/platform/graphics/PathSegmentData.h: * Source/WebCore/platform/graphics/cairo/PathCairo.cpp: (WebCore::PathCairo::create): * Source/WebCore/platform/graphics/cg/PathCG.cpp: (WebCore::PathCG::create): Canonical link: https://commits.webkit.org/271199@main Canonical link: https://commits.webkit.org/267815.632@safari-7617-branch
- Loading branch information
1 parent
0ec30d8
commit b4db56f
Showing
13 changed files
with
213 additions
and
312 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
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
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
Oops, something went wrong.