| Flutter Impeller |

multi_arch_shader_archive.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_SHADER_ARCHIVE_MULTI_ARCH_SHADER_ARCHIVE_H_
6 #define FLUTTER_IMPELLER_SHADER_ARCHIVE_MULTI_ARCH_SHADER_ARCHIVE_H_
7
8 #include <map>
9 #include <memory>
10
11 #include "flutter/fml/macros.h"
12 #include "flutter/fml/mapping.h"
13 #include "impeller/shader_archive/shader_archive.h"
14 #include "impeller/shader_archive/shader_archive_types.h"
15
16 namespace impeller {
17
18 class MultiArchShaderArchive {
19 public:
20 static std::shared_ptr<ShaderArchive> CreateArchiveFromMapping(
21 const std::shared_ptr<const fml::Mapping>& mapping,
22 ArchiveRenderingBackend backend);
23
24 explicit MultiArchShaderArchive(
25 const std::shared_ptr<const fml::Mapping>& mapping);
26
27 ~MultiArchShaderArchive();
28
29 std::shared_ptr<const fml::Mapping> GetArchive(
30 ArchiveRenderingBackend backend) const;
31
32 std::shared_ptr<ShaderArchive> GetShaderArchive(
33 ArchiveRenderingBackend backend) const;
34
35 bool IsValid() const;
36
37 private:
38 std::map<ArchiveRenderingBackend, std::shared_ptr<const fml::Mapping>>
39 backend_mappings_;
40 bool is_valid_ = false;
41
42 MultiArchShaderArchive(const MultiArchShaderArchive&) = delete;
43
44 MultiArchShaderArchive& operator=(const MultiArchShaderArchive&) = delete;
45 };
46
47 } // namespace impeller
48
49 #endif // FLUTTER_IMPELLER_SHADER_ARCHIVE_MULTI_ARCH_SHADER_ARCHIVE_H_
shader_archive_types.h
impeller::MultiArchShaderArchive::MultiArchShaderArchive
MultiArchShaderArchive(const std::shared_ptr< const fml::Mapping > &mapping)
Definition: multi_arch_shader_archive.cc:43
impeller::MultiArchShaderArchive::GetArchive
std::shared_ptr< const fml::Mapping > GetArchive(ArchiveRenderingBackend backend) const
Definition: multi_arch_shader_archive.cc:81
impeller::MultiArchShaderArchive
Definition: multi_arch_shader_archive.h:18
impeller::MultiArchShaderArchive::CreateArchiveFromMapping
static std::shared_ptr< ShaderArchive > CreateArchiveFromMapping(const std::shared_ptr< const fml::Mapping > &mapping, ArchiveRenderingBackend backend)
Definition: multi_arch_shader_archive.cc:24
impeller::MultiArchShaderArchive::~MultiArchShaderArchive
~MultiArchShaderArchive()
shader_archive.h
impeller::MultiArchShaderArchive::IsValid
bool IsValid() const
Definition: multi_arch_shader_archive.cc:77
impeller::ArchiveRenderingBackend
ArchiveRenderingBackend
Definition: shader_archive_types.h:16
impeller::MultiArchShaderArchive::GetShaderArchive
std::shared_ptr< ShaderArchive > GetShaderArchive(ArchiveRenderingBackend backend) const
Definition: multi_arch_shader_archive.cc:90
impeller
Definition: aiks_context.cc:10