11#include "include/core/SkMatrix.h"
18 device_rect_(device_rect) {}
21 SkMatrix ctm = SkMatrix::I();
23 int layer_cached_threshold = 1;
26 layer.
Preroll(&preroll_context_);
39 SkRect cache_rect = RasterCacheUtil::GetDeviceBounds(
40 r_context.logical_rect, r_context.matrix);
41 return std::make_unique<MockRasterCacheResult>(cache_rect);
47 SkMatrix ctm = SkMatrix::I();
50 sk_sp<DisplayList> display_list = builder.
Build();
69 .logical_rect =
ToSkRect(display_list->GetBounds()),
75 SkRect cache_rect = RasterCacheUtil::GetDeviceBounds(
76 r_context.logical_rect, r_context.matrix);
77 return std::make_unique<MockRasterCacheResult>(cache_rect);
86 sk_sp<SkColorSpace> srgb = SkColorSpace::MakeSRGB();
91 .raster_cache = raster_cache,
92 .gr_context =
nullptr,
93 .view_embedder =
nullptr,
94 .state_stack = state_stack,
95 .dst_color_space = srgb,
96 .surface_needs_readback =
false,
97 .raster_time = *raster_time,
99 .texture_registry =
nullptr,
100 .has_platform_view =
false,
101 .has_texture_layer =
false,
115 sk_sp<SkColorSpace> srgb = SkColorSpace::MakeSRGB();
118 .state_stack = state_stack,
120 .gr_context =
nullptr,
121 .dst_color_space = srgb,
122 .view_embedder =
nullptr,
123 .raster_time = *raster_time,
125 .texture_registry =
nullptr,
126 .raster_cache = raster_cache,
140 context.raster_cache->EvictUnusedCacheEntries();
sk_sp< DisplayList > Build()
void DrawPath(const DlPath &path, const DlPaint &paint) override
void PrerollSetup(PrerollContext *context, const DlMatrix &matrix) override
void PrerollFinalize(PrerollContext *context, const DlMatrix &matrix) override
bool TryToPrepareRasterCache(const PaintContext &context, bool parent_cached=false) const override
Developer-facing API for rendering anything within the engine.
static DlPath MakeRectLTRB(DlScalar left, DlScalar top, DlScalar right, DlScalar bottom)
static DlPath MakeRectXYWH(DlScalar x, DlScalar y, DlScalar width, DlScalar height)
Used for fixed refresh rate cases.
const DlRect & paint_bounds() const
uint64_t unique_id() const
bool TryToPrepareRasterCache(const PaintContext &context, bool parent_cached=false) const override
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
CacheState cache_state() const
const LayerRasterCacheItem * raster_cache_item() const
void Preroll(PrerollContext *context) override
void AddMockLayer(int width, int height)
void AddMockPicture(int width, int height)
MockRasterCacheResult(SkRect device_rect)
#define FML_DCHECK(condition)
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 DlMatrix &matrix)
PaintContextHolder GetSamplePaintContextHolder(LayerStateStack &state_stack, RasterCache *raster_cache, FixedRefreshRateStopwatch *raster_time, FixedRefreshRateStopwatch *ui_time)
bool RasterCacheItemPrerollAndTryToRasterCache(DisplayListRasterCacheItem &display_list_item, PrerollContext &context, PaintContext &paint_context, const DlMatrix &matrix)
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
DlMatrix ToDlMatrix(const SkMatrix &matrix)
const SkRect & ToSkRect(const DlRect &rect)
sk_sp< SkColorSpace > dst_color_space
GrDirectContext * gr_context
sk_sp< SkColorSpace > dst_color_space
GrDirectContext * gr_context
PaintContext paint_context
A 4x4 matrix using column-major storage.
static constexpr TRect MakeLTRB(Type left, Type top, Type right, Type bottom)