Skip to content

fix: add missing rendering flags to WSGRenderFootprintNode#719

Merged
zccrs merged 1 commit intolinuxdeepin:masterfrom
zccrs:master
Jan 30, 2026
Merged

fix: add missing rendering flags to WSGRenderFootprintNode#719
zccrs merged 1 commit intolinuxdeepin:masterfrom
zccrs:master

Conversation

@zccrs
Copy link
Member

@zccrs zccrs commented Jan 30, 2026

Add DepthAwareRendering and OpaqueRendering flags to WSGRenderFootprintNode to prevent incorrect alpha channel handling. Without DepthAwareRendering, Qt forcibly treats all nodes as having alpha channels, causing nodes that should be opaque to render as semi- transparent. This particularly affects windows with XRGB8888 buffer format, which were incorrectly rendered as transparent.

While this appears to be a Qt rendering bug, WSGRenderFootprintNode should have these flags set correctly since it performs no actual rendering and should not produce side effects. The node acts as a footprint marker only and should be treated as opaque and depth-aware.

Technical details:

  • Added DepthAwareRendering flag to enable proper depth handling
  • Added OpaqueRendering flag to indicate no alpha channel
  • This prevents Qt's renderer from treating the node as requiring alpha blending
  • Debug method: Use QSG_RENDERER_DEBUG=render;noalpha environment variable to verify alpha node detection

Influence:

  1. Test XRGB8888 format windows to verify they render as opaque instead of transparent
  2. Verify windows with actual alpha channels (ARGB8888) still render correctly
  3. Test depth ordering of overlapping windows to ensure proper layering
  4. Use QSG_RENDERER_DEBUG=render to verify nodes are not incorrectly flagged as alpha
  5. Test various window buffer formats (XRGB8888, ARGB8888, RGB565) for correct rendering
  6. Verify no visual regression in transparent window rendering
  7. Check performance impact on rendering pipeline with the additional flags

fix: 为 WSGRenderFootprintNode 添加缺失的渲染标志

为 WSGRenderFootprintNode 添加 DepthAwareRendering 和 OpaqueRendering 标 志以防止错误的 alpha 通道处理。缺少 DepthAwareRendering 会导致 Qt 强制将 所有节点视为具有 alpha 通道,使本应不透明的节点被渲染为半透明。这特别影
响使用 XRGB8888 缓冲区格式的窗口,这些窗口会被错误地渲染为透明。

虽然这似乎是 Qt 渲染器的 bug,但 WSGRenderFootprintNode 应该正确设置这 些标志,因为它本身不执行任何实际渲染,不应产生副作用。该节点仅作为占位标
记,应被视为不透明和深度感知的。

技术细节:

  • 添加 DepthAwareRendering 标志以启用正确的深度处理
  • 添加 OpaqueRendering 标志以指示无 alpha 通道
  • 防止 Qt 渲染器将节点视为需要 alpha 混合
  • 调试方法:使用 QSG_RENDERER_DEBUG=render;noalpha 环境变量验证 alpha 节 点检测

Influence:

  1. 测试 XRGB8888 格式窗口,验证它们渲染为不透明而非透明
  2. 验证具有实际 alpha 通道的窗口(ARGB8888)仍能正确渲染
  3. 测试重叠窗口的深度排序,确保正确的层次关系
  4. 使用 QSG_RENDERER_DEBUG=render 验证节点未被错误标记为 alpha
  5. 测试各种窗口缓冲区格式(XRGB8888、ARGB8888、RGB565)的正确渲染
  6. 验证透明窗口渲染无视觉回归
  7. 检查额外标志对渲染管线的性能影响

Summary by Sourcery

Bug Fixes:

  • Fix incorrect semi-transparent rendering of windows, particularly with XRGB8888 buffers, by marking WSGRenderFootprintNode as opaque and depth-aware.

@sourcery-ai
Copy link

sourcery-ai bot commented Jan 30, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds the missing DepthAwareRendering and OpaqueRendering flags to WSGRenderFootprintNode so it is treated as an opaque, depth-aware footprint node and no longer triggers incorrect alpha blending in Qt’s scene graph renderer.

Class diagram for updated WSGRenderFootprintNode rendering flags

classDiagram
    class QSGRenderNode {
        <<QtClass>>
        +RenderingFlags NoExternalRendering
        +RenderingFlags BoundedRectRendering
        +RenderingFlags DepthAwareRendering
        +RenderingFlags OpaqueRendering
        +RenderingFlags flags()
    }

    class WSurfaceItemContent {
        <<QtObject>>
    }

    class WSGRenderFootprintNode {
        <<RenderNode>>
        -QPointer~WSurfaceItemContent~ m_owner
        +RenderingFlags flags()
    }

    QSGRenderNode <|-- WSGRenderFootprintNode

    WSGRenderFootprintNode ..> WSurfaceItemContent : owns

    class RenderingFlags {
        <<enum>>
        NoExternalRendering
        BoundedRectRendering
        DepthAwareRendering
        OpaqueRendering
    }
