7 #include "flutter/fml/hash_combine.h"
17 auto conversion = device.createSamplerYcbcrConversionUnique(chain_.get());
18 if (conversion.result != vk::Result::eSuccess) {
20 << vk::to_string(conversion.result);
23 conversion_ = std::move(conversion.value);
29 return conversion_ && !!conversion_.get();
33 return conversion_ ? conversion_.get()
34 :
static_cast<vk::SamplerYcbcrConversion
>(VK_NULL_HANDLE);
45 const auto& conv = desc.get();
47 std::size_t hash = fml::HashCombine(conv.format,
57 conv.forceExplicitReconstruction
60 const auto external_format = desc.get<vk::ExternalFormatANDROID>();
61 fml::HashCombineSeed(hash, external_format.externalFormat);
62 #endif // FML_OS_ANDROID
73 const auto& lhs = lhs_desc.get();
74 const auto& rhs = rhs_desc.get();
76 if (lhs.format != rhs.format ||
77 lhs.ycbcrModel != rhs.ycbcrModel ||
78 lhs.ycbcrRange != rhs.ycbcrRange ||
79 lhs.components.r != rhs.components.r ||
80 lhs.components.g != rhs.components.g ||
81 lhs.components.b != rhs.components.b ||
82 lhs.components.a != rhs.components.a ||
83 lhs.xChromaOffset != rhs.xChromaOffset ||
84 lhs.yChromaOffset != rhs.yChromaOffset ||
85 lhs.chromaFilter != rhs.chromaFilter ||
86 lhs.forceExplicitReconstruction != rhs.forceExplicitReconstruction
93 const auto lhs = lhs_desc.get<vk::ExternalFormatANDROID>();
94 const auto rhs = rhs_desc.get<vk::ExternalFormatANDROID>();
95 return lhs.externalFormat == rhs.externalFormat;
97 #else // FML_OS_ANDROID
99 #endif // FML_OS_ANDROID
103 : sampler(sampler.GetDescriptor()) {
104 if (
const auto& conversion =
sampler.GetYUVConversion()) {