Skip to content

Conversation

@Kyle-Ye
Copy link
Collaborator

@Kyle-Ye Kyle-Ye commented Jan 4, 2026

No description provided.

@augmentcode
Copy link

augmentcode bot commented Jan 4, 2026

🤖 Augment PR Summary

Summary: This PR introduces RenderBox-backed drawing infrastructure and updates RenderBox integration points.

Changes:

  • Bumps RenderBox-related dependencies (DarwinPrivateFrameworks, OpenRenderBox) in Package.resolved.
  • Adds an experimental Swift compiler flag (-experimental-spi-only-imports) to support @_spiOnly imports.
  • Moves/renames platform display-list view definitions into Sources/OpenSwiftUI/Render/DisplayList (AppKitDisplayList.swift, UIKitDisplayList.swift) and centralizes PlatformGraphicsView/PlatformInheritedView aliases.
  • Adds RenderBoxView, a PlatformGraphicsView subclass whose backing layer is an RBLayer subclass and participates in RenderBox async rendering behavior.
  • Adds DisplayListViewDrawing.swift with CGDrawingView (CoreGraphics-backed) and a WIP RBDrawingView (RenderBox-backed) conforming to PlatformDrawable.
  • Updates core rendering API types to use ORB* types (e.g. ORBDisplayList, ORBColor) and fixes QuartzCore import gating.
  • Removes placeholder shim enums that are now expected to come from the RenderBox shims module.

Technical Notes: The new RenderBox path is partially stubbed (several methods still call _openSwiftUIUnimplementedFailure()) but wires up the layer/delegate scaffolding for future rasterization work.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

self.options = options
super.init(frame: .zero)
isOpaque = options.isOpaque
layer.contentsFormat = options.caLayerContentsFormat
Copy link

Choose a reason for hiding this comment

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

On macOS, NSView.layer can be nil unless the view is layer-backed (e.g. wantsLayer = true), so touching layer.contentsFormat (and later layer as! CGDrawingLayer) risks a crash if this view is constructed outside the platform view factory. (This same assumption about layer being present also applies to RenderBoxView.)

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎


override func didMoveToWindow() {
guard let window else { return }
layer.contentsScale = window.screen.scale
Copy link

Choose a reason for hiding this comment

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

window.screen isn’t guaranteed to be non-nil on macOS (and the scale API differs from UIKit), so window.screen.scale can be a crash/portability hazard; consider guarding/normalizing how the contents scale is derived per platform.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

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.

2 participants