Repository navigation
feat: vendor WSGBatchRenderer and centralize output geometry - #1664
Merged
Merged
Conversation
|
Sorry @zccrs, your pull request is larger than the review limit of 150,000 diff characters |
zccrs
force-pushed
the
wsg-batch-renderer-base
branch
from
November 16, 2026 09:40
b0faaf1 to
c176920
Compare
zzxyb
requested changes
Nov 16, 2026
zccrs
force-pushed
the
wsg-batch-renderer-base
branch
from
November 16, 2026 10:35
c176920 to
11e432f
Compare
1. Vendor qtdeclarative v6.11.1 QSGBatchRenderer/QSGRhiVisualizer into waylib as WSGBatchRenderer, version-gated for Qt 6.8-6.12. 2. Install WSGContext as QQuickRenderControlPrivate::sg before any QQuickRenderControl so RHI createRenderer() returns the fork. 3. Route extra sources and WRenderBufferNode through createRenderer(); keep the software backend on Qt's own scene graph adaptation. Log: RHI path uses a vendored Scene Graph batch renderer. No user-facing changes yet; damage tracking is not in this step. Influence: 1. Launch tinywl-qtquick on the default RHI backend and verify windows, titlebar, lockscreen, overview, Blur/Glass still render. 2. Run with QT_QUICK_BACKEND=software and confirm the software path is unchanged and RenderControl creation does not crash. 3. Confirm that creating a QQuickRenderControl before WOutputRenderWindow fatals with the WSGContext install error. feat: 将 Qt BatchRenderer 以 WSGBatchRenderer 接入 RHI 1. 从 qtdeclarative v6.11.1 引入 QSGBatchRenderer/QSGRhiVisualizer, 命名空间改为 WSGBatchRenderer,并用版本宏兼容 Qt 6.8-6.12。 2. 在任何 QQuickRenderControl 构造前安装 WSGContext 覆盖 sg, 使 RHI 路径的 createRenderer() 直接创建 fork。 3. extra source 与 WRenderBufferNode 改为走 createRenderer(); software 仍使用 Qt 自己的 scene graph adaptation。 Log: RHI 路径改用自带的 Scene Graph batch renderer。暂无用户可见 变化,本步未做 damage tracking。 Influence: 1. 用默认 RHI 启动 tinywl-qtquick,检查窗口、标题栏、锁屏、多任务、 Blur/Glass 绘制是否正常。 2. 设置 QT_QUICK_BACKEND=software,确认 software 路径不变、不崩溃。 3. 若在 WOutputRenderWindow 之前创建 QQuickRenderControl,应 qFatal。 Log: RHI path uses a vendored Scene Graph batch renderer. No PMS:
zccrs
force-pushed
the
wsg-batch-renderer-base
branch
2 times, most recently
from
November 16, 2026 11:18
9393cc4 to
7e828e8
Compare
Contributor
|
@zccrs 大佬,QML画布局部更新功能还有吗( |
Member
Author
有呀,只是拆分了下提交,这个提交里没有 |
zccrs
force-pushed
the
wsg-batch-renderer-base
branch
2 times, most recently
from
November 17, 2026 02:23
4b0f70a to
9a3d55f
Compare
zccrs
commented
Nov 17, 2026
zccrs
force-pushed
the
wsg-batch-renderer-base
branch
8 times, most recently
from
November 17, 2026 04:29
d8f81d2 to
661b253
Compare
1. A capture lock forbids direct scan-out and reads the primary buffer 2. Non-cursor OutputLayers on a locked output left their pixels on a plane 3. OutputHelper pins those layers onto the primary plane while compositing 4. Cursor layers stay; overlay cursor still uses software_cursor_locks Log: Screencopy now includes non-cursor layer content in the primary buffer Influence: 1. Start a screencopy while a non-cursor OutputLayer is on a hardware plane 2. Confirm the captured buffer contains that layer's pixels, not a hole 3. Confirm the cursor plane is unchanged unless overlay cursor was requested fix: 捕获时把非光标层合成进主平面 1. 捕获锁禁止直接扫描输出,读的是主 buffer 2. 被锁输出上的非光标层原先留在独立 plane,截图里是洞 3. OutputHelper 合成时把这些层钉到主平面,不让 OutputLayer 关心这把锁 4. 光标层保持不动,带光标仍走 software_cursor_locks Log: 截屏主缓冲现在包含非光标层的内容 Influence: 1. 非光标 OutputLayer 在硬件平面上时开始截屏 2. 确认截到的 buffer 含该层像素,而不是一块空洞 3. 确认未要求叠加光标时光标平面不变 Log: Screencopy now includes non-cursor layer content in the primary buffer PMS:
zccrs
force-pushed
the
wsg-batch-renderer-base
branch
6 times, most recently
from
November 17, 2026 08:55
db04138 to
4b7ccac
Compare
1. Output::applyGeometry only sets item and viewport size. It does not read or write wlr_output_state. 2. Output::applyPendingGeometry derives mode, orientation, and scale from the staged extraState, falling back to the committed values, so the frame that commits a new state already draws at the new size. 3. Output::setTransform is Q_INVOKABLE. SourceOutput and MirrorOutput call it on the Output exposed as treelandOutput instead of going through a WaylandServer forwarder. 4. Rotation follows the output transform: applyPendingGeometry rotates the QML viewport, except for the animated rotation, which owns the rotation while it runs and commits at its halfway point. 5. Mode, scale, and adaptive sync still stage through setExtraState, and OutputManager keeps the protocol-facing configuration. Influence: 1. Change resolution and confirm windows rearrange to the new size. 2. Rotate an output and confirm the item swaps size at the halfway point. 3. Change scale and confirm logical size updates without a stretched frame. refactor: 把屏幕尺寸的更新集中到一处 1. Output::applyGeometry 现在只负责设置 item 和 viewport 的大小,不再读写 wlr_output_state。 2. Output::applyPendingGeometry 根据暂存的 extraState 计算分辨率、方向和 缩放,未暂存时回退到已提交的值,保证提交新状态的那一帧就按新尺寸绘制。 3. Output::setTransform 是 Q_INVOKABLE;SourceOutput 和 MirrorOutput 通过 暴露为 treelandOutput 的 Output 直接调用,不再经 WaylandServer 转发。 4. 旋转跟随屏幕的 transform:applyPendingGeometry 负责设置 QML viewport 的旋转;只有旋转动画自身例外,它在动画期间自己管理角度并在中点提交。 5. 分辨率、缩放和自适应同步仍由 setExtraState 暂存,协议相关的配置仍归 OutputManager。 Influence: 1. 修改分辨率,确认窗口按新尺寸重排。 2. 旋转屏幕,确认动画中点交换尺寸。 3. 修改缩放,确认逻辑尺寸更新且画面不被拉伸。 Log: Output geometry only changes the item and viewport; rotation follows the output transform. PMS:
zccrs
force-pushed
the
wsg-batch-renderer-base
branch
from
November 17, 2026 09:14
4b7ccac to
d76b13e
Compare
|
TAG Bot New tag: 0.12.0 |
zzxyb
approved these changes
Nov 18, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: zccrs, zzxyb The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
|
终于合入了😭😭😭 |
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.
Summary
Split the prerequisite work out of #1275 so it can be reviewed and merged before the Scene Graph damage tracking.
This branch is rebased onto current
linuxdeepin/treelandmaster(87c837729).QSGBatchRendererasWSGBatchRendererand install it before anyQQuickRenderControlis created.Outputowns the output geometry:applyGeometry()only sets item and viewport size,applyPendingGeometry()derives mode/orientation/scale from the stagedextraState(falling back to committed values), andsetTransform()stages an orientation and resyncs.OutputManager::setScalereuses the same path.setExtraState()wakes only that output withscheduleFrame().Damage tracking and the treeland-debug highlight stay on
wsg-batch-rendererand are not in this PR.摘要
从 #1275 拆出 damage 之前的前提改动,方便先审核合入。
分支已变为基到当前
linuxdeepin/treelandmaster(87c837729)。QSGBatchRenderer引入为WSGBatchRenderer,并在创建任何QQuickRenderControl之前安装。Output:applyGeometry()只设置 item 与 viewport 尺寸;applyPendingGeometry()按extraState中暂存的 mode/方向/缩放计算(未暂存时回退到已提交值);setTransform()暂存方向并重算几何;OutputManager::setScale复用同一路径;setExtraState()只唤醒该路输出(scheduleFrame())。场景图 damage 跟踪和 treeland-debug 高亮仍留在
wsg-batch-renderer,不在本 PR。Review follow-up
Output::applyPendingGeometry()replaces the duplicated mode/scale math (OutputManager::setScale,Output::enable), and reads staged mode/transform/scale so a rapid rotate-after-scale cannot compute a stale viewport.WaylandServer::setOutputTransformis gone.Output::setTransform(WOutput::Transform)isQ_INVOKABLE, andOutput::create()/createCopy()expose the wrapper to the item astreelandOutput;SourceOutput.qmlandMirrorOutput.qmlcall it directly instead of going through a forwarder.scenegraph/README.mdno longer records a local/home/...tree path.woutputviewport.cppincludeswoutputhelper.hforWOutputHelper::ExtraState(the branch did not compile without it).QSGNodePrivate::mutabilityGroup(). Qt 6.12 declares that function but only marks the classQ_AUTOTEST_EXPORT, so a 6.12 build failed to link; the group stays neutral, matching the vendored 6.11 invalidation rules.Test plan
Local verification on this head (
Debug, Qt 6.8.0):cmake --buildin the-WerrorCI configuration completes.WLR_BACKENDS=headless, pixman) driven bywlr-randr+treeland-debug scene:WOutputViewporttest_wlr_output_management_unstable_v1passes.ctestsweep: 90/97 pass. The 7 failures (test_native_handles,test_treeland_dde_shell_lockscreen_desktop_v1,test_treeland_dde_shell_multitask_desktop_v1,test_session_isolation,test_treeland_prelaunch_splash_desktop_v2,test_wayland_ext_session_lock_v1,test_wayland_xdg_output_unstable_v1) reproduce identically on unmodifiedmaster87c837729in the same environment, so they are not regressions from this PR.test_drmis skipped without a DRM device.Checklist:
QT_QUICK_BACKEND=softwareand confirm the software path is unchanged.