Flutter Engine
 
Loading...
Searching...
No Matches
flutter::LayerStateStack::MutatorContext Class Reference

#include <layer_state_stack.h>

Public Member Functions

 ~MutatorContext ()
 
void saveLayer (const DlRect &bounds)
 
void applyOpacity (const DlRect &bounds, DlScalar opacity)
 
void applyImageFilter (const DlRect &bounds, const std::shared_ptr< DlImageFilter > &filter)
 
void applyColorFilter (const DlRect &bounds, const std::shared_ptr< const DlColorFilter > &filter)
 
void applyBackdropFilter (const DlRect &bounds, const std::shared_ptr< DlImageFilter > &filter, DlBlendMode blend_mode, std::optional< int64_t > backdrop_id)
 
void translate (DlScalar tx, DlScalar ty)
 
void translate (const DlPoint &tp)
 
void transform (const DlMatrix &matrix)
 
void integralTransform ()
 
void clipRect (const DlRect &rect, bool is_aa)
 
void clipRRect (const DlRoundRect &rrect, bool is_aa)
 
void clipRSuperellipse (const DlRoundSuperellipse &rse, bool is_aa)
 
void clipPath (const DlPath &path, bool is_aa)
 

Friends

class LayerStateStack
 

Detailed Description

Definition at line 156 of file layer_state_stack.h.

Constructor & Destructor Documentation

◆ ~MutatorContext()

flutter::LayerStateStack::MutatorContext::~MutatorContext ( )
inline

Definition at line 158 of file layer_state_stack.h.

158 {
159 layer_state_stack_->restore_to_count(stack_restore_count_);
160 }

Member Function Documentation

◆ applyBackdropFilter()

void flutter::MutatorContext::applyBackdropFilter ( const DlRect bounds,
const std::shared_ptr< DlImageFilter > &  filter,
DlBlendMode  blend_mode,
std::optional< int64_t >  backdrop_id 
)

Definition at line 562 of file layer_state_stack.cc.

566 {
567 layer_state_stack_->push_backdrop(bounds, filter, blend_mode, backdrop_id);
568}

Referenced by flutter::BackdropFilterLayer::Paint().

◆ applyColorFilter()

void flutter::MutatorContext::applyColorFilter ( const DlRect bounds,
const std::shared_ptr< const DlColorFilter > &  filter 
)

Definition at line 554 of file layer_state_stack.cc.

556 {
557 if (filter) {
558 layer_state_stack_->push_color_filter(bounds, filter);
559 }
560}

Referenced by flutter::testing::TEST().

◆ applyImageFilter()

void flutter::MutatorContext::applyImageFilter ( const DlRect bounds,
const std::shared_ptr< DlImageFilter > &  filter 
)

Definition at line 546 of file layer_state_stack.cc.

548 {
549 if (filter) {
550 layer_state_stack_->push_image_filter(bounds, filter);
551 }
552}

Referenced by flutter::testing::TEST().

◆ applyOpacity()

void flutter::MutatorContext::applyOpacity ( const DlRect bounds,
DlScalar  opacity 
)

Definition at line 540 of file layer_state_stack.cc.

540 {
541 if (opacity < SK_Scalar1) {
542 layer_state_stack_->push_opacity(bounds, opacity);
543 }
544}

Referenced by flutter::testing::TEST(), and flutter::testing::TEST().

◆ clipPath()

void flutter::MutatorContext::clipPath ( const DlPath path,
bool  is_aa 
)

Definition at line 613 of file layer_state_stack.cc.

613 {
614 layer_state_stack_->maybe_save_layer_for_clip(save_needed_);
615 save_needed_ = false;
616 layer_state_stack_->push_clip_path(path, is_aa);
617}
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition switch_defs.h:52

References flutter::path.

Referenced by flutter::ClipPathLayer::ApplyClip().

◆ clipRect()

void flutter::MutatorContext::clipRect ( const DlRect rect,
bool  is_aa 
)

Definition at line 594 of file layer_state_stack.cc.

594 {
595 layer_state_stack_->maybe_save_layer_for_clip(save_needed_);
596 save_needed_ = false;
597 layer_state_stack_->push_clip_rect(rect, is_aa);
598}

Referenced by flutter::ClipPathLayer::ApplyClip(), flutter::ClipRectLayer::ApplyClip(), and flutter::ClipRRectLayer::ApplyClip().

◆ clipRRect()

void flutter::MutatorContext::clipRRect ( const DlRoundRect rrect,
bool  is_aa 
)

Definition at line 600 of file layer_state_stack.cc.

600 {
601 layer_state_stack_->maybe_save_layer_for_clip(save_needed_);
602 save_needed_ = false;
603 layer_state_stack_->push_clip_rrect(rrect, is_aa);
604}

Referenced by flutter::ClipPathLayer::ApplyClip(), and flutter::ClipRRectLayer::ApplyClip().

◆ clipRSuperellipse()

void flutter::MutatorContext::clipRSuperellipse ( const DlRoundSuperellipse rse,
bool  is_aa 
)

Definition at line 606 of file layer_state_stack.cc.

607 {
608 layer_state_stack_->maybe_save_layer_for_clip(save_needed_);
609 save_needed_ = false;
610 layer_state_stack_->push_clip_rsuperellipse(rse, is_aa);
611}

Referenced by flutter::ClipRSuperellipseLayer::ApplyClip().

◆ integralTransform()

void flutter::MutatorContext::integralTransform ( )

Definition at line 588 of file layer_state_stack.cc.

588 {
589 layer_state_stack_->maybe_save_layer_for_transform(save_needed_);
590 save_needed_ = false;
591 layer_state_stack_->push_integral_transform();
592}

Referenced by flutter::ColorFilterLayer::Paint(), and flutter::ShaderMaskLayer::Paint().

◆ saveLayer()

void flutter::MutatorContext::saveLayer ( const DlRect bounds)

Definition at line 536 of file layer_state_stack.cc.

536 {
537 layer_state_stack_->save_layer(bounds);
538}

◆ transform()

void flutter::MutatorContext::transform ( const DlMatrix matrix)

Definition at line 578 of file layer_state_stack.cc.

578 {
580 translate(matrix.m[12], matrix.m[13]);
581 } else if (!matrix.IsIdentity()) {
582 layer_state_stack_->maybe_save_layer_for_transform(save_needed_);
583 save_needed_ = false;
584 layer_state_stack_->push_transform(matrix);
585 }
586}
void translate(DlScalar tx, DlScalar ty)
const DlMatrix matrix() const
constexpr bool IsTranslationOnly() const
Returns true if the matrix has no entries other than translation components. Note that an identity ma...
Definition matrix.h:480
constexpr bool IsIdentity() const
Definition matrix.h:467
Scalar m[16]
Definition matrix.h:39

References impeller::Matrix::IsIdentity(), impeller::Matrix::IsTranslationOnly(), impeller::Matrix::m, flutter::LayerStateStack::matrix(), and translate().

Referenced by flutter::TransformLayer::Paint(), and flutter::TransformLayer::Preroll().

◆ translate() [1/2]

void flutter::LayerStateStack::MutatorContext::translate ( const DlPoint tp)
inline

Definition at line 204 of file layer_state_stack.h.

204{ translate(tp.x, tp.y); }

References translate(), impeller::TPoint< T >::x, and impeller::TPoint< T >::y.

Referenced by translate().

◆ translate() [2/2]

Friends And Related Symbol Documentation

◆ LayerStateStack

friend class LayerStateStack
friend

Definition at line 217 of file layer_state_stack.h.


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