Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Optimize] Remove importing CoreGraphics on Darwin for CGFloat #45

Merged
merged 1 commit into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
// Audited for RELEASE_2021
// Status: Complete

#if canImport(Darwin)
import CoreGraphics
#else
import Foundation
#endif

/// A type that you use to create custom alignment guides.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
// Status: Complete
// ID: E20796D15DD3D417699102559E024115

#if canImport(Darwin)
import CoreGraphics
#else
import Foundation
#endif

/// An alignment position along the horizontal axis.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
// Status: Complete
// ID: E20796D15DD3D417699102559E024115

#if canImport(Darwin)
import CoreGraphics
#else
import Foundation
#endif

/// An alignment position along the vertical axis.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
// Audited for RELEASE_2021
// Status: Complete

#if canImport(Darwin)
import CoreGraphics
#else
import Foundation
#endif

/// A view's size and alignment guides in its own coordinate space.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
// Audited for RELEASE_2021
// Status: Complete

#if canImport(Darwin)
import CoreGraphics
#else
import Foundation
#endif

/// The inset distances for the sides of a rectangle.
@frozen
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#if canImport(Darwin)
import CoreGraphics
#else
import Foundation
#endif

@frozen
public struct HStack<Content: View>: PrimitiveView {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#if canImport(Darwin)
import CoreGraphics
#else
import Foundation
#endif

@frozen
public struct _HStackLayout {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
// Audited for RELEASE_2021
// Status: WIP

#if canImport(Darwin)
import CoreGraphics
#else
import Foundation
#endif

// TODO:
struct LayoutComputer: Equatable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
// Status: TODO
// ID: 127A76D3C8081D0134153BE9AE746714

#if canImport(Darwin)
import CoreGraphics
#else
import Foundation
#endif

struct Spacing {
// TODO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
// Audited for RELEASE_2021
// Status: Complete

#if canImport(Darwin)
import CoreGraphics
#else
import Foundation
#endif

struct _ProposedSize: Hashable {
var width: CGFloat?
Expand Down
4 changes: 0 additions & 4 deletions Sources/OpenSwiftUI/Test/_BenchmarkHost.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
// Status: Complete
// ID: 3E629D505F0A70F29ACFC010AA42C6E0

#if canImport(Darwin)
import CoreGraphics
#else
import Foundation
#endif

#if canImport(QuartzCore)
import QuartzCore
Expand Down
4 changes: 0 additions & 4 deletions Sources/OpenSwiftUI/View/Animation/TODO/Animatable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ extension Animatable where AnimatableData == EmptyAnimatableData {
}
}

#if canImport(Darwin)
import CoreGraphics
#else
import Foundation
#endif

// MARK: - Animatable + CoreGraphics

Expand Down
4 changes: 0 additions & 4 deletions Sources/OpenSwiftUI/View/Animation/VectorArithmetic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,7 @@ extension Double: VectorArithmetic {
}
}

#if canImport(Darwin)
import CoreGraphics
#else
import Foundation
#endif

extension CGFloat: VectorArithmetic {
@_transparent
Expand Down
4 changes: 0 additions & 4 deletions Sources/OpenSwiftUI/View/Core/IdentifiedViewProxy.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#if canImport(Darwin)
import CoreGraphics
#else
import Foundation
#endif

public struct _IdentifiedViewProxy {
var identifier: AnyHashable
Expand Down
4 changes: 0 additions & 4 deletions Sources/OpenSwiftUI/View/Core/ViewTransform.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
// ID: CE19A3CEA6B9730579C42CE4C3071E74

#if canImport(Darwin)
import CoreGraphics
#else
import Foundation
#endif

struct ViewTransform {
private var chunks: ContiguousArray<Chunk>
Expand Down
4 changes: 0 additions & 4 deletions Sources/OpenSwiftUI/View/Text/Font/TODO/Font.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#if canImport(Darwin)
import CoreGraphics
#else
import Foundation
#endif

@frozen
public struct Font: Hashable {
Expand Down
4 changes: 0 additions & 4 deletions Sources/OpenSwiftUI/View/Text/Text/TODO/Text.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
// Audited for RELEASE_2021
// Status: Empty

#if canImport(Darwin)
import CoreGraphics
#else
import Foundation
#endif

@frozen
public struct Text: Equatable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@

@testable import OpenSwiftUI
import Testing
#if canImport(Darwin)
import CoreGraphics
#else
import Foundation
#endif

struct AlignmentIDTests {
private struct TestAlignment: AlignmentID {
Expand Down
4 changes: 0 additions & 4 deletions Tests/OpenSwiftUITests/View/Core/Debug/ViewDebugTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@

@testable import OpenSwiftUI
import Testing
#if canImport(Darwin)
import CoreGraphics
#else
import Foundation
#endif

struct ViewDebugTests {
@Test(.disabled("Skip the test until we finish the implementation of _ViewDebug"))
Expand Down
Loading