Skip to content
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
18 changes: 16 additions & 2 deletions Sources/OpenSwiftUICore/Graphic/GraphicsContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -536,13 +536,28 @@ extension GraphicsContext {
#endif
}

// FIXME
struct ORBLayerFlags: OptionSet {
let rawValue: UInt32

init(rawValue: UInt32) {
self.rawValue = rawValue
}
}

func drawLayer(
flags: ORBLayerFlags,
content: (inout GraphicsContext) throws -> Void
) throws {
_openSwiftUIUnimplementedFailure()
}

package mutating func translateBy(x: CGFloat, y: CGFloat) {
guard x != 0 || y != 0 else { return }
_openSwiftUIUnimplementedFailure()
}

// FIXME
#if canImport(CoreGraphics)
static func renderingTo(
cgContext: CGContext,
environment: EnvironmentValues,
Expand All @@ -551,5 +566,4 @@ extension GraphicsContext {
) {
_openSwiftUIUnimplementedFailure()
}
#endif
}
6 changes: 3 additions & 3 deletions Sources/OpenSwiftUICore/Graphic/GraphicsFilter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ package enum GraphicsFilter {
case vibrantColorMatrix(_ColorMatrix)
case luminanceCurve(GraphicsFilter.LuminanceCurve)
case colorCurves(GraphicsFilter.ColorCurves)
// case shader(GraphicsFilter.ShaderFilter)
case shader(GraphicsFilter.ShaderFilter)

package struct ColorMonochrome: Equatable {
package var color: Color.Resolved
Expand Down Expand Up @@ -73,15 +73,15 @@ package enum GraphicsFilter {
}
}

// package struct ShaderFilter {
package struct ShaderFilter {
// package var shader: Shader.ResolvedShader
// package var size: CGSize
//
// package init(shader: Shader.ResolvedShader, size: CGSize) {
// self.shader = shader
// self.size = size
// }
// }
}
}

package enum GraphicsBlendMode: Equatable {
Expand Down
38 changes: 33 additions & 5 deletions Sources/OpenSwiftUICore/Render/DisplayList/DisplayList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,10 @@ extension DisplayList {
case rotation3D(_Rotation3DEffect.Data)
}

// package typealias AnyEffectAnimation = _DisplayList_AnyEffectAnimation
// package typealias AnyEffectAnimator = _DisplayList_AnyEffectAnimator

package typealias AnyEffectAnimation = _DisplayList_AnyEffectAnimation

package typealias AnyEffectAnimator = _DisplayList_AnyEffectAnimator

package struct ArchiveIDs {
package var uuid: UUID
package var stableIDs: StableIdentityMap
Expand Down Expand Up @@ -481,7 +482,22 @@ extension DisplayList.Item {
// TODO eg. .opacity(1.0) -> .identity
}

// package func matchesTopLevelStructure(of other: DisplayList.Item) -> Bool
// TBA
package func matchesTopLevelStructure(of other: DisplayList.Item) -> Bool {
guard identity == other.identity else { return false }
switch (value, other.value) {
case (.empty, .empty):
return true
case (.content, .content):
return true
case (.effect, .effect):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sources/OpenSwiftUICore/Render/DisplayList/DisplayList.swift:493 matchesTopLevelStructure(of:) treats any .effect pair as structurally identical, which can let ViewUpdater.updateAsync proceed even if the effect kind changed (potentially applying async updates against an incompatible structure).

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

return true
case (.states, .states):
return true
default:
return false
}
}

package var features: DisplayList.Features {
// TODO
Expand Down Expand Up @@ -551,7 +567,19 @@ extension DisplayList {

package struct AccessibilityNodeAttachment {}

package protocol _DisplayList_AnyEffectAnimation {}
package protocol _DisplayList_AnyEffectAnimation: ProtobufMessage {
// FIXME: CodableEffectAnimation
static var leafProtobufTag: CodableAnimation.Tag? { get }
func makeAnimator() -> any _DisplayList_AnyEffectAnimator
}

package protocol _DisplayList_AnyEffectAnimator {
func evaluate(
_ animation: any DisplayList.AnyEffectAnimation,
at time: Time,
size: CGSize
) -> (DisplayList.Effect, finished: Bool)
}

extension DisplayList.Item {
func addDrawingGroup(contentSeed: DisplayList.Seed) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,40 @@
// DisplayListPlatformEffect.swift
// OpenSwiftUICore
//
// Audited for 6.0.87
// Audited for 6.5.4
// Status: Complete

// MARK: - DisplayList.PlatformEffect

extension DisplayList {
package enum PlatformEffect {
case identity
package var features: DisplayList.Features { [] }
package func encode(to encoder: any Encoder) throws {}
package init(from decoder: any Decoder) throws { self = .identity }
package func print(into sexp: inout SExpPrinter) {}

package var features: DisplayList.Features {
[]
}

package func encode(to encoder: any Encoder) throws {
_openSwiftUIEmptyStub()
}

package init(from decoder: any Decoder) throws {
self = .identity
}

package func print(into sexp: inout SExpPrinter) {
_openSwiftUIEmptyStub()
}
}
}
extension DisplayList.PlatformEffect: ProtobufMessage {
package func encode(to encoder: inout ProtobufEncoder) throws {}
package init(from decoder: inout ProtobufDecoder) throws { self = .identity }
package func encode(to encoder: inout ProtobufEncoder) throws {
_openSwiftUIEmptyStub()
}

package init(from decoder: inout ProtobufDecoder) throws {
self = .identity
}
}

extension DisplayList.ViewUpdater {
Expand All @@ -29,3 +48,8 @@ extension DisplayList.ViewUpdater.Platform {
package struct PlatformState {
}
}

extension DisplayList.ViewUpdater.Model {
package struct PlatformState {
}
}
Loading
Loading