| Flutter Impeller |

runtime_effect_filter_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_FILTERS_RUNTIME_EFFECT_FILTER_CONTENTS_H_
6 #define FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_RUNTIME_EFFECT_FILTER_CONTENTS_H_
7
8 #include "impeller/entity/contents/filters/filter_contents.h"
9
10 namespace impeller {
11
12 /// A filter that applies a runtime effect shader
13 class RuntimeEffectFilterContents final : public FilterContents {
14 public:
15 RuntimeEffectFilterContents() {}
16
17 ~RuntimeEffectFilterContents() = default;
18
19 void SetRuntimeStage(std::shared_ptr<RuntimeStage> runtime_stage);
20
21 void SetUniforms(std::shared_ptr<std::vector<uint8_t>> uniforms);
22
23 void SetTextureInputs(
24 std::vector<RuntimeEffectContents::TextureInput> texture_inputs);
25
26 private:
27 std::shared_ptr<RuntimeStage> runtime_stage_;
28 std::shared_ptr<std::vector<uint8_t>> uniforms_;
29 std::vector<RuntimeEffectContents::TextureInput> texture_inputs_;
30
31 // |FilterContents|
32 std::optional<Entity> RenderFilter(
33 const FilterInput::Vector& input_textures,
34 const ContentContext& renderer,
35 const Entity& entity,
36 const Matrix& effect_transform,
37 const Rect& coverage,
38 const std::optional<Rect>& coverage_hint) const override;
39
40 // |FilterContents|
41 std::optional<Rect> GetFilterSourceCoverage(
42 const Matrix& effect_transform,
43 const Rect& output_limit) const override;
44
45 RuntimeEffectFilterContents(const RuntimeEffectFilterContents&) = delete;
46
47 RuntimeEffectFilterContents& operator=(const RuntimeEffectFilterContents&) =
48 delete;
49 };
50
51 } // namespace impeller
52
53 #endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_RUNTIME_EFFECT_FILTER_CONTENTS_H_
impeller::ContentContext
Definition: content_context.h:371
impeller::Entity
Definition: entity.h:20
impeller::FilterContents
Definition: filter_contents.h:24
impeller::FilterInput::Vector
std::vector< FilterInput::Ref > Vector
Definition: filter_input.h:33
impeller::RuntimeEffectFilterContents
A filter that applies a runtime effect shader.
Definition: runtime_effect_filter_contents.h:13
impeller::RuntimeEffectFilterContents::~RuntimeEffectFilterContents
~RuntimeEffectFilterContents()=default
impeller::RuntimeEffectFilterContents::SetTextureInputs
void SetTextureInputs(std::vector< RuntimeEffectContents::TextureInput > texture_inputs)
Definition: runtime_effect_filter_contents.cc:27
impeller::RuntimeEffectFilterContents::RuntimeEffectFilterContents
RuntimeEffectFilterContents()
Definition: runtime_effect_filter_contents.h:15
impeller::RuntimeEffectFilterContents::SetUniforms
void SetUniforms(std::shared_ptr< std::vector< uint8_t >> uniforms)
Definition: runtime_effect_filter_contents.cc:22
impeller::RuntimeEffectFilterContents::SetRuntimeStage
void SetRuntimeStage(std::shared_ptr< RuntimeStage > runtime_stage)
Definition: runtime_effect_filter_contents.cc:17
filter_contents.h
impeller
Definition: allocation.cc:12
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:37
impeller::TRect< Scalar >