From 019f42d76188ab28b85bdb7b5f0fd609f4c274e7 Mon Sep 17 00:00:00 2001 From: Kyle Date: Sat, 26 Sep 2026 14:33:40 +0800 Subject: [PATCH] refactor(spi): use OpenRenderBox path shims --- Package.resolved | 2 +- .../Overlay/CoreGraphics/CGPath+OpenSwiftUI.m | 13 +------------ Sources/OpenSwiftUI_SPI/Util/PathData.h | 10 +--------- 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/Package.resolved b/Package.resolved index 56ac9bcdf..3ec974696 100644 --- a/Package.resolved +++ b/Package.resolved @@ -43,7 +43,7 @@ "location" : "https://github.com/OpenSwiftUIProject/OpenRenderBox", "state" : { "branch" : "main", - "revision" : "ec856ea3d709de2624fe1324c0ef004a7f492394" + "revision" : "7a85270fd79295c86aaf8cd578168895befd07da" } }, { diff --git a/Sources/OpenSwiftUI_SPI/Overlay/CoreGraphics/CGPath+OpenSwiftUI.m b/Sources/OpenSwiftUI_SPI/Overlay/CoreGraphics/CGPath+OpenSwiftUI.m index 62cdfa2d2..9605461bb 100644 --- a/Sources/OpenSwiftUI_SPI/Overlay/CoreGraphics/CGPath+OpenSwiftUI.m +++ b/Sources/OpenSwiftUI_SPI/Overlay/CoreGraphics/CGPath+OpenSwiftUI.m @@ -10,11 +10,7 @@ #import #import -#if OPENSWIFTUI_RENDERBOX -#include -#else -#include -#endif +#include BOOL _CGPathParseString(CGMutablePathRef path, const char *utf8CString) { double numbers[6]; @@ -228,17 +224,10 @@ CGPathRef _CGPathCreateRoundedRect(CGRect rect, CGFloat cornerWidth, CGFloat cor } if (style == PathRoundedCornerStyleContinuous) { - #if OPENSWIFTUI_RENDERBOX - RBPath rbPath = RBPathMakeRoundedRect(rect, cornerWidth, cornerHeight, RBPathRoundedCornerStyleContinuous, NULL); - CGPathRef cgPath = RBPathCopyCGPath(rbPath); - RBPathRelease(rbPath); - return cgPath; - #else ORBPath rbPath = ORBPathMakeRoundedRect(rect, cornerWidth, cornerHeight, ORBPathRoundedCornerStyleContinuous, NULL); CGPathRef cgPath = ORBPathCopyCGPath(rbPath); ORBPathRelease(rbPath); return cgPath; - #endif } // Use CoreGraphics path creation (circular style) diff --git a/Sources/OpenSwiftUI_SPI/Util/PathData.h b/Sources/OpenSwiftUI_SPI/Util/PathData.h index 007ac7da0..eb088a6f2 100644 --- a/Sources/OpenSwiftUI_SPI/Util/PathData.h +++ b/Sources/OpenSwiftUI_SPI/Util/PathData.h @@ -13,11 +13,7 @@ #include #endif -#if OPENSWIFTUI_RENDERBOX -#include -#else -#include -#endif +#include OPENSWIFTUI_ASSUME_NONNULL_BEGIN @@ -27,11 +23,7 @@ typedef union PathData { #if OPENSWIFTUI_TARGET_OS_DARWIN CGPathRef cgPath; #endif - #if OPENSWIFTUI_RENDERBOX - RBPath rbPath; - #else ORBPath rbPath; - #endif uint8_t buffer[0x60]; } PathData;