Skip to content

tgfx里有没有类似skia的setPathEffect功能 #505

Answered by domchen
wuqi asked this question in Q&A
Discussion options

You must be logged in to vote

有PathEffect :https://github.com/Tencent/tgfx/blob/main/include/tgfx/core/PathEffect.h ,但不用设置给Paint,直接applyToPath就行。或者基于 Shape 类构造一个延迟应用的 Path:https://github.com/Tencent/tgfx/blob/main/include/tgfx/core/Shape.h#L85 。 Skia的设置给Paint的PathEffect也是直接在调用的时候就帮你应用上去,这种用法的区别其实不大。更有价值的其实是 tgfx 提供了延迟的 Shape 类,通过这个应用 PathEffect 可以不阻塞调用线程。内部会并多线程发起来帮你生成最终 Path。

具体到SkLine2DPathEffect和SkDiscretePathEffect因为很少使用到,我们一开始就没实现。可以描述一下详细的使用场景吗?我们看看是否比较通用,再考虑排期加上。

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@wuqi
Comment options

@domchen
Comment options

@wuqi
Comment options

@domchen
Comment options

Answer selected by domchen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants