| Flutter Impeller |

entity_pass_delegate.cc
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 #include "impeller/entity/entity_pass_delegate.h"
6 #include "impeller/entity/entity_pass.h"
7
8 namespace impeller {
9
10 EntityPassDelegate::EntityPassDelegate() = default;
11
12 EntityPassDelegate::~EntityPassDelegate() = default;
13
14 class DefaultEntityPassDelegate final : public EntityPassDelegate {
15 public:
16 DefaultEntityPassDelegate() = default;
17
18 // |EntityPassDelegate|
19 ~DefaultEntityPassDelegate() override = default;
20
21 // |EntityPassDelegate|
22 bool CanElide() override { return false; }
23
24 // |EntityPassDelegate|
25 bool CanCollapseIntoParentPass(EntityPass* entity_pass) override {
26 return true;
27 }
28
29 // |EntityPassDelegate|
30 std::shared_ptr<Contents> CreateContentsForSubpassTarget(
31 std::shared_ptr<Texture> target,
32 const Matrix& effect_transform) override {
33 // Not possible since this pass always collapses into its parent.
34 FML_UNREACHABLE();
35 }
36
37 // |EntityPassDelgate|
38 std::shared_ptr<FilterContents> WithImageFilter(
39 const FilterInput::Variant& input,
40 const Matrix& effect_transform) const override {
41 return nullptr;
42 }
43
44 private:
45 FML_DISALLOW_COPY_AND_ASSIGN(DefaultEntityPassDelegate);
46 };
47
48 std::unique_ptr<EntityPassDelegate> EntityPassDelegate::MakeDefault() {
49 return std::make_unique<DefaultEntityPassDelegate>();
50 }
51
52 } // namespace impeller
impeller::DefaultEntityPassDelegate::WithImageFilter
std::shared_ptr< FilterContents > WithImageFilter(const FilterInput::Variant &input, const Matrix &effect_transform) const override
Definition: entity_pass_delegate.cc:38
impeller::DefaultEntityPassDelegate::CanCollapseIntoParentPass
bool CanCollapseIntoParentPass(EntityPass *entity_pass) override
Whether or not this entity pass can be collapsed into the parent. If true, this method may modify the...
Definition: entity_pass_delegate.cc:25
entity_pass_delegate.h
impeller::EntityPassDelegate::~EntityPassDelegate
virtual ~EntityPassDelegate()
impeller::EntityPassDelegate::MakeDefault
static std::unique_ptr< EntityPassDelegate > MakeDefault()
Definition: entity_pass_delegate.cc:48
impeller::DefaultEntityPassDelegate::DefaultEntityPassDelegate
DefaultEntityPassDelegate()=default
impeller::DefaultEntityPassDelegate::~DefaultEntityPassDelegate
~DefaultEntityPassDelegate() override=default
impeller::DefaultEntityPassDelegate::CreateContentsForSubpassTarget
std::shared_ptr< Contents > CreateContentsForSubpassTarget(std::shared_ptr< Texture > target, const Matrix &effect_transform) override
Definition: entity_pass_delegate.cc:30
impeller::EntityPassDelegate
Definition: entity_pass_delegate.h:19
impeller::DefaultEntityPassDelegate::CanElide
bool CanElide() override
Definition: entity_pass_delegate.cc:22
impeller::DefaultEntityPassDelegate
Definition: entity_pass_delegate.cc:14
impeller::EntityPass
Definition: entity_pass.h:26
impeller::FilterInput::Variant
std::variant< std::shared_ptr< FilterContents >, std::shared_ptr< Contents >, std::shared_ptr< Texture >, Rect > Variant
Definition: filter_input.h:36
entity_pass.h
impeller::EntityPassDelegate::EntityPassDelegate
EntityPassDelegate()
impeller
Definition: aiks_context.cc:10
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:36