Flutter Engine
 
Loading...
Searching...
No Matches
flutter::TransformLayer Class Reference

#include <transform_layer.h>

Inheritance diagram for flutter::TransformLayer:
flutter::ContainerLayer flutter::Layer

Public Member Functions

 TransformLayer (const DlMatrix &transform)
 
void Diff (DiffContext *context, const Layer *old_layer) override
 
void Preroll (PrerollContext *context) override
 
void Paint (PaintContext &context) const override
 
- Public Member Functions inherited from flutter::ContainerLayer
 ContainerLayer ()
 
void PreservePaintRegion (DiffContext *context) override
 
virtual void Add (std::shared_ptr< Layer > layer)
 
const std::vector< std::shared_ptr< Layer > > & layers () const
 
virtual void DiffChildren (DiffContext *context, const ContainerLayer *old_layer)
 
void PaintChildren (PaintContext &context) const override
 
const ContainerLayeras_container_layer () const override
 
const DlRectchild_paint_bounds () const
 
void set_child_paint_bounds (const DlRect &bounds)
 
int children_renderable_state_flags () const
 
void set_children_renderable_state_flags (int flags)
 
- Public Member Functions inherited from flutter::Layer
 Layer ()
 
virtual ~Layer ()
 
void AssignOldLayer (Layer *old_layer)
 
virtual bool IsReplacing (DiffContext *context, const Layer *old_layer) const
 
bool subtree_has_platform_view () const
 
void set_subtree_has_platform_view (bool value)
 
const DlRectpaint_bounds () const
 
void set_paint_bounds (const DlRect &paint_bounds)
 
bool is_empty () const
 
bool needs_painting (PaintContext &context) const
 
uint64_t original_layer_id () const
 
uint64_t unique_id () const
 
virtual RasterCacheKeyID caching_key_id () const
 
virtual const DisplayListLayeras_display_list_layer () const
 
virtual const TextureLayeras_texture_layer () const
 
virtual const PerformanceOverlayLayeras_performance_overlay_layer () const
 
virtual const testing::MockLayeras_mock_layer () const
 

Additional Inherited Members

- Static Public Attributes inherited from flutter::Layer
static constexpr int kSaveLayerRenderFlags
 
static constexpr int kRasterCacheRenderFlags
 
- Protected Member Functions inherited from flutter::ContainerLayer
void PrerollChildren (PrerollContext *context, DlRect *child_paint_bounds)
 

Detailed Description

Definition at line 12 of file transform_layer.h.

Constructor & Destructor Documentation

◆ TransformLayer()

flutter::TransformLayer::TransformLayer ( const DlMatrix transform)
explicit

Definition at line 11 of file transform_layer.cc.

12 : transform_(transform) {
13 FML_DCHECK(transform_.IsFinite());
14 if (!transform_.IsFinite()) {
15 FML_LOG(ERROR) << "TransformLayer is constructed with an invalid matrix.";
16 transform_ = {};
17 }
18}
#define FML_LOG(severity)
Definition logging.h:101
#define FML_DCHECK(condition)
Definition logging.h:122
bool IsFinite() const
Definition matrix.h:404

References FML_DCHECK, FML_LOG, and impeller::Matrix::IsFinite().

Member Function Documentation

◆ Diff()

void flutter::TransformLayer::Diff ( DiffContext context,
const Layer old_layer 
)
overridevirtual

Reimplemented from flutter::ContainerLayer.

Definition at line 20 of file transform_layer.cc.

20 {
21 DiffContext::AutoSubtreeRestore subtree(context);
22 auto* prev = static_cast<const TransformLayer*>(old_layer);
23 if (!context->IsSubtreeDirty()) {
24 FML_DCHECK(prev);
25 if (transform_ != prev->transform_) {
26 context->MarkSubtreeDirty(context->GetOldLayerPaintRegion(old_layer));
27 }
28 }
29 context->PushTransform(transform_);
30 DiffChildren(context, prev);
31 context->SetLayerPaintRegion(this, context->CurrentSubtreeRegion());
32}
virtual void DiffChildren(DiffContext *context, const ContainerLayer *old_layer)
TransformLayer(const DlMatrix &transform)

References flutter::DiffContext::CurrentSubtreeRegion(), flutter::ContainerLayer::DiffChildren(), FML_DCHECK, flutter::DiffContext::GetOldLayerPaintRegion(), flutter::DiffContext::IsSubtreeDirty(), flutter::DiffContext::MarkSubtreeDirty(), flutter::DiffContext::PushTransform(), and flutter::DiffContext::SetLayerPaintRegion().

◆ Paint()

void flutter::TransformLayer::Paint ( PaintContext context) const
overridevirtual

Reimplemented from flutter::ContainerLayer.

Definition at line 45 of file transform_layer.cc.

45 {
46 FML_DCHECK(needs_painting(context));
47
48 auto mutator = context.state_stack.save();
49 mutator.transform(transform_);
50
51 PaintChildren(context);
52}
void PaintChildren(PaintContext &context) const override
bool needs_painting(PaintContext &context) const
Definition layer.h:218

References FML_DCHECK, flutter::Layer::needs_painting(), flutter::ContainerLayer::PaintChildren(), flutter::LayerStateStack::save(), flutter::PaintContext::state_stack, and flutter::LayerStateStack::MutatorContext::transform().

◆ Preroll()

void flutter::TransformLayer::Preroll ( PrerollContext context)
overridevirtual

Reimplemented from flutter::ContainerLayer.

Definition at line 34 of file transform_layer.cc.

34 {
35 auto mutator = context->state_stack.save();
36 mutator.transform(transform_);
37
40
43}
const DlRect & child_paint_bounds() const
void PrerollChildren(PrerollContext *context, DlRect *child_paint_bounds)
void set_paint_bounds(const DlRect &paint_bounds)
Definition layer.h:209
impeller::Rect DlRect
constexpr TRect TransformAndClipBounds(const Matrix &transform) const
Creates a new bounding box that contains this transformed rectangle, clipped against the near clippin...
Definition rect.h:438

References flutter::ContainerLayer::child_paint_bounds(), flutter::ContainerLayer::PrerollChildren(), flutter::LayerStateStack::save(), flutter::Layer::set_paint_bounds(), flutter::PrerollContext::state_stack, flutter::LayerStateStack::MutatorContext::transform(), and impeller::TRect< T >::TransformAndClipBounds().


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