【问题标题】:Why is simulator very slow when using CIFilter为什么模拟器在使用 CIFilter 时很慢
【发布时间】:2016-06-01 22:40:24
【问题描述】:

我正在使用 CIFilter 创建图像过滤器并将其显示在图像视图上。发生的情况是它在 iphone 设备上运行良好,但在模拟器上运行速度很慢。下面是代码。我徘徊为什么模拟器与设备相比如此缓慢。有没有办法增加模拟器内存​​或 cpu 以使其像设备一样工作?

func outputImage(filter: CIFilter, originalImage: UIImage) -> UIImage{
    print(filter)
    let inputImage = CIImage(image: originalImage)
    filter.setValue(inputImage, forKey: kCIInputImageKey)
    let outputImage =  filter.outputImage
    let cgImage = context!.createCGImage(outputImage!, fromRect: (outputImage?.extent)!)
    return UIImage(CGImage: cgImage, scale: 1, orientation: originalImage.imageOrientation)
}

【问题讨论】:

  • 我不确定,只是猜测是因为 GPU?

标签: ios iphone xcode swift simulator


【解决方案1】:

勾选Debug -> Toggle Slow Animations是Unchecked你可能不小心勾选了,这也是性能的原因。

【讨论】:

  • 感谢您的回复。我检查了我没有检查慢动画
【解决方案2】:

我想知道为什么模拟器与设备相比如此缓慢

这是因为模拟器不使用 GPU。 Xcode 11 / Catalina 组合率先在模拟器中使用 GPU。

【讨论】:

    猜你喜欢
    • 2013-05-19
    • 2011-11-15
    • 2012-10-27
    • 1970-01-01
    • 2021-02-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-07
    相关资源
    最近更新 更多