Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add back inline storage to WebCore::Path
https://bugs.webkit.org/show_bug.cgi?id=259326 rdar://112501668 Reviewed by Simon Fraser. After https://commits.webkit.org/265569@main, we have three separate heap allocations when creating a WebCore::Path with a single segment. (The PathStream, the SegmentsData, and its Vector buffer.) These heap allocations show up on profiles, and were part of a MotionMark Canvas Lines regression. * Source/WebCore/platform/graphics/Path.cpp: (WebCore::Path::Path): (WebCore::Path::operator=): (WebCore::Path::operator== const): (WebCore::Path::setImpl): (WebCore::Path::ensurePlatformPathImpl): (WebCore::Path::ensureImpl): (WebCore::Path::asImpl): (WebCore::Path::asImpl const): (WebCore::Path::moveTo): (WebCore::Path::asSingleMoveTo const): (WebCore::Path::addLineTo): (WebCore::Path::addQuadCurveTo): (WebCore::Path::addBezierCurveTo): (WebCore::Path::addArcTo): (WebCore::Path::addArc): (WebCore::Path::addEllipse): (WebCore::Path::addEllipseInRect): (WebCore::Path::addRect): (WebCore::Path::addRoundedRect): (WebCore::Path::closeSubpath): (WebCore::Path::applySegments const): (WebCore::Path::clear): (WebCore::Path::singleSegment const): (WebCore::Path::singleDataLine const): (WebCore::Path::singleArc const): (WebCore::Path::singleQuadCurve const): (WebCore::Path::singleBezierCurve const): (WebCore::Path::isEmpty const): (WebCore::Path::segmentsIfExists const): (WebCore::Path::isClosed const): (WebCore::Path::currentPoint const): (WebCore::Path::fastBoundingRect const): (WebCore::Path::boundingRect const): * Source/WebCore/platform/graphics/Path.h: (WebCore::Path::singleSegmentIfExists const): (WebCore::Path::asSingle): (WebCore::Path::asSingle const): * Source/WebCore/platform/graphics/PathStream.cpp: (WebCore::PathStream::create): (WebCore::PathStream::PathStream): (WebCore::PathStream::addArc): * Source/WebCore/platform/graphics/PathStream.h: Canonical link: https://commits.webkit.org/266156@main
- Loading branch information