mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 14:45:21 +00:00
Debugging
This commit is contained in:
@@ -4,6 +4,40 @@ import Display
|
|||||||
import MetalEngine
|
import MetalEngine
|
||||||
import MetalKit
|
import MetalKit
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
import os
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
class Signposter {
|
||||||
|
func emitEvent(_ string: StaticString) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@available(iOS 15.0, *)
|
||||||
|
final class SignposterImpl: Signposter {
|
||||||
|
private let signposter = OSSignposter()
|
||||||
|
private let signpostId: OSSignpostID
|
||||||
|
|
||||||
|
override init() {
|
||||||
|
self.signpostId = self.signposter.makeSignpostID()
|
||||||
|
}
|
||||||
|
|
||||||
|
override func emitEvent(_ string: StaticString) {
|
||||||
|
self.signposter.emitEvent("Fetch complete.", id: self.signpostId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let signposter: Signposter = {
|
||||||
|
if #available(iOS 15.0, *) {
|
||||||
|
return SignposterImpl()
|
||||||
|
} else {
|
||||||
|
return Signposter()
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
private final class BundleMarker: NSObject {
|
private final class BundleMarker: NSObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -230,6 +264,13 @@ public final class DustEffectLayer: MetalEngineSubjectLayer, MetalEngineSubject
|
|||||||
let lastTimeStep = self.lastTimeStep
|
let lastTimeStep = self.lastTimeStep
|
||||||
self.lastTimeStep = 0.0
|
self.lastTimeStep = 0.0
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
if lastTimeStep * 1000.0 >= 20.0 {
|
||||||
|
print("Animation Lag: \(lastTimeStep * 1000.0) ms")
|
||||||
|
signposter.emitEvent("AnimationLag")
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
let _ = context.compute(state: DustComputeState.self, commands: { [weak self] commandBuffer, state in
|
let _ = context.compute(state: DustComputeState.self, commands: { [weak self] commandBuffer, state in
|
||||||
guard let self else {
|
guard let self else {
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user