7#include "flutter/fml/hash_combine.h"
17 auto conversion =
device.createSamplerYcbcrConversionUnique(chain_.get());
18 if (conversion.result != vk::Result::eSuccess) {
23 conversion_ = std::move(conversion.value);
26YUVConversionVK::~YUVConversionVK() =
default;
28bool YUVConversionVK::IsValid()
const {
29 return conversion_ && !!conversion_.get();
32vk::SamplerYcbcrConversion YUVConversionVK::GetConversion()
const {
33 return conversion_ ? conversion_.get()
41std::size_t YUVConversionDescriptorVKHash::operator()(
45 const auto& conv =
desc.get();
57 conv.forceExplicitReconstruction
67bool YUVConversionDescriptorVKEqual::operator()(
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;
102ImmutableSamplerKeyVK::ImmutableSamplerKeyVK(
const SamplerVK& sampler)
103 : sampler(sampler.GetDescriptor()) {
104 if (
const auto& conversion =
sampler.GetYUVConversion()) {
static uint32_t hash(const SkShaderBase::GradientInfo &v)
YUVConversionVK(const YUVConversionVK &)=delete
constexpr std::size_t HashCombine()
constexpr void HashCombineSeed(std::size_t &seed, Type arg)
vk::StructureChain< vk::SamplerYcbcrConversionCreateInfo > YUVConversionDescriptorVK
static SkString to_string(int n)
bool IsEqual(const ImmutableSamplerKeyVK &other) const override
YUVConversionDescriptorVK yuv_conversion
std::size_t GetHash() const override
SamplerDescriptor sampler
bool IsEqual(const SamplerDescriptor &o) const override
std::size_t GetHash() const override