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

#include <paint_pass_delegate.h>

Inheritance diagram for impeller::PaintPassDelegate:
impeller::EntityPassDelegate

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< ContentsCreateContentsForSubpassTarget (std::shared_ptr< Texture > target, const Matrix &effect_transform) override
 
std::shared_ptr< FilterContentsWithImageFilter (const FilterInput::Variant &input, const Matrix &effect_transform) const override
 
- Public Member Functions inherited from impeller::EntityPassDelegate
 EntityPassDelegate ()
 
virtual ~EntityPassDelegate ()
 
virtual bool CanElide ()=0
 
virtual bool CanCollapseIntoParentPass (EntityPass *entity_pass)=0
 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...
 
virtual std::shared_ptr< ContentsCreateContentsForSubpassTarget (std::shared_ptr< Texture > target, const Matrix &effect_transform)=0
 
virtual std::shared_ptr< FilterContentsWithImageFilter (const FilterInput::Variant &input, const Matrix &effect_transform) const =0
 

Additional Inherited Members

- Static Public Member Functions inherited from impeller::EntityPassDelegate
static std::unique_ptr< EntityPassDelegateMakeDefault ()
 

Detailed Description

Definition at line 15 of file paint_pass_delegate.h.

Constructor & Destructor Documentation

◆ PaintPassDelegate()

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

PaintPassDelegate

Definition at line 18 of file paint_pass_delegate.cc.

18: paint_(std::move(paint)) {}
const Paint & paint
Definition: color_source.cc:38

◆ ~PaintPassDelegate()

impeller::PaintPassDelegate::~PaintPassDelegate ( )
overridedefault

Member Function Documentation

◆ CanCollapseIntoParentPass()

bool impeller::PaintPassDelegate::CanCollapseIntoParentPass ( EntityPass entity_pass)
overridevirtual

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

29 {
30 return false;
31}

◆ CanElide()

bool impeller::PaintPassDelegate::CanElide ( )
overridevirtual

Implements impeller::EntityPassDelegate.

Definition at line 24 of file paint_pass_delegate.cc.

24 {
25 return paint_.blend_mode == BlendMode::kDestination;
26}
BlendMode blend_mode
Definition: paint.h:76

◆ CreateContentsForSubpassTarget()

std::shared_ptr< Contents > impeller::PaintPassDelegate::CreateContentsForSubpassTarget ( std::shared_ptr< Texture target,
const Matrix effect_transform 
)
overridevirtual

Implements impeller::EntityPassDelegate.

Definition at line 34 of file paint_pass_delegate.cc.

36 {
37 auto contents = TextureContents::MakeRect(Rect::MakeSize(target->GetSize()));
38 contents->SetTexture(target);
39 contents->SetLabel("Subpass");
40 contents->SetSourceRect(Rect::MakeSize(target->GetSize()));
41 contents->SetOpacity(paint_.color.alpha);
42 contents->SetDeferApplyingOpacity(true);
43
44 return paint_.WithFiltersForSubpassTarget(std::move(contents),
45 effect_transform);
46}
static std::shared_ptr< TextureContents > MakeRect(Rect destination)
A common case factory that marks the texture contents as having a destination rectangle....
uint32_t * target
Scalar alpha
Definition: color.h:143
Color color
Definition: paint.h:68
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:67
static constexpr TRect MakeSize(const TSize< U > &size)
Definition: rect.h:146

◆ WithImageFilter()

std::shared_ptr< FilterContents > impeller::PaintPassDelegate::WithImageFilter ( const FilterInput::Variant input,
const Matrix effect_transform 
) const
overridevirtual

Implements impeller::EntityPassDelegate.

Definition at line 49 of file paint_pass_delegate.cc.

51 {
52 return paint_.WithImageFilter(
53 input, effect_transform,
55}
std::shared_ptr< FilterContents > WithImageFilter(const FilterInput::Variant &input, const Matrix &effect_transform, Entity::RenderingMode rendering_mode) const
Definition: paint.cc:90

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