Skip to content
Discussion options

You must be logged in to vote

1、PAGView vs PAGImageView 对比
在使用场景层面,如果涉及到文本编辑、占位图替换、实色图层修改颜色和全屏播放中的一种,不推荐使用 PAGImageView, 同时推荐PAGImageView 使用 setPath 的加载方式,否则性能可能不如 PAGView,具体原因看这篇文档:https://pag.io/docs/use-pagimageview.html , 核心是要理解 PAGImageView 和 PAGView 的实现差异,对于 PAGImageView 而言,只有渲染结果缓存下来才有价值,如果缓存不下来还不如使用 PAGView, PAGImageView 适用于渲染固定的内容,且缓存内容不是太大(渲染尺寸不易过大、播放时长不是太长,默认占用的磁盘缓存大小为 1 GB,如果缓存超过阈值失效意义也很有限),这样每次都可以读取缓存

2、PAGView 和 PAGImageView 的接口默认都是可以在子线程执行的,除了系统层面要求的接口如 setFrame 等涉及到渲染尺寸的设置,而不是要求在主线程,内部实现层面,渲染都是在子线程,只有上屏才会切换主线程,这个 SDK 内部已经实现了

Replies: 5 comments 8 replies

Comment options

You must be logged in to vote
2 replies
@zeinx920
Comment options

@kevingpqi123
Comment options

Answer selected by kevingpqi123
Comment options

You must be logged in to vote
1 reply
@kevingpqi123
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@stoner0429y-pixel
Comment options

@kevingpqi123
Comment options

@stoner0429y-pixel
Comment options

Comment options

You must be logged in to vote
2 replies
@kevingpqi123
Comment options

@fecloud
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
6 participants