WIP: 录屏重构 - #1234
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: glyvut 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 |
Reviewer's GuideRefactors the foreign toplevel screen capture path to capture from the QQuickItem-based window wrapper using an offscreen WBufferRenderer pipeline, introduces coordinated afterRendering/renderEnd handling, and adds a helper on WOutputRenderWindow to render items into a wlroots-compatible buffer while tightening buffer/constraint management. Sequence diagram for the offscreen capture pipeline using WBufferRenderersequenceDiagram
actor Client
participant Helper
participant SurfaceWrapper as QQuickItem_SurfaceWrapper
participant Capture as WExtImageCaptureSourceV1Impl
participant Window as WOutputRenderWindow
participant Renderer as WBufferRenderer
participant Proxy as WQuickTextureProxy
participant Buffer as qw_buffer
Client->>Helper: handleNewForeignToplevelCaptureRequest(request)
Helper->>SurfaceWrapper: ownsOutput()
Helper->>Capture: new WExtImageCaptureSourceV1Impl(surfaceWrapper, output)
Client->>Capture: start(with_cursors)
Capture->>Window: renderWindow()
Capture->>Renderer: new WBufferRenderer(Window->contentItem())
Capture->>Proxy: new WQuickTextureProxy(Renderer)
Capture->>Proxy: setSourceItem(surfaceWrapper)
Capture->>Renderer: setSourceList({Proxy}, false)
Capture->>Window: connect(afterRendering, doOffscreenRender)
Capture->>Window: connect(renderEnd, handleRenderEnd)
Capture->>Window: wlr_output_update_needs_frame(nativeHandle)
Window-->>Capture: afterRendering
Capture->>Capture: computePixelSize()
Capture->>Proxy: setWidth/Height(boundingRect)
Capture->>Window: renderItemToBuffer(Renderer, renderMatrices, pixelSize, dpr, DRM_FORMAT_ARGB8888)
Window->>Renderer: beginRender(pixelSize, dpr, format, flags)
Window->>Renderer: render(i, renderMatrix, {}, {}, incremental)
Window->>Renderer: endRender()
Window-->>Capture: lastBuffer()
Capture->>Buffer: lock()
Window-->>Capture: renderEnd
Capture->>Capture: handleRenderEnd()
Capture->>Buffer: handle() // wlr_buffer
Capture->>Capture: WPixmanRegion fullDamage
Capture->>Capture: wl_signal_emit_mutable(&handle()->events.frame, &event)
Client->>Capture: copy_frame(dst_frame, frame_event)
Capture->>Renderer: m_output->renderer()
Capture->>Buffer: handle() // src
alt size mismatch
Capture->>Capture: updateConstraints(QSize(src->width, src->height))
Capture->>dst_frame: fail(BUFFER_CONSTRAINTS)
else size ok
Capture->>dst_frame: qw_ext_image_copy_capture_frame_v1::copy_buffer(dst_frame, src, renderer->handle())
Capture->>dst_frame: ready(WL_OUTPUT_TRANSFORM_NORMAL, &now)
end
Capture->>Buffer: unlock()
Client->>Capture: stop()
Capture->>Window: disconnect(afterRendering)
Capture->>Window: disconnect(renderEnd)
Capture->>Buffer: unlock()
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
TAG Bot New tag: 0.8.18 |
Summary by Sourcery
Refactor the foreign toplevel image capture pipeline to capture from the QQuick window wrapper via an offscreen buffer renderer, improving robustness, size/format constraints handling, and integration with the output render window.
New Features:
Bug Fixes:
Enhancements: