Flutter Engine
The Flutter Engine
|
A RasterCache implementation that simulates the act of rendering a Layer or DisplayList without the overhead of rasterization or pixel storage. This implementation is used only for testing proper usage of the RasterCache in layer unit tests. More...
#include <mock_raster_cache.h>
Public Member Functions | |
MockRasterCache (size_t access_threshold=3, size_t picture_and_display_list_cache_limit_per_frame=RasterCacheUtil::kDefaultPictureAndDisplayListCacheLimitPerFrame) | |
void | AddMockLayer (int width, int height) |
void | AddMockPicture (int width, int height) |
Public Member Functions inherited from flutter::RasterCache | |
std::unique_ptr< RasterCacheResult > | Rasterize (const RasterCache::Context &context, sk_sp< const DlRTree > rtree, const std::function< void(DlCanvas *)> &draw_function, const std::function< void(DlCanvas *, const SkRect &rect)> &draw_checkerboard) const |
RasterCache (size_t access_threshold=3, size_t picture_and_display_list_cache_limit_per_frame=RasterCacheUtil::kDefaultPictureAndDisplayListCacheLimitPerFrame) | |
virtual | ~RasterCache ()=default |
bool | Draw (const RasterCacheKeyID &id, DlCanvas &canvas, const DlPaint *paint, bool preserve_rtree=false) const |
bool | HasEntry (const RasterCacheKeyID &id, const SkMatrix &) const |
void | BeginFrame () |
void | EvictUnusedCacheEntries () |
void | EndFrame () |
void | Clear () |
const RasterCacheMetrics & | picture_metrics () const |
const RasterCacheMetrics & | layer_metrics () const |
size_t | GetCachedEntriesCount () const |
size_t | GetLayerCachedEntriesCount () const |
size_t | GetPictureCachedEntriesCount () const |
size_t | EstimatePictureCacheByteSize () const |
Estimate how much memory is used by picture raster cache entries in bytes. More... | |
size_t | EstimateLayerCacheByteSize () const |
Estimate how much memory is used by layer raster cache entries in bytes. More... | |
size_t | access_threshold () const |
Return the number of frames that a picture must be prepared before it will be cached. If the number is 0, then no picture will ever be cached. More... | |
bool | GenerateNewCacheInThisFrame () const |
CacheInfo | MarkSeen (const RasterCacheKeyID &id, const SkMatrix &matrix, bool visible) const |
The entry whose RasterCacheKey is generated by RasterCacheKeyID and matrix is marked as encountered by the current frame. The entry will be created if it does not exist. Optionally the entry will be marked as visible in the current frame if the caller determines that it intersects the cull rect. The access_count of the entry will be increased if it is visible, or if it was ever visible. More... | |
int | GetAccessCount (const RasterCacheKeyID &id, const SkMatrix &matrix) const |
bool | UpdateCacheEntry (const RasterCacheKeyID &id, const Context &raster_cache_context, const std::function< void(DlCanvas *)> &render_function, sk_sp< const DlRTree > rtree=nullptr) const |
A RasterCache implementation that simulates the act of rendering a Layer or DisplayList without the overhead of rasterization or pixel storage. This implementation is used only for testing proper usage of the RasterCache in layer unit tests.
Definition at line 57 of file mock_raster_cache.h.
|
inlineexplicit |
Definition at line 59 of file mock_raster_cache.h.
Definition at line 20 of file mock_raster_cache.cc.
Definition at line 46 of file mock_raster_cache.cc.