Flutter Engine
The Flutter Engine
Public Member Functions | Friends | List of all members
flutter::LayerStateStack::MutatorContext Class Reference

#include <layer_state_stack.h>

Public Member Functions

 ~MutatorContext ()
 
void saveLayer (const SkRect &bounds)
 
void applyOpacity (const SkRect &bounds, SkScalar opacity)
 
void applyImageFilter (const SkRect &bounds, const std::shared_ptr< const DlImageFilter > &filter)
 
void applyColorFilter (const SkRect &bounds, const std::shared_ptr< const DlColorFilter > &filter)
 
void applyBackdropFilter (const SkRect &bounds, const std::shared_ptr< const DlImageFilter > &filter, DlBlendMode blend_mode)
 
void translate (SkScalar tx, SkScalar ty)
 
void translate (SkPoint tp)
 
void transform (const SkM44 &m44)
 
void transform (const SkMatrix &matrix)
 
void integralTransform ()
 
void clipRect (const SkRect &rect, bool is_aa)
 
void clipRRect (const SkRRect &rrect, bool is_aa)
 
void clipPath (const SkPath &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 SkRect bounds,
const std::shared_ptr< const DlImageFilter > &  filter,
DlBlendMode  blend_mode 
)

Definition at line 558 of file layer_state_stack.cc.

561 {
562 layer_state_stack_->push_backdrop(bounds, filter, blend_mode);
563}
Optional< SkRect > bounds
Definition: SkRecords.h:189

◆ applyColorFilter()

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

Definition at line 550 of file layer_state_stack.cc.

552 {
553 if (filter) {
554 layer_state_stack_->push_color_filter(bounds, filter);
555 }
556}

◆ applyImageFilter()

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

Definition at line 542 of file layer_state_stack.cc.

544 {
545 if (filter) {
546 layer_state_stack_->push_image_filter(bounds, filter);
547 }
548}

◆ applyOpacity()

void flutter::MutatorContext::applyOpacity ( const SkRect bounds,
SkScalar  opacity 
)

Definition at line 536 of file layer_state_stack.cc.

536 {
537 if (opacity < SK_Scalar1) {
538 layer_state_stack_->push_opacity(bounds, opacity);
539 }
540}
#define SK_Scalar1
Definition: SkScalar.h:18

◆ clipPath()

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

Definition at line 611 of file layer_state_stack.cc.

611 {
612 layer_state_stack_->maybe_save_layer_for_clip(save_needed_);
613 save_needed_ = false;
614 layer_state_stack_->push_clip_path(path, is_aa);
615}
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: switches.h:57

◆ clipRect()

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

Definition at line 599 of file layer_state_stack.cc.

599 {
600 layer_state_stack_->maybe_save_layer_for_clip(save_needed_);
601 save_needed_ = false;
602 layer_state_stack_->push_clip_rect(rect, is_aa);
603}
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350

◆ clipRRect()

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

Definition at line 605 of file layer_state_stack.cc.

605 {
606 layer_state_stack_->maybe_save_layer_for_clip(save_needed_);
607 save_needed_ = false;
608 layer_state_stack_->push_clip_rrect(rrect, is_aa);
609}
SkRRect rrect
Definition: SkRecords.h:232

◆ integralTransform()

void flutter::MutatorContext::integralTransform ( )

Definition at line 593 of file layer_state_stack.cc.

593 {
594 layer_state_stack_->maybe_save_layer_for_transform(save_needed_);
595 save_needed_ = false;
596 layer_state_stack_->push_integral_transform();
597}

◆ saveLayer()

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

Definition at line 532 of file layer_state_stack.cc.

532 {
533 layer_state_stack_->save_layer(bounds);
534}

◆ transform() [1/2]

void flutter::MutatorContext::transform ( const SkM44 m44)

Definition at line 583 of file layer_state_stack.cc.

583 {
585 transform(m44.asM33());
586 } else {
587 layer_state_stack_->maybe_save_layer_for_transform(save_needed_);
588 save_needed_ = false;
589 layer_state_stack_->push_transform(m44);
590 }
591}
SkMatrix asM33() const
Definition: SkM44.h:409
static bool is_3x3(const SkM44 &m44)

◆ transform() [2/2]

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

Definition at line 573 of file layer_state_stack.cc.

573 {
574 if (matrix.isTranslate()) {
575 translate(matrix.getTranslateX(), matrix.getTranslateY());
576 } else if (!matrix.isIdentity()) {
577 layer_state_stack_->maybe_save_layer_for_transform(save_needed_);
578 save_needed_ = false;
579 layer_state_stack_->push_transform(matrix);
580 }
581}
void translate(SkScalar tx, SkScalar ty)
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258

◆ translate() [1/2]

void flutter::LayerStateStack::MutatorContext::translate ( SkPoint  tp)
inline

Definition at line 203 of file layer_state_stack.h.

203{ translate(tp.fX, tp.fY); }
float fX
x-axis value
Definition: SkPoint_impl.h:164
float fY
y-axis value
Definition: SkPoint_impl.h:165

◆ translate() [2/2]

void flutter::MutatorContext::translate ( SkScalar  tx,
SkScalar  ty 
)

Definition at line 565 of file layer_state_stack.cc.

565 {
566 if (!(tx == 0 && ty == 0)) {
567 layer_state_stack_->maybe_save_layer_for_transform(save_needed_);
568 save_needed_ = false;
569 layer_state_stack_->push_translate(tx, ty);
570 }
571}

Friends And Related Function Documentation

◆ LayerStateStack

friend class LayerStateStack
friend

Definition at line 216 of file layer_state_stack.h.


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