| 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 19 of file paint_pass_delegate.cc.

19 : 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 30 of file paint_pass_delegate.cc.

30 {
31 return false;
32 }

## ◆ CanElide()

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

Implements impeller::EntityPassDelegate.

Definition at line 25 of file paint_pass_delegate.cc.

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

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 35 of file paint_pass_delegate.cc.

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

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 50 of file paint_pass_delegate.cc.

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

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