Skip to content

CanvasKit - Path.reset doesn't reset FillType #66502

@luigi-rosso

Description

@luigi-rosso

When calling reset on a CkPath, the backing SkPath FillType is reset to kWinding_FillType:

https://github.com/google/skia/blob/1b89eb742a66257cd780f119c537e833f4554f53/src/core/SkPath.cpp#L163

When Flutter's CanvasKit Path.reset calls the backing SkPath's reset, it does not reset its own cached fillType:
https://github.com/flutter/engine/blob/b4fb5bb8be167d4f923ee6b760b5c076cbecf308/lib/web_ui/lib/src/engine/canvaskit/path.dart#L260

This results in the cached _fillType being incorrect and any attempt to set it may incorrectly early out thinking the backing path is synced:
https://github.com/flutter/engine/blob/b4fb5bb8be167d4f923ee6b760b5c076cbecf308/lib/web_ui/lib/src/engine/canvaskit/path.dart#L33-L35

We're seeing this in Rive where we call Path.reset on a path with evenOdd fill rule. The CkPath will think the rule is still set to evenOdd, but the backing SkPath has been reset to nonZero (kWinding_FillType).

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listcustomer: thrivecustomer: web10e: web_canvaskitCanvasKit (a.k.a. Skia-on-WebGL) rendering backend for Webengineflutter/engine related. See also e: labels.platform-webWeb applications specifically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions