| Flutter Impeller |

sampler_vk.h
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
5 #ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SAMPLER_VK_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SAMPLER_VK_H_
7
8 #include "flutter/fml/macros.h"
9 #include "impeller/base/backend_cast.h"
10 #include "impeller/core/sampler.h"
11 #include "impeller/renderer/backend/vulkan/shared_object_vk.h"
12 #include "impeller/renderer/backend/vulkan/vk.h"
13
14 namespace impeller {
15
16 class SamplerLibraryVK;
17 class YUVConversionVK;
18
19 class SamplerVK final : public Sampler, public BackendCast<SamplerVK, Sampler> {
20 public:
21 SamplerVK(const vk::Device& device,
22 SamplerDescriptor desc,
23 std::shared_ptr<YUVConversionVK> yuv_conversion = {});
24
25 // |Sampler|
26 ~SamplerVK() override;
27
28 vk::Sampler GetSampler() const;
29
30 std::shared_ptr<SamplerVK> CreateVariantForConversion(
31 std::shared_ptr<YUVConversionVK> conversion) const;
32
33 const std::shared_ptr<YUVConversionVK>& GetYUVConversion() const;
34
35 private:
36 friend SamplerLibraryVK;
37
38 const vk::Device device_;
39 SharedHandleVK<vk::Sampler> sampler_;
40 std::shared_ptr<YUVConversionVK> yuv_conversion_;
41 bool is_valid_ = false;
42
43 SamplerVK(const SamplerVK&) = delete;
44
45 SamplerVK& operator=(const SamplerVK&) = delete;
46 };
47
48 } // namespace impeller
49
50 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SAMPLER_VK_H_
impeller::SamplerVK::SamplerVK
SamplerVK(const vk::Device &device, SamplerDescriptor desc, std::shared_ptr< YUVConversionVK > yuv_conversion={})
Definition: sampler_vk.cc:97
impeller::SamplerVK::GetYUVConversion
const std::shared_ptr< YUVConversionVK > & GetYUVConversion() const
Definition: sampler_vk.cc:122
shared_object_vk.h
impeller::SamplerVK::CreateVariantForConversion
std::shared_ptr< SamplerVK > CreateVariantForConversion(std::shared_ptr< YUVConversionVK > conversion) const
Definition: sampler_vk.cc:114
sampler.h
impeller::SamplerVK
Definition: sampler_vk.h:19
vk.h
impeller::SamplerDescriptor
Definition: sampler_descriptor.h:15
impeller::Sampler
Definition: sampler.h:15
impeller::SamplerLibraryVK
Definition: sampler_library_vk.h:15
backend_cast.h
impeller::SamplerVK::GetSampler
vk::Sampler GetSampler() const
Definition: sampler_vk.cc:110
impeller::BackendCast
Definition: backend_cast.h:11
impeller::SharedHandleVK
std::shared_ptr< SharedObjectVKT< T > > SharedHandleVK
Definition: shared_object_vk.h:52
impeller::SamplerVK::~SamplerVK
~SamplerVK() override
impeller
Definition: aiks_blur_unittests.cc:20