Flutter Engine
flutter::ColorFilterLayer Class Reference

#include <color_filter_layer.h>

Inheritance diagram for flutter::ColorFilterLayer:
flutter::ContainerLayer flutter::Layer

Public Member Functions

 ColorFilterLayer (sk_sp< SkColorFilter > filter)
 
void Preroll (PrerollContext *context, const SkMatrix &matrix) override
 
void Paint (PaintContext &context) const override
 
- Public Member Functions inherited from flutter::ContainerLayer
 ContainerLayer ()
 
virtual void Add (std::shared_ptr< Layer > layer)
 
void Preroll (PrerollContext *context, const SkMatrix &matrix) override
 
void Paint (PaintContext &context) const override
 
const std::vector< std::shared_ptr< Layer > > & layers () const
 
- Public Member Functions inherited from flutter::Layer
 Layer ()
 
virtual ~Layer ()
 
bool needs_system_composite () const
 
void set_needs_system_composite (bool value)
 
const SkRect & paint_bounds () const
 
void set_paint_bounds (const SkRect &paint_bounds)
 
bool needs_painting () const
 
uint64_t unique_id () const
 

Additional Inherited Members

- Protected Member Functions inherited from flutter::ContainerLayer
void PrerollChildren (PrerollContext *context, const SkMatrix &child_matrix, SkRect *child_paint_bounds)
 
void PaintChildren (PaintContext &context) const
 
- Static Protected Member Functions inherited from flutter::ContainerLayer
static void TryToPrepareRasterCache (PrerollContext *context, Layer *layer, const SkMatrix &matrix)
 

Detailed Description

Definition at line 13 of file color_filter_layer.h.

Constructor & Destructor Documentation

◆ ColorFilterLayer()

flutter::ColorFilterLayer::ColorFilterLayer ( sk_sp< SkColorFilter >  filter)

Definition at line 9 of file color_filter_layer.cc.

10  : filter_(std::move(filter)) {}

Member Function Documentation

◆ Paint()

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

Implements flutter::Layer.

Definition at line 19 of file color_filter_layer.cc.

References flutter::Layer::AutoSaveLayer::Create(), FML_DCHECK, flutter::Layer::needs_painting(), flutter::Layer::paint_bounds(), flutter::ContainerLayer::PaintChildren(), and TRACE_EVENT0.

19  {
20  TRACE_EVENT0("flutter", "ColorFilterLayer::Paint");
22 
23  SkPaint paint;
24  paint.setColorFilter(filter_);
25 
26  Layer::AutoSaveLayer save =
27  Layer::AutoSaveLayer::Create(context, paint_bounds(), &paint);
28  PaintChildren(context);
29 }
#define TRACE_EVENT0(category_group, name)
Definition: trace_event.h:75
#define FML_DCHECK(condition)
Definition: logging.h:86
static AutoSaveLayer Create(const PaintContext &paint_context, const SkRect &bounds, const SkPaint *paint)
Definition: layer.cc:96
bool needs_painting() const
Definition: layer.h:174
const SkRect & paint_bounds() const
Definition: layer.h:166
void PaintChildren(PaintContext &context) const

◆ Preroll()

void flutter::ColorFilterLayer::Preroll ( PrerollContext context,
const SkMatrix &  matrix 
)
overridevirtual

Reimplemented from flutter::Layer.

Definition at line 12 of file color_filter_layer.cc.

References flutter::Layer::AutoPrerollSaveLayerState::Create(), and flutter::ContainerLayer::Preroll().

13  {
14  Layer::AutoPrerollSaveLayerState save =
16  ContainerLayer::Preroll(context, matrix);
17 }
static AutoPrerollSaveLayerState Create(PrerollContext *preroll_context, bool save_layer_is_active=true, bool layer_itself_performs_readback=false)
Definition: layer.cc:43
void Preroll(PrerollContext *context, const SkMatrix &matrix) override

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