Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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"
17
18namespace impeller {
19
21 : public SamplerLibrary,
22 public BackendCast<SamplerLibraryMTL, SamplerLibrary> {
23 public:
24 // |SamplerLibrary|
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 const std::unique_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_
const std::unique_ptr< const Sampler > & GetSampler(SamplerDescriptor descriptor) override
Retrieve a backend specific sampler object for the given sampler descriptor.
VkDevice device
Definition main.cc:53
std::unordered_map< SamplerDescriptor, std::unique_ptr< const Sampler >, ComparableHash< SamplerDescriptor >, ComparableEqual< SamplerDescriptor > > SamplerMap
Definition sampler.h:35