Flutter Engine
 
Loading...
Searching...
No Matches
flutter::RasterCacheItem Class Referenceabstract

#include <raster_cache_item.h>

Inheritance diagram for flutter::RasterCacheItem:
flutter::DisplayListRasterCacheItem flutter::LayerRasterCacheItem flutter::testing::MockLayerCacheableItem

Public Types

enum  CacheState {
  kNone = 0 ,
  kCurrent ,
  kChildren
}
 

Public Member Functions

 RasterCacheItem (RasterCacheKeyID key_id, CacheState cache_state=CacheState::kNone, unsigned child_entries=0)
 
virtual void PrerollSetup (PrerollContext *context, const DlMatrix &matrix)=0
 
virtual void PrerollFinalize (PrerollContext *context, const DlMatrix &matrix)=0
 
virtual bool Draw (const PaintContext &context, const DlPaint *paint) const =0
 
virtual bool Draw (const PaintContext &context, DlCanvas *canvas, const DlPaint *paint) const =0
 
virtual std::optional< RasterCacheKeyIDGetId () const
 
virtual bool TryToPrepareRasterCache (const PaintContext &context, bool parent_cached=false) const =0
 
unsigned child_items () const
 
void set_matrix (const DlMatrix &matrix)
 
void set_matrix (const SkMatrix &matrix)
 
CacheState cache_state () const
 
bool need_caching () const
 
virtual ~RasterCacheItem ()=default
 

Protected Attributes

RasterCacheKeyID key_id_
 
CacheState cache_state_ = CacheState::kNone
 
SkMatrix matrix_
 
unsigned child_items_
 

Detailed Description

Definition at line 27 of file raster_cache_item.h.

Member Enumeration Documentation

◆ CacheState

Enumerator
kNone 
kCurrent 
kChildren 

Definition at line 29 of file raster_cache_item.h.

Constructor & Destructor Documentation

◆ RasterCacheItem()

flutter::RasterCacheItem::RasterCacheItem ( RasterCacheKeyID  key_id,
CacheState  cache_state = CacheState::kNone,
unsigned  child_entries = 0 
)
inlineexplicit

Definition at line 35 of file raster_cache_item.h.

38 : key_id_(std::move(key_id)),
40 child_items_(child_entries) {}
CacheState cache_state() const

◆ ~RasterCacheItem()

virtual flutter::RasterCacheItem::~RasterCacheItem ( )
virtualdefault

Member Function Documentation

◆ cache_state()

CacheState flutter::RasterCacheItem::cache_state ( ) const
inline

Definition at line 65 of file raster_cache_item.h.

65{ return cache_state_; }

References cache_state_.

Referenced by flutter::testing::RasterCacheItemTryToRasterCache().

◆ child_items()

unsigned flutter::RasterCacheItem::child_items ( ) const
inline

Definition at line 60 of file raster_cache_item.h.

60{ return child_items_; }

References child_items_.

◆ Draw() [1/2]

virtual bool flutter::RasterCacheItem::Draw ( const PaintContext context,
const DlPaint paint 
) const
pure virtual

◆ Draw() [2/2]

virtual bool flutter::RasterCacheItem::Draw ( const PaintContext context,
DlCanvas canvas,
const DlPaint paint 
) const
pure virtual

◆ GetId()

virtual std::optional< RasterCacheKeyID > flutter::RasterCacheItem::GetId ( ) const
inlinevirtual

◆ need_caching()

bool flutter::RasterCacheItem::need_caching ( ) const
inline

Definition at line 67 of file raster_cache_item.h.

References cache_state_, and kNone.

Referenced by flutter::testing::TEST_F().

◆ PrerollFinalize()

virtual void flutter::RasterCacheItem::PrerollFinalize ( PrerollContext context,
const DlMatrix matrix 
)
pure virtual

◆ PrerollSetup()

virtual void flutter::RasterCacheItem::PrerollSetup ( PrerollContext context,
const DlMatrix matrix 
)
pure virtual

◆ set_matrix() [1/2]

void flutter::RasterCacheItem::set_matrix ( const DlMatrix matrix)
inline

Definition at line 62 of file raster_cache_item.h.

62{ matrix_ = ToSkMatrix(matrix); }
SkMatrix ToSkMatrix(const DlMatrix &matrix)

References matrix_, and flutter::ToSkMatrix().

Referenced by flutter::testing::TEST().

◆ set_matrix() [2/2]

void flutter::RasterCacheItem::set_matrix ( const SkMatrix &  matrix)
inline

Definition at line 63 of file raster_cache_item.h.

63{ matrix_ = matrix; }

References matrix_.

◆ TryToPrepareRasterCache()

virtual bool flutter::RasterCacheItem::TryToPrepareRasterCache ( const PaintContext context,
bool  parent_cached = false 
) const
pure virtual

Member Data Documentation

◆ cache_state_

◆ child_items_

unsigned flutter::RasterCacheItem::child_items_
protected

Definition at line 76 of file raster_cache_item.h.

Referenced by child_items().

◆ key_id_

RasterCacheKeyID flutter::RasterCacheItem::key_id_
protected

◆ matrix_

SkMatrix flutter::RasterCacheItem::matrix_
mutableprotected

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