Loading

File-Level Changes

Change Details Files
Update WSGRenderFootprintNode rendering flags to correctly describe it as an opaque, depth-aware, bounded, non-external render node.
  • Modify the flags() override to return a combination of NoExternalRendering, BoundedRectRendering, DepthAwareRendering, and OpaqueRendering instead of only the first two flags.
  • Rely on the QSGRenderNode base-class enum values directly (without class qualification) for the combined flag mask.
  • Ensure that the node no longer appears to Qt’s renderer as needing alpha blending, fixing semi-transparent rendering of XRGB8888-backed windows and improving depth ordering behavior.
waylib/src/server/qtquick/wsurfaceitem.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the scene graph render node flags for WSGRenderFootprintNode so that Qt’s renderer treats it as an opaque, depth-aware node, fixing incorrect alpha handling (especially for XRGB8888 buffers).

Changes:

  • Updated WSGRenderFootprintNode::flags() to include DepthAwareRendering and OpaqueRendering.
  • Kept existing NoExternalRendering and BoundedRectRendering semantics while refining how the node participates in the render pipeline.
  • Ensures the footprint node is treated as a non-alpha, depth-aware marker to avoid unintended blending of otherwise opaque windows.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

wineee
wineee previously approved these changes Jan 30, 2026
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: zccrs

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

1 similar comment
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: zccrs

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Add DepthAwareRendering and OpaqueRendering flags to
WSGRenderFootprintNode to prevent incorrect alpha channel handling.
Without DepthAwareRendering, Qt forcibly treats all nodes as having
alpha channels, causing nodes that should be opaque to render as semi-
transparent. This particularly affects windows with XRGB8888 buffer
format, which were incorrectly rendered as transparent.

While this appears to be a Qt rendering bug, WSGRenderFootprintNode
should have these flags set correctly since it performs no actual
rendering and should not produce side effects. The node acts as a
footprint marker only and should be treated as opaque and depth-aware.

Technical details:
- Added DepthAwareRendering flag to enable proper depth handling
- Added OpaqueRendering flag to indicate no alpha channel
- This prevents Qt's renderer from treating the node as requiring alpha
blending
- Debug method: Use QSG_RENDERER_DEBUG=render;noalpha environment
variable to verify alpha node detection

Influence:
1. Test XRGB8888 format windows to verify they render as opaque instead
of transparent
2. Verify windows with actual alpha channels (ARGB8888) still render
correctly
3. Test depth ordering of overlapping windows to ensure proper layering
4. Use QSG_RENDERER_DEBUG=render to verify nodes are not incorrectly
flagged as alpha
5. Test various window buffer formats (XRGB8888, ARGB8888, RGB565) for
correct rendering
6. Verify no visual regression in transparent window rendering
7. Check performance impact on rendering pipeline with the additional
flags

fix: 为 WSGRenderFootprintNode 添加缺失的渲染标志

为 WSGRenderFootprintNode 添加 DepthAwareRendering 和 OpaqueRendering 标
志以防止错误的 alpha 通道处理。缺少 DepthAwareRendering 会导致 Qt 强制将
所有节点视为具有 alpha 通道,使本应不透明的节点被渲染为半透明。这特别影
响使用 XRGB8888 缓冲区格式的窗口,这些窗口会被错误地渲染为透明。

虽然这似乎是 Qt 渲染器的 bug,但 WSGRenderFootprintNode 应该正确设置这
些标志,因为它本身不执行任何实际渲染,不应产生副作用。该节点仅作为占位标
记,应被视为不透明和深度感知的。

技术细节:
- 添加 DepthAwareRendering 标志以启用正确的深度处理
- 添加 OpaqueRendering 标志以指示无 alpha 通道
- 防止 Qt 渲染器将节点视为需要 alpha 混合
- 调试方法:使用 QSG_RENDERER_DEBUG=render;noalpha 环境变量验证 alpha 节
点检测

Influence:
1. 测试 XRGB8888 格式窗口,验证它们渲染为不透明而非透明
2. 验证具有实际 alpha 通道的窗口(ARGB8888)仍能正确渲染
3. 测试重叠窗口的深度排序,确保正确的层次关系
4. 使用 QSG_RENDERER_DEBUG=render 验证节点未被错误标记为 alpha
5. 测试各种窗口缓冲区格式(XRGB8888、ARGB8888、RGB565)的正确渲染
6. 验证透明窗口渲染无视觉回归
7. 检查额外标志对渲染管线的性能影响
@deepin-bot
Copy link

deepin-bot bot commented Jan 30, 2026

TAG Bot

New tag: 0.8.2
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #718

@zccrs zccrs merged commit 64ad615 into linuxdeepin:master Jan 30, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants