Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds a GPU-backed compositing path that can render directly to an OffscreenCanvas via a new blit pass; falls back to Canvas2D per-track redraw when GPU canvas presentation isn't available. Introduces lazy GPU composite output lifecycle and cleans up new state on dispose. Changes
Sequence Diagram(s)sequenceDiagram
participant Frame as Frame Renderer
participant GPUComp as GPU Compositor
participant BlitPass as Blit Render Pass
participant Canvas as GPU Canvas (OffscreenCanvas)
participant CPU as Canvas2D Fallback
rect rgba(100,150,200,0.5)
Note over Frame,Canvas: Preferred GPU composite path
Frame->>GPUComp: compositeToTexture(layers)
GPUComp-->>Frame: composited GPU texture (ping/pong)
Frame->>BlitPass: compositeToCanvas(texture, outputCtx)
BlitPass->>Canvas: render full-screen quad sampling texture
Canvas-->>Frame: presentation succeeded
end
rect rgba(200,100,150,0.5)
Note over Frame,CPU: Fallback Canvas2D path
Frame->>GPUComp: compositeToCanvas(...) fails / unavailable
Frame->>CPU: redraw per-task masked results with globalCompositeOperation
CPU-->>Frame: Canvas2D compositing complete
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
… readback Replace the costly GPU→CPU readback path (mapAsync + putImageData) with a blit render pass that draws the composited texture directly onto a GPUCanvasContext. This eliminates per-frame buffer mapping, row-stride unpacking, and ImageData allocation during blend-mode compositing. Add a dedicated blit shader and pipeline to CompositorPipeline with compositeToCanvas(), and wire the render engine to use a persistent OffscreenCanvas with a configured GPU context. Falls back to the Canvas2D compositor path when GPU presentation isn't available.
💡 Codex Reviewfreecut/src/features/timeline/components/keyframe-graph-panel.tsx Lines 1112 to 1114 in 939d2f4 The new freecut/src/features/export/utils/canvas-item-renderer.ts Lines 1208 to 1211 in 939d2f4 The new per-item sub-comp masking path acquires ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Greptile SummaryThis is a large, well-structured feature PR that introduces scoped GPU-native masks, a full path editor, deferred-commit keyframe interactions, and a significant GPU rendering performance improvement by eliminating the Key changes across the five major areas:
Minor issues found:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant UI as PreviewArea / MaskEditorOverlay
participant Store as MaskEditorStore
participant ItemVS as useItemVisualState
participant RT as CompositionContent / MainComposition
participant RE as ClientRenderEngine
participant GPU as CompositorPipeline
Note over UI,GPU: Mask Pen Tool — create new path
UI->>Store: startShapePenMode()
UI->>UI: user clicks vertices on canvas
UI->>Store: addPenVertex(v)
UI->>Store: requestFinishPenMode()
Store-->>UI: finishPenRequestVersion++
UI->>UI: finishPenMode() → writes ShapeItem to ItemsStore
Note over UI,GPU: Path Edit Mode — drag vertices
UI->>Store: startEditing(itemId)
UI->>Store: updatePreview(vertices)
Store-->>ItemVS: previewVertices live update
ItemVS->>ItemVS: applyPreviewPathVerticesToShape(shape, getPreviewPathVertices)
ItemVS-->>RT: updated SVG clip-path in DOM
Note over RT,GPU: Scoped mask rendering (preview)
RT->>RT: resolveActiveShapeMasksAtFrame(masksWithTrackOrder, …)
RT->>RT: getMasksForTrackOrder(allMasks, itemTrackOrder)
RT-->>UI: only masks above item's track applied
Note over RE,GPU: Export — GPU composite blit
RE->>RE: applyTrackScopedMasks(result, trackOrder)
RE->>GPU: compositeToCanvas(layers, w, h, gpuCtx)
GPU->>GPU: compositeToTexture() — ping-pong blend
GPU->>GPU: blit shader → GPUCanvasContext
GPU-->>RE: OffscreenCanvas (no CPU readback)
RE->>RE: ctx.drawImage(gpuCompositeOutput.canvas, 0, 0)
|
Summary
Test plan
Summary by CodeRabbit