Flutter Engine
flutter::TextureLayer Class Reference

#include <texture_layer.h>

Inheritance diagram for flutter::TextureLayer:
flutter::Layer

Public Member Functions

 TextureLayer (const SkPoint &offset, const SkSize &size, int64_t texture_id, bool freeze, SkFilterQuality filter_quality)
 
void Preroll (PrerollContext *context, const SkMatrix &matrix) override
 
void Paint (PaintContext &context) const override
 
- 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
 

Detailed Description

Definition at line 15 of file texture_layer.h.

Constructor & Destructor Documentation

◆ TextureLayer()

flutter::TextureLayer::TextureLayer ( const SkPoint &  offset,
const SkSize &  size,
int64_t  texture_id,
bool  freeze,
SkFilterQuality  filter_quality 
)

Definition at line 11 of file texture_layer.cc.

16  : offset_(offset),
17  size_(size),
18  texture_id_(texture_id),
19  freeze_(freeze),
20  filter_quality_(filter_quality) {}
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13

Member Function Documentation

◆ Paint()

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

Implements flutter::Layer.

Definition at line 33 of file texture_layer.cc.

References flutter::TextureRegistry::GetTexture(), flutter::Layer::PaintContext::gr_context, flutter::Layer::PaintContext::leaf_nodes_canvas, flutter::Layer::paint_bounds(), flutter::Layer::PaintContext::texture_registry, TRACE_EVENT0, and TRACE_EVENT_INSTANT0.

33  {
34  TRACE_EVENT0("flutter", "TextureLayer::Paint");
35 
36  std::shared_ptr<Texture> texture =
37  context.texture_registry.GetTexture(texture_id_);
38  if (!texture) {
39  TRACE_EVENT_INSTANT0("flutter", "null texture");
40  return;
41  }
42  texture->Paint(*context.leaf_nodes_canvas, paint_bounds(), freeze_,
43  context.gr_context, filter_quality_);
44 }
#define TRACE_EVENT0(category_group, name)
Definition: trace_event.h:75
#define TRACE_EVENT_INSTANT0(category_group, name)
Definition: trace_event.h:104
const SkRect & paint_bounds() const
Definition: layer.h:166

◆ Preroll()

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

Reimplemented from flutter::Layer.

Definition at line 22 of file texture_layer.cc.

References flutter::Layer::set_paint_bounds(), and TRACE_EVENT0.

22  {
23  TRACE_EVENT0("flutter", "TextureLayer::Preroll");
24 
25 #if defined(LEGACY_FUCHSIA_EMBEDDER)
26  CheckForChildLayerBelow(context);
27 #endif
28 
29  set_paint_bounds(SkRect::MakeXYWH(offset_.x(), offset_.y(), size_.width(),
30  size_.height()));
31 }
#define TRACE_EVENT0(category_group, name)
Definition: trace_event.h:75
void set_paint_bounds(const SkRect &paint_bounds)
Definition: layer.h:170

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