5#include "flutter/flow/testing/mock_raster_cache.h"
7#include "flutter/flow/layers/display_list_raster_cache_item.h"
8#include "flutter/flow/layers/layer.h"
9#include "flutter/flow/raster_cache.h"
10#include "flutter/flow/raster_cache_item.h"
18 device_rect_(device_rect) {}
24 int layer_cached_threshold = 1;
27 layer.
Preroll(&preroll_context_);
40 SkRect cache_rect = RasterCacheUtil::GetDeviceBounds(
41 r_context.logical_rect, r_context.matrix);
42 return std::make_unique<MockRasterCacheResult>(cache_rect);
65 AutoCache(&display_list_item, &preroll_context_, ctm);
72 .logical_rect = display_list->bounds(),
78 SkRect cache_rect = RasterCacheUtil::GetDeviceBounds(
79 r_context.logical_rect, r_context.matrix);
80 return std::make_unique<MockRasterCacheResult>(cache_rect);
94 .raster_cache = raster_cache,
95 .gr_context =
nullptr,
96 .view_embedder =
nullptr,
97 .state_stack = state_stack,
98 .dst_color_space = srgb,
99 .surface_needs_readback =
false,
100 .raster_time = *raster_time,
102 .texture_registry =
nullptr,
103 .has_platform_view =
false,
104 .has_texture_layer =
false,
121 .state_stack = state_stack,
123 .gr_context =
nullptr,
124 .dst_color_space = srgb,
125 .view_embedder =
nullptr,
126 .raster_time = *raster_time,
128 .texture_registry =
nullptr,
129 .raster_cache = raster_cache,
143 context.raster_cache->EvictUnusedCacheEntries();
158 RasterCacheItem::CacheState::kCurrent) {
static sk_sp< SkColorSpace > MakeSRGB()
static const SkMatrix & I()
bool TryToPrepareRasterCache(const PaintContext &context, bool parent_cached=false) const override
void PrerollSetup(PrerollContext *context, const SkMatrix &matrix) override
void PrerollFinalize(PrerollContext *context, const SkMatrix &matrix) override
Developer-facing API for rendering anything within the engine.
Used for fixed refresh rate cases.
bool TryToPrepareRasterCache(const PaintContext &context, bool parent_cached=false) const override
const SkRect & paint_bounds() const
uint64_t unique_id() const
CacheState cache_state() const
size_t access_threshold() const
Return the number of frames that a picture must be prepared before it will be cached....
bool UpdateCacheEntry(const RasterCacheKeyID &id, const Context &raster_cache_context, const std::function< void(DlCanvas *)> &render_function, sk_sp< const DlRTree > rtree=nullptr) const
const LayerRasterCacheItem * raster_cache_item() const
void Preroll(PrerollContext *context) override
MockRasterCacheResult(SkRect device_rect)
void AddMockLayer(int width, int height)
void AddMockPicture(int width, int height)
#define FML_DCHECK(condition)
unsigned useCenter Optional< SkMatrix > matrix
bool RasterCacheItemTryToRasterCache(DisplayListRasterCacheItem &display_list_item, PaintContext &paint_context)
PrerollContextHolder GetSamplePrerollContextHolder(LayerStateStack &state_stack, RasterCache *raster_cache, FixedRefreshRateStopwatch *raster_time, FixedRefreshRateStopwatch *ui_time)
void RasterCacheItemPreroll(DisplayListRasterCacheItem &display_list_item, PrerollContext &context, const SkMatrix &matrix)
bool RasterCacheItemPrerollAndTryToRasterCache(DisplayListRasterCacheItem &display_list_item, PrerollContext &context, PaintContext &paint_context, const SkMatrix &matrix)
PaintContextHolder GetSamplePaintContextHolder(LayerStateStack &state_stack, RasterCache *raster_cache, FixedRefreshRateStopwatch *raster_time, FixedRefreshRateStopwatch *ui_time)
static std::vector< RasterCacheItem * > raster_cache_items_
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
sk_sp< SkColorSpace > dst_color_space
GrDirectContext * gr_context
sk_sp< SkColorSpace > dst_color_space
GrDirectContext * gr_context
PaintContext paint_context