Flutter Impeller
yuv_conversion_library_vk.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
6 
9 
10 namespace impeller {
11 
13  std::weak_ptr<DeviceHolderVK> device_holder)
14  : device_holder_(std::move(device_holder)) {}
15 
16 YUVConversionLibraryVK::~YUVConversionLibraryVK() = default;
17 
18 std::shared_ptr<YUVConversionVK> YUVConversionLibraryVK::GetConversion(
19  const YUVConversionDescriptorVK& desc) {
20  Lock lock(conversions_mutex_);
21  auto found = conversions_.find(desc);
22  if (found != conversions_.end()) {
23  return found->second;
24  }
25  auto device_holder = device_holder_.lock();
26  if (!device_holder) {
27  VALIDATION_LOG << "Context loss during creation of YUV conversion.";
28  return nullptr;
29  }
30  return (conversions_[desc] = std::shared_ptr<YUVConversionVK>(
31  new YUVConversionVK(device_holder->GetDevice(), desc)));
32 }
33 
34 } // namespace impeller
YUVConversionLibraryVK(const YUVConversionLibraryVK &)=delete
It is sometimes necessary to deal with formats not native to Vulkan. In such cases,...
vk::StructureChain< vk::SamplerYcbcrConversionCreateInfo > YUVConversionDescriptorVK
Definition: comparable.h:95
#define VALIDATION_LOG
Definition: validation.h:91