| Flutter Impeller |

Public Member Functions | List of all members
impeller::PaintPassDelegate Class Referencefinal

`#include <paint_pass_delegate.h>`

Inheritance diagram for impeller::PaintPassDelegate:

## Public Member Functions
| PaintPassDelegate (Paint paint)
| ~PaintPassDelegate () override
bool | CanElide () override
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 entities for the current pass. More...
std::shared_ptr< Contents > | CreateContentsForSubpassTarget (std::shared_ptr< Texture > target, const Matrix &effect_transform) override
std::shared_ptr< FilterContents > | WithImageFilter (const FilterInput::Variant &input, const Matrix &effect_transform) const override
Public Member Functions inherited from impeller::EntityPassDelegate
| EntityPassDelegate ()
virtual | ~EntityPassDelegate ()

## Additional Inherited Members
Static Public Member Functions inherited from impeller::EntityPassDelegate
static std::unique_ptr< EntityPassDelegate > | MakeDefault ()

## Detailed Description

Definition at line 17 of file paint_pass_delegate.h.

## Constructor & Destructor Documentation

## ◆ PaintPassDelegate()

impeller::PaintPassDelegate::PaintPassDelegate | ( | Paint | paint | ) |
| explicit

## PaintPassDelegate

Definition at line 20 of file paint_pass_delegate.cc.

20 : paint_(std::move(paint)) {}

## ◆ ~PaintPassDelegate()

impeller::PaintPassDelegate::~PaintPassDelegate | ( |  | ) |
| override default

## Member Function Documentation

## ◆ CanCollapseIntoParentPass()

bool impeller::PaintPassDelegate::CanCollapseIntoParentPass | ( | EntityPass * | entity_pass | ) |
| override virtual

Whether or not this entity pass can be collapsed into the parent. If true, this method may modify the entities for the current pass.

Implements impeller::EntityPassDelegate.

Definition at line 31 of file paint_pass_delegate.cc.

31 {
32 return false;
33 }

## ◆ CanElide()

bool impeller::PaintPassDelegate::CanElide | ( |  | ) |
| override virtual

Implements impeller::EntityPassDelegate.

Definition at line 26 of file paint_pass_delegate.cc.

26 {
27 return paint_.blend_mode == BlendMode::kDestination;
28 }

References impeller::Paint::blend_mode, and impeller::kDestination.

## ◆ CreateContentsForSubpassTarget()

std::shared_ptr< Contents > impeller::PaintPassDelegate::CreateContentsForSubpassTarget | ( | std::shared_ptr< Texture > | target,
|  | const Matrix & | effect_transform
| ) |  |
| override virtual

Implements impeller::EntityPassDelegate.

Definition at line 36 of file paint_pass_delegate.cc.

38 {
39 auto contents = TextureContents::MakeRect(Rect::MakeSize(target->GetSize()));
40 contents->SetTexture(target);
41 contents->SetLabel("Subpass");
42 contents->SetSourceRect(Rect::MakeSize(target->GetSize()));
43 contents->SetOpacity(paint_.color.alpha);
44 contents->SetDeferApplyingOpacity(true);
45
46 return paint_.WithFiltersForSubpassTarget(std::move(contents),
47 effect_transform);
48 }

References impeller::Color::alpha, impeller::Paint::color, impeller::TextureContents::MakeRect(), impeller::TRect< Scalar >::MakeSize(), and impeller::Paint::WithFiltersForSubpassTarget().

## ◆ WithImageFilter()

std::shared_ptr< FilterContents > impeller::PaintPassDelegate::WithImageFilter | ( | const FilterInput::Variant & | input,
|  | const Matrix & | effect_transform
| ) |  | const
| override virtual

Implements impeller::EntityPassDelegate.

Definition at line 51 of file paint_pass_delegate.cc.

53 {
54 return paint_.WithImageFilter(input, effect_transform,
55 Entity::RenderingMode::kSubpass);
56 }

References impeller::Entity::kSubpass, and impeller::Paint::WithImageFilter().

The documentation for this class was generated from the following files:

- impeller/aiks/paint_pass_delegate.h
- impeller/aiks/paint_pass_delegate.cc

impeller::Paint::color
Color color
Definition: paint.h:54
impeller::Color::alpha
Scalar alpha
Definition: color.h:141
impeller::BlendMode::kDestination
@ kDestination
impeller::Entity::RenderingMode::kSubpass
@ kSubpass
impeller::Paint::WithImageFilter
std::shared_ptr< FilterContents > WithImageFilter(const FilterInput::Variant &input, const Matrix &effect_transform, Entity::RenderingMode rendering_mode) const
Definition: paint.cc:92
impeller::TRect< Scalar >::MakeSize
constexpr static TRect MakeSize(const TSize< U > &size)
Definition: rect.h:52
impeller::TextureContents::MakeRect
static std::shared_ptr< TextureContents > MakeRect(Rect destination)
A common case factory that marks the texture contents as having a destination rectangle....
Definition: texture_contents.cc:28
impeller::Paint::WithFiltersForSubpassTarget
std::shared_ptr< Contents > WithFiltersForSubpassTarget(std::shared_ptr< Contents > input, const Matrix &effect_transform=Matrix()) const
Wrap this paint's configured filters to the given contents of subpass target.
Definition: paint.cc:71
impeller::Paint::blend_mode
BlendMode blend_mode
Definition: paint.h:63