Flutter Impeller
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 ()
 

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)) {}

◆ ~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 }

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 
)
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 }

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

Referenced by impeller::ExperimentalCanvas::Restore().

◆ WithImageFilter()

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

The documentation for this class was generated from the following files:
impeller::Paint::color
Color color
Definition: paint.h:68
impeller::BlendMode::kDestination
@ kDestination
impeller::Color::alpha
Scalar alpha
Definition: color.h:143
impeller::Paint::WithImageFilter
std::shared_ptr< FilterContents > WithImageFilter(const FilterInput::Variant &input, const Matrix &effect_transform, Entity::RenderingMode rendering_mode) const
Definition: paint.cc:90
impeller::Entity::RenderingMode::kSubpassPrependSnapshotTransform
@ kSubpassPrependSnapshotTransform
impeller::TRect< Scalar >::MakeSize
constexpr static TRect MakeSize(const TSize< U > &size)
Definition: rect.h:146
paint
const Paint & paint
Definition: color_source.cc:38
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:27
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:67
impeller::Paint::blend_mode
BlendMode blend_mode
Definition: paint.h:76