Fix Qt GPUDrawable surface not updating on resize and improve PAGX code quality#3386
Merged
Fix Qt GPUDrawable surface not updating on resize and improve PAGX code quality#3386
Conversation
ca5851c to
8a4cb68
Compare
c50fdd9 to
2dc5cc7
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3386 +/- ##
==========================================
- Coverage 78.41% 78.41% -0.01%
==========================================
Files 532 532
Lines 41448 41448
Branches 12486 12486
==========================================
- Hits 32502 32501 -1
+ Misses 6391 6389 -2
- Partials 2555 2558 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
shlzxjp
reviewed
Apr 21, 2026
shlzxjp
reviewed
Apr 21, 2026
shlzxjp
reviewed
Apr 21, 2026
shlzxjp
reviewed
Apr 21, 2026
shlzxjp
reviewed
Apr 21, 2026
shlzxjp
reviewed
Apr 21, 2026
This reverts commit caf827f.
95d112b to
942c34e
Compare
shlzxjp
previously approved these changes
Apr 29, 2026
shlzxjp
approved these changes
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复 Qt 平台 GPUDrawable 在显示区域尺寸变化时 surface 没有同步更新的问题,并改进 PAGX 相关代码质量。
问题原因
在 PR #3344 适配 tgfx Window 接口迁移时,
updateSize()更新了_width/_height,但没有清除缓存的 surface。导致渲染时使用旧尺寸的 surface,而缩放计算基于新尺寸,造成内容变形(如正方形变成长方形)。修复方案
修复 surface 更新问题:将
freeSurface()调用从 QtGPUDrawable::updateSize()移至PAGXRenderer::updateSize(),与PAGSurface::updateSize()保持相同的调用契约(先freeSurface()再updateSize()),确保跨平台行为一致。改进命名清晰度:将
pagxContentLayer重命名为pagxRootLayer,因为它实际存储的是一个变换容器层(其子节点才是 LayerBuilder 构建的真正内容层),并添加注释说明其用途。其他变更