| Flutter Impeller |

sampler_library_mtl.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_METAL_SAMPLER_LIBRARY_MTL_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SAMPLER_LIBRARY_MTL_H_
7
8 #include <Metal/Metal.h>
9
10 #include <memory>
11
12 #include "flutter/fml/macros.h"
13 #include "impeller/base/backend_cast.h"
14 #include "impeller/base/comparable.h"
15 #include "impeller/core/sampler_descriptor.h"
16 #include "impeller/renderer/sampler_library.h"
17
18 namespace impeller {
19
20 class SamplerLibraryMTL final
21 : public SamplerLibrary,
22 public BackendCast<SamplerLibraryMTL, SamplerLibrary> {
23 public:
24 // |SamplerLibrary|
25 ~SamplerLibraryMTL() override;
26
27 private:
28 friend class ContextMTL;
29
30 id<MTLDevice> device_ = nullptr;
31 SamplerMap samplers_;
32
33 explicit SamplerLibraryMTL(id<MTLDevice> device);
34
35 // |SamplerLibrary|
36 std::shared_ptr<const Sampler> GetSampler(
37 SamplerDescriptor descriptor) override;
38
39 SamplerLibraryMTL(const SamplerLibraryMTL&) = delete;
40
41 SamplerLibraryMTL& operator=(const SamplerLibraryMTL&) = delete;
42 };
43
44 } // namespace impeller
45
46 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SAMPLER_LIBRARY_MTL_H_
sampler_library.h
impeller::SamplerLibraryMTL::~SamplerLibraryMTL
~SamplerLibraryMTL() override
impeller::SamplerDescriptor
Definition: sampler_descriptor.h:15
impeller::SamplerMap
std::unordered_map< SamplerDescriptor, std::shared_ptr< const Sampler >, ComparableHash< SamplerDescriptor >, ComparableEqual< SamplerDescriptor > > SamplerMap
Definition: sampler.h:37
backend_cast.h
sampler_descriptor.h
impeller::SamplerLibraryMTL
Definition: sampler_library_mtl.h:20
comparable.h
impeller::BackendCast
Definition: backend_cast.h:13
impeller::SamplerLibrary
Definition: sampler_library.h:13
impeller::ContextMTL
Definition: context_mtl.h:34
impeller
Definition: aiks_context.cc:10