Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
flutter::OpacityEntry Class Reference

Inherits flutter::LayerStateStack::StateEntry.

Public Member Functions

 OpacityEntry (const SkRect &bounds, SkScalar opacity, const LayerStateStack::RenderingAttributes &prev)
 
void apply (LayerStateStack *stack) const override
 
void restore (LayerStateStack *stack) const override
 
void update_mutators (MutatorsStack *mutators_stack) const override
 

Detailed Description

Definition at line 250 of file layer_state_stack.cc.

Constructor & Destructor Documentation

◆ OpacityEntry()

flutter::OpacityEntry::OpacityEntry ( const SkRect bounds,
SkScalar  opacity,
const LayerStateStack::RenderingAttributes &  prev 
)
inline

Definition at line 252 of file layer_state_stack.cc.

255 : bounds_(bounds),
256 opacity_(opacity),
257 old_opacity_(prev.opacity),
258 old_bounds_(prev.save_layer_bounds) {}
static float prev(float f)

Member Function Documentation

◆ apply()

void flutter::OpacityEntry::apply ( LayerStateStack stack) const
inlineoverride

Definition at line 260 of file layer_state_stack.cc.

260 {
261 stack->outstanding_.save_layer_bounds = bounds_;
262 stack->outstanding_.opacity *= opacity_;
263 }

◆ restore()

void flutter::OpacityEntry::restore ( LayerStateStack stack) const
inlineoverride

Definition at line 264 of file layer_state_stack.cc.

264 {
265 stack->outstanding_.save_layer_bounds = old_bounds_;
266 stack->outstanding_.opacity = old_opacity_;
267 }

◆ update_mutators()

void flutter::OpacityEntry::update_mutators ( MutatorsStack mutators_stack) const
inlineoverride

Definition at line 268 of file layer_state_stack.cc.

268 {
269 mutators_stack->PushOpacity(DlColor::toAlpha(opacity_));
270 }
static constexpr uint8_t toAlpha(SkScalar opacity)
Definition dl_color.h:17

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