Skip to content

Commit

Permalink
[Skia] Implement kConic_Verb in PathSkia::applyElements
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=273179

Reviewed by Alejandro G. Castro.

Approximate to two quad curves using SkPath::ConvertConicToQuads().

* Source/WebCore/platform/graphics/skia/PathSkia.cpp:
(WebCore::PathSkia::applyElements const):

Canonical link: https://commits.webkit.org/277920@main
  • Loading branch information
carlosgcampos committed Apr 24, 2024
1 parent 0613dc5 commit 995e958
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Source/WebCore/platform/graphics/skia/PathSkia.cpp
Expand Up @@ -219,9 +219,17 @@ bool PathSkia::applyElements(const PathElementApplier& applier) const
pathElement.type = PathElement::Type::AddCurveToPoint;
convertPoints(pathElement.points, &skPoints[1], 3);
break;
case SkPath::kConic_Verb:
notImplemented();
break;
case SkPath::kConic_Verb: {
// Approximate conic with two quads.
pathElement.type = PathElement::Type::AddQuadCurveToPoint;
SkPoint quadPoints[5];
SkPath::ConvertConicToQuads(skPoints[0], skPoints[1], skPoints[2], iter.conicWeight(), quadPoints, 1);
convertPoints(pathElement.points, &quadPoints[1], 2);
applier(pathElement);
convertPoints(pathElement.points, &quadPoints[3], 2);
applier(pathElement);
continue;
}
case SkPath::kClose_Verb:
pathElement.type = PathElement::Type::CloseSubpath;
break;
Expand Down

0 comments on commit 995e958

Please sign in to comment.