mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
3a7a3166a3
Add metal renderer for tint color. Добавил метал вью для рендеринга картинок. Подтянул новый алгоритм сравнения снепшотов. Обновил часть снепшотов (проверили, что все ок). Немного обновил RemoteImageViewContainer.
28 lines
540 B
Swift
28 lines
540 B
Swift
import CoreImage
|
|
|
|
public enum ImageGeneratorType: FilterProtocol {
|
|
case constantColor(color: CIColor)
|
|
|
|
public var name: String {
|
|
switch self {
|
|
case .constantColor:
|
|
return "CIConstantColorGenerator"
|
|
}
|
|
}
|
|
|
|
public var parameters: [String: Any] {
|
|
switch self {
|
|
case let .constantColor(color):
|
|
return [kCIInputColorKey: color]
|
|
}
|
|
}
|
|
|
|
private var filter: CIFilter? {
|
|
CIFilter(name: name, parameters: parameters)
|
|
}
|
|
|
|
public var imageGenerator: ImageGenerator {
|
|
{ filter?.outputImage }
|
|
}
|
|
}
|