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 ()
 
void AssignOldLayer (Layer *old_layer)
 
bool subtree_has_platform_view () const
 
void set_subtree_has_platform_view (bool value)
 
const SkRect & paint_bounds () const
 
void set_paint_bounds (const SkRect &paint_bounds)
 
bool is_empty () const
 
bool needs_painting (PaintContext &context) const
 
uint64_t original_layer_id () 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.

References FML_DCHECK.

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

Member Function Documentation

◆ Paint()

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

Implements flutter::Layer.

Definition at line 38 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.

38  {
39  TRACE_EVENT0("flutter", "ColorFilterLayer::Paint");
40  FML_DCHECK(needs_painting(context));
41 
42  SkPaint paint;
43  paint.setColorFilter(filter_);
44 
45  Layer::AutoSaveLayer save =
46  Layer::AutoSaveLayer::Create(context, paint_bounds(), &paint);
47  PaintChildren(context);
48 }
#define TRACE_EVENT0(category_group, name)
Definition: trace_event.h:90
#define FML_DCHECK(condition)
Definition: logging.h:86
bool needs_painting(PaintContext &context) const
Definition: layer.h:249
const SkRect & paint_bounds() const
Definition: layer.h:227
void PaintChildren(PaintContext &context) const
static AutoSaveLayer Create(const PaintContext &paint_context, const SkRect &bounds, const SkPaint *paint, SaveMode save_mode=SaveMode::kInternalNodesCanvas)
Definition: layer.cc:82

◆ Preroll()

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

Reimplemented from flutter::Layer.

Definition at line 31 of file color_filter_layer.cc.

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

32  {
33  Layer::AutoPrerollSaveLayerState save =
35  ContainerLayer::Preroll(context, matrix);
36 }
static AutoPrerollSaveLayerState Create(PrerollContext *preroll_context, bool save_layer_is_active=true, bool layer_itself_performs_readback=false)
Definition: layer.cc:44
void Preroll(PrerollContext *context, const SkMatrix &matrix) override

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