Skip to content

Conversation

@Kyle-Ye
Copy link
Contributor

@Kyle-Ye Kyle-Ye commented Dec 21, 2025

Summary

Implements the path system for OpenRenderBox, matching RenderBox ABI.

New APIs

  • ORBPath - Path struct with storage and callbacks
  • ORBPathCallbacks - Callbacks structure for path operations (retain, release, apply, isEqual, isEmpty, etc.)
  • ORBPathStorage - Mutable path element storage

Path Creation (Darwin)

  • ORBPathMakeWithCGPath
  • ORBPathMakeRect
  • ORBPathMakeEllipse
  • ORBPathMakeRoundedRect
  • ORBPathMakeUnevenRoundedRect

Global Constants

  • ORBPathEmpty - Empty path
  • ORBPathNull - Null path sentinel

Tests

  • PathTests, PathCallbacksTests, PathStorageTests (compatibility tests)

Audited for 6.5.1

- Add ORBPathMakeWithCGPath, ORBPathMakeRect, ORBPathMakeEllipse,
  ORBPathMakeRoundedRect, ORBPathMakeUnevenRoundedRect with Swift init names
- Add ORB_SWIFT_NAME to ORBPathStorageInit
- Move callback typedefs and ORBPathCallbacks struct to ORBPath.h
- Move ORBPathEmptyCallbacks and ORBPathCGPathCallbacks declarations to ORBPath.h
- Remove ORBPathPrivate.h
- Update ORBPath.cpp to include ORBPath.h directly
- Fix Storage constructor to use atomic_fetch_add_explicit for identifier
- Add cgpath() method with lazy CGPath caching at offset 0x38
- Add ORBRoundedCornerStyle enum with Circular and Continuous options
- Add style parameter to ORBPathMakeRoundedRect before transform
- Add style parameter to ORBPathMakeUnevenRoundedRect before transform
- TODO: Implement continuous curvature for non-circular style
…ture

- Delete ORBPathElement struct, use enum directly
- Add ORBPathElementFixedRoundedRectCircular and ORBPathElementFixedRoundedRectContinuous
- Update ORBPathApplyCallback to pass element and points as separate parameters
- ORBPathContainsPoint: tests if a single point is inside the path
- ORBPathContainsPoints: tests multiple points with optional transform
- eoFill parameter controls even-odd vs non-zero winding rule
- TODO: implement point containment testing
@Kyle-Ye Kyle-Ye merged commit 9000acb into main Dec 21, 2025
4 checks passed
@Kyle-Ye Kyle-Ye deleted the feature/path branch December 21, 2025 18:45
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