| Flutter Impeller |

runtime_stage.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_RUNTIME_STAGE_RUNTIME_STAGE_H_
6 #define FLUTTER_IMPELLER_RUNTIME_STAGE_RUNTIME_STAGE_H_
7
8 #include <map>
9 #include <memory>
10 #include <string>
11
12 #include "flutter/fml/macros.h"
13 #include "flutter/fml/mapping.h"
14
15 #include "flutter/impeller/core/runtime_types.h"
16 #include "runtime_stage_types_flatbuffers.h"
17
18 namespace impeller {
19
20 class RuntimeStage {
21 public:
22 using Map = std::map<RuntimeStageBackend, std::shared_ptr<RuntimeStage>>;
23 static Map DecodeRuntimeStages(const std::shared_ptr<fml::Mapping>& payload);
24
25 RuntimeStage(const fb::RuntimeStage* runtime_stage,
26 const std::shared_ptr<fml::Mapping>& payload);
27 ~RuntimeStage();
28 RuntimeStage(RuntimeStage&&);
29 RuntimeStage& operator=(RuntimeStage&&);
30
31 bool IsValid() const;
32
33 RuntimeShaderStage GetShaderStage() const;
34
35 const std::vector<RuntimeUniformDescription>& GetUniforms() const;
36
37 const std::string& GetEntrypoint() const;
38
39 const RuntimeUniformDescription* GetUniform(const std::string& name) const;
40
41 const std::shared_ptr<fml::Mapping>& GetCodeMapping() const;
42
43 bool IsDirty() const;
44
45 void SetClean();
46
47 private:
48 std::shared_ptr<fml::Mapping> payload_;
49 RuntimeShaderStage stage_ = RuntimeShaderStage::kVertex;
50 std::string entrypoint_;
51 std::shared_ptr<fml::Mapping> code_mapping_;
52 std::vector<RuntimeUniformDescription> uniforms_;
53 bool is_valid_ = false;
54 bool is_dirty_ = true;
55
56 RuntimeStage(const RuntimeStage&) = delete;
57
58 static std::unique_ptr<RuntimeStage> RuntimeStageIfPresent(
59 const fb::RuntimeStage* runtime_stage,
60 const std::shared_ptr<fml::Mapping>& payload);
61
62 RuntimeStage& operator=(const RuntimeStage&) = delete;
63 };
64
65 } // namespace impeller
66
67 #endif // FLUTTER_IMPELLER_RUNTIME_STAGE_RUNTIME_STAGE_H_
impeller::RuntimeStage::~RuntimeStage
~RuntimeStage()
impeller::RuntimeUniformDescription
Definition: runtime_types.h:48
impeller::RuntimeStage::GetShaderStage
RuntimeShaderStage GetShaderStage() const
Definition: runtime_stage.cc:157
impeller::RuntimeShaderStage
RuntimeShaderStage
Definition: runtime_types.h:37
impeller::RuntimeStage::RuntimeStage
RuntimeStage(const fb::RuntimeStage *runtime_stage, const std::shared_ptr< fml::Mapping > &payload)
Definition: runtime_stage.cc:94
impeller::RuntimeStage::DecodeRuntimeStages
static Map DecodeRuntimeStages(const std::shared_ptr< fml::Mapping > &payload)
Definition: runtime_stage.cc:72
impeller::RuntimeStage
Definition: runtime_stage.h:20
runtime_types.h
impeller::RuntimeStage::GetUniforms
const std::vector< RuntimeUniformDescription > & GetUniforms() const
Definition: runtime_stage.cc:138
impeller::RuntimeShaderStage::kVertex
@ kVertex
impeller::RuntimeStage::operator=
RuntimeStage & operator=(RuntimeStage &&)
impeller::RuntimeStage::GetUniform
const RuntimeUniformDescription * GetUniform(const std::string &name) const
Definition: runtime_stage.cc:143
impeller::RuntimeStage::SetClean
void SetClean()
Definition: runtime_stage.cc:165
impeller::RuntimeStage::IsValid
bool IsValid() const
Definition: runtime_stage.cc:130
impeller::RuntimeStage::IsDirty
bool IsDirty() const
Definition: runtime_stage.cc:161
impeller::RuntimeStage::GetEntrypoint
const std::string & GetEntrypoint() const
Definition: runtime_stage.cc:153
impeller
Definition: aiks_context.cc:10
impeller::RuntimeStage::Map
std::map< RuntimeStageBackend, std::shared_ptr< RuntimeStage > > Map
Definition: runtime_stage.h:22
impeller::RuntimeStage::GetCodeMapping
const std::shared_ptr< fml::Mapping > & GetCodeMapping() const
Definition: runtime_stage.cc:134