fonttools / skia-pathops

Python bindings for the Skia library's Path Ops
https://skia.org/docs/dev/present/pathops/
BSD 3-Clause "New" or "Revised" License
47 stars 14 forks source link

SkConic.computeQuadPOW2 method is not in public include/core/* headers #33

Closed anthrotype closed 4 years ago

anthrotype commented 4 years ago

In src/python/pathops/_skia/core.pxd we import some symbols that are not exported in the Skia include/ public headers.

This makes it hard to compile the pathops bindings with an external pre-built copy of the Skia library, without access to the skia src/ directory where SkGeometry.h is located.

In particular it's the SkConic struct and its computeQuadPOW2 method, that are used inside Path.convertConicsToQuads to compute the number of quads needed to approximate a conic given a tolerance.

Given that function is relatively trivial, we should just reimplement it in cython https://github.com/google/skia/blob/52a4379f03f7cd4e1c67eb69a756abc5838a658f/src/core/SkGeometry.cpp#L1198-L1231