Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[g-plugin-device-renderer] Text 初始化后修改 fontSize 存在性能问题 #1422

Closed
xiaoiver opened this issue Jul 19, 2023 · 2 comments
Closed
Assignees
Labels

Comments

@xiaoiver
Copy link
Contributor

xiaoiver commented Jul 19, 2023

下面是 G2 案例切换到 WebGL 渲染器后的效果,可以发现性能问题存在于大量 SDF 生成:

截屏2023-07-19 上午9 47 36

原因是 G2 中创建 Text 都是先使用默认 fontSize(16px)创建,再修改到实际 fontSize,导致两次渲染。
动画时也会卡顿。

@xiaoiver xiaoiver self-assigned this Jul 19, 2023
@xiaoiver xiaoiver added the bug label Jul 19, 2023
@xiaoiver
Copy link
Contributor Author

截屏2023-07-19 下午4 40 09

@xiaoiver
Copy link
Contributor Author

另外在动画时,同时修改 opacity 和 transform 会导致两次 setSubData,可以合并成一次

xiaoiver added a commit that referenced this issue Jul 21, 2023
* fix: enhance perf of Text when fontSize changed in webgl #1422

* chore: commit changeset

* fix: draw 1px sub-pixel line correctly in webgl #1425

* chore: commit changeset

* chore: add testcase for sub-pixel line #1425

* fix: convertToPath should account for Rect with undefined x/y

* chore: commit changeset

* fix: make FillMesh instanced to enhance perf #1359

* chore: commit changeset

* fix: make textBaseline in SVG the same with Canvas #1313

* chore: commit changeset

* fix: add a fixed offset for Text in webgl #1380

* chore: commit changeset

* fix: convertToPath should be compatible with empty coords

* chore: commit changeset
xiaoiver added a commit that referenced this issue Jul 21, 2023
* fix: enhance perf of Text when fontSize changed in webgl (#1424)

* fix: enhance perf of Text when fontSize changed in webgl #1422

* chore: commit changeset

* fix: draw 1px sub-pixel line correctly in webgl #1425

* chore: commit changeset

* chore: add testcase for sub-pixel line #1425

* fix: convertToPath should account for Rect with undefined x/y

* chore: commit changeset

* fix: make FillMesh instanced to enhance perf #1359

* chore: commit changeset

* fix: make textBaseline in SVG the same with Canvas #1313

* chore: commit changeset

* fix: add a fixed offset for Text in webgl #1380

* chore: commit changeset

* fix: convertToPath should be compatible with empty coords

* chore: commit changeset

* chore(release): bump version (#1427)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant