Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
runtime_effect_contents.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_ENTITY_CONTENTS_RUNTIME_EFFECT_CONTENTS_H_
6#define FLUTTER_IMPELLER_ENTITY_CONTENTS_RUNTIME_EFFECT_CONTENTS_H_
7
8#include <memory>
9#include <vector>
10
14
15namespace impeller {
16
18 public:
19 struct TextureInput {
21 std::shared_ptr<Texture> texture;
22 };
23
24 void SetRuntimeStage(std::shared_ptr<RuntimeStage> runtime_stage);
25
26 void SetUniformData(std::shared_ptr<std::vector<uint8_t>> uniform_data);
27
28 void SetTextureInputs(std::vector<TextureInput> texture_inputs);
29
30 // | Contents|
31 bool CanInheritOpacity(const Entity& entity) const override;
32
33 // |Contents|
34 bool Render(const ContentContext& renderer,
35 const Entity& entity,
36 RenderPass& pass) const override;
37
38 /// Load the runtime effect and ensure a default PSO is initialized.
39 bool BootstrapShader(const ContentContext& renderer) const;
40
41 private:
42 bool RegisterShader(const ContentContext& renderer) const;
43
44 std::shared_ptr<Pipeline<PipelineDescriptor>> CreatePipeline(
45 const ContentContext& renderer,
47
48 std::shared_ptr<RuntimeStage> runtime_stage_;
49 std::shared_ptr<std::vector<uint8_t>> uniform_data_;
50 std::vector<TextureInput> texture_inputs_;
51};
52
53} // namespace impeller
54
55#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_RUNTIME_EFFECT_CONTENTS_H_
const char * options
Render passes encode render commands directed as one specific render target into an underlying comman...
Definition render_pass.h:33
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
bool BootstrapShader(const ContentContext &renderer) const
Load the runtime effect and ensure a default PSO is initialized.
void SetRuntimeStage(std::shared_ptr< RuntimeStage > runtime_stage)
void SetTextureInputs(std::vector< TextureInput > texture_inputs)
void SetUniformData(std::shared_ptr< std::vector< uint8_t > > uniform_data)
bool CanInheritOpacity(const Entity &entity) const override
Whether or not this contents can accept the opacity peephole optimization.