Skip to content

Commit 3cd6e73

Browse files
committed
Fix linux build issue
1 parent f2f84d3 commit 3cd6e73

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Sources/OpenSwiftUICore/Render/PlatformDrawable.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
// Audited for 6.5.4
66
// Status: WIP
77

8-
public import CoreGraphics
9-
public import QuartzCore
108
import OpenAttributeGraphShims
119
import OpenRenderBoxShims
10+
public import OpenCoreGraphicsShims
11+
#if canImport(QuarzCore)
12+
public import QuartzCore
1213
import CoreAnimation_Private
14+
#endif
1315

1416
// MARK: - PlatformDrawable
1517

@@ -22,12 +24,14 @@ public protocol PlatformDrawable: AnyObject {
2224

2325
func update(content: PlatformDrawableContent?, required: Bool) -> Bool
2426

27+
#if canImport(QuarzCore)
2528
func makeAsyncUpdate(
2629
content: PlatformDrawableContent,
2730
required: Bool,
2831
layer: CALayer,
2932
bounds: CGRect
3033
) -> (() -> Void)?
34+
#endif
3135

3236
func setContentsScale(_ scale: CGFloat)
3337

@@ -79,6 +83,7 @@ public struct PlatformDrawableContent: @unchecked Sendable {
7983
_openSwiftUIEmptyStub()
8084
}
8185

86+
#if canImport(CoreGraphics)
8287
public func draw(
8388
in ctx: CGContext,
8489
size: CGSize,
@@ -87,6 +92,7 @@ public struct PlatformDrawableContent: @unchecked Sendable {
8792
) {
8893
_openSwiftUIUnimplementedFailure()
8994
}
95+
#endif
9096

9197
public func draw(
9298
in list: RBDisplayList,
@@ -124,6 +130,7 @@ public struct PlatformDrawableOptions: Equatable, Sendable {
124130
base.rendersFirstFrameAsynchronously
125131
}
126132

133+
#if canImport(QuarzCore)
127134
public var caLayerContentsFormat: CALayerContentsFormat {
128135
var format = CALayerContentsFormat.automatic
129136
if base.flags.contains(.rgbaContext) {
@@ -134,6 +141,7 @@ public struct PlatformDrawableOptions: Equatable, Sendable {
134141
}
135142
return format
136143
}
144+
#endif
137145

138146
public func update(rbLayer: AnyObject) {
139147
// TODO: RBLayer

0 commit comments

Comments
 (0)