Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 75b6c00

Browse files
csmartdalton86Skia Commit-Bot
authored andcommitted
Revert "Convert pathkit's usage of SkPath::Iter to SkPatPriv::RangeIter"
This reverts commit 999257d. Reason for revert: Iter does not behave the same as RangeIter Original change's description: > Convert pathkit's usage of SkPath::Iter to SkPatPriv::RangeIter > > Change-Id: If940941a66c1fda508970a73d8433a2d2a292e1c > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287894 > Reviewed-by: Kevin Lubick <[email protected]> > Commit-Queue: Chris Dalton <[email protected]> [email protected],[email protected] # Not skipping CQ checks because original CL landed > 1 day ago. Change-Id: Id1028577631ab616a60e0be71e27b32d9a1255e1 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290188 Reviewed-by: Chris Dalton <[email protected]> Commit-Queue: Chris Dalton <[email protected]>
1 parent 839e70f commit 75b6c00

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

modules/pathkit/pathkit_wasm_bindings.cpp

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -259,31 +259,36 @@ SkPathOrNull EMSCRIPTEN_KEEPALIVE ResolveBuilder(SkOpBuilder& builder) {
259259
//========================================================================================
260260

261261
void EMSCRIPTEN_KEEPALIVE ToCanvas(const SkPath& path, emscripten::val /* Path2D or Canvas*/ ctx) {
262-
for (auto [verb, pts, w] : SkPathPriv::Iterate(path)) {
262+
SkPath::Iter iter(path, false);
263+
SkPoint pts[4];
264+
SkPath::Verb verb;
265+
while ((verb = iter.next(pts)) != SkPath::kDone_Verb) {
263266
switch (verb) {
264-
case SkPathVerb::kMove:
267+
case SkPath::kMove_Verb:
265268
ctx.call<void>("moveTo", pts[0].x(), pts[0].y());
266269
break;
267-
case SkPathVerb::kLine:
270+
case SkPath::kLine_Verb:
268271
ctx.call<void>("lineTo", pts[1].x(), pts[1].y());
269272
break;
270-
case SkPathVerb::kQuad:
273+
case SkPath::kQuad_Verb:
271274
ctx.call<void>("quadraticCurveTo", pts[1].x(), pts[1].y(), pts[2].x(), pts[2].y());
272275
break;
273-
case SkPathVerb::kConic:
276+
case SkPath::kConic_Verb:
274277
SkPoint quads[5];
275278
// approximate with 2^1=2 quads.
276-
SkPath::ConvertConicToQuads(pts[0], pts[1], pts[2], *w, quads, 1);
279+
SkPath::ConvertConicToQuads(pts[0], pts[1], pts[2], iter.conicWeight(), quads, 1);
277280
ctx.call<void>("quadraticCurveTo", quads[1].x(), quads[1].y(), quads[2].x(), quads[2].y());
278281
ctx.call<void>("quadraticCurveTo", quads[3].x(), quads[3].y(), quads[4].x(), quads[4].y());
279282
break;
280-
case SkPathVerb::kCubic:
283+
case SkPath::kCubic_Verb:
281284
ctx.call<void>("bezierCurveTo", pts[1].x(), pts[1].y(), pts[2].x(), pts[2].y(),
282285
pts[3].x(), pts[3].y());
283286
break;
284-
case SkPathVerb::kClose:
287+
case SkPath::kClose_Verb:
285288
ctx.call<void>("closePath");
286289
break;
290+
case SkPath::kDone_Verb:
291+
break;
287292
}
288293
}
289294
}

0 commit comments

Comments
 (0)