Flutter Engine
flutter::RasterCache Class Reference

#include <raster_cache.h>

Inheritance diagram for flutter::RasterCache:
flutter::testing::MockRasterCache

Public Member Functions

 RasterCache (size_t access_threshold=3, size_t picture_and_display_list_cache_limit_per_frame=kDefaultPictureAndDispLayListCacheLimitPerFrame)
 
virtual ~RasterCache ()=default
 
virtual std::unique_ptr< RasterCacheResultRasterizePicture (SkPicture *picture, GrDirectContext *context, const SkMatrix &ctm, SkColorSpace *dst_color_space, bool checkerboard) const
 Rasterize a picture object and produce a RasterCacheResult to be stored in the cache. More...
 
virtual std::unique_ptr< RasterCacheResultRasterizeDisplayList (DisplayList *display_list, GrDirectContext *context, const SkMatrix &ctm, SkColorSpace *dst_color_space, bool checkerboard) const
 
virtual std::unique_ptr< RasterCacheResultRasterizeLayer (PrerollContext *context, Layer *layer, const SkMatrix &ctm, bool checkerboard) const
 Rasterize an engine Layer and produce a RasterCacheResult to be stored in the cache. More...
 
bool Prepare (PrerollContext *context, SkPicture *picture, bool is_complex, bool will_change, const SkMatrix &untranslated_matrix, const SkPoint &offset=SkPoint())
 
bool Prepare (PrerollContext *context, DisplayList *display_list, bool is_complex, bool will_change, const SkMatrix &untranslated_matrix, const SkPoint &offset=SkPoint())
 
void Prepare (PrerollContext *context, Layer *layer, const SkMatrix &ctm)
 
bool Draw (const SkPicture &picture, SkCanvas &canvas) const
 
bool Draw (const DisplayList &display_list, SkCanvas &canvas) const
 
bool Draw (const Layer *layer, SkCanvas &canvas, SkPaint *paint=nullptr) const
 
void SweepAfterFrame ()
 
void Clear ()
 
void SetCheckboardCacheImages (bool checkerboard)
 
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, including cache entries in the SkPicture cache and the DisplayList cache. More...
 
size_t EstimateLayerCacheByteSize () const
 Estimate how much memory is used by layer raster cache entries in bytes. More...
 
int sweep_count () const
 Return the count of cache sweeps that have occured. More...
 
int 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...
 

Static Public Member Functions

static SkIRect GetDeviceBounds (const SkRect &rect, const SkMatrix &ctm)
 
static SkMatrix GetIntegralTransCTM (const SkMatrix &ctm)
 Snap the translation components of the matrix to integers. More...
 

Static Public Attributes

static constexpr int kDefaultPictureAndDispLayListCacheLimitPerFrame = 3
 

Detailed Description

Definition at line 43 of file raster_cache.h.

Constructor & Destructor Documentation

◆ RasterCache()

flutter::RasterCache::RasterCache ( size_t  access_threshold = 3,
size_t  picture_and_display_list_cache_limit_per_frame = kDefaultPictureAndDispLayListCacheLimitPerFrame 
)
explicit

Definition at line 39 of file raster_cache.cc.

41  : access_threshold_(access_threshold),
42  picture_and_display_list_cache_limit_per_frame_(
43  picture_and_display_list_cache_limit_per_frame),
44  checkerboard_images_(false) {}
int 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.
Definition: raster_cache.h:227

◆ ~RasterCache()

virtual flutter::RasterCache::~RasterCache ( )
virtualdefault

Member Function Documentation

◆ access_threshold()

int flutter::RasterCache::access_threshold ( ) const
inline

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.

If the number is one, then it must be prepared and drawn on 1 frame and it will then be cached on the next frame if it is prepared.

Definition at line 227 of file raster_cache.h.

References FML_DISALLOW_COPY_AND_ASSIGN.

227 { return access_threshold_; }

◆ Clear()

void flutter::RasterCache::Clear ( )

Definition at line 389 of file raster_cache.cc.

Referenced by SetCheckboardCacheImages().

389  {
390  picture_cache_.clear();
391  display_list_cache_.clear();
392  layer_cache_.clear();
393 }

◆ Draw() [1/3]

bool flutter::RasterCache::Draw ( const SkPicture &  picture,
SkCanvas &  canvas 
) const

Definition at line 318 of file raster_cache.cc.

Referenced by flutter::ImageFilterLayer::Paint(), flutter::PictureLayer::Paint(), flutter::OpacityLayer::Paint(), flutter::DisplayListLayer::Paint(), and flutter::testing::TEST().

318  {
319  PictureRasterCacheKey cache_key(picture.uniqueID(), canvas.getTotalMatrix());
320  auto it = picture_cache_.find(cache_key);
321  if (it == picture_cache_.end()) {
322  return false;
323  }
324 
325  Entry& entry = it->second;
326  entry.access_count++;
327  entry.used_this_frame = true;
328 
329  if (entry.image) {
330  entry.image->draw(canvas, nullptr);
331  return true;
332  }
333 
334  return false;
335 }
RasterCacheKey< uint32_t > PictureRasterCacheKey

◆ Draw() [2/3]

bool flutter::RasterCache::Draw ( const DisplayList display_list,
SkCanvas &  canvas 
) const

Definition at line 337 of file raster_cache.cc.

References flutter::DisplayList::unique_id().

338  {
339  DisplayListRasterCacheKey cache_key(display_list.unique_id(),
340  canvas.getTotalMatrix());
341  auto it = display_list_cache_.find(cache_key);
342  if (it == display_list_cache_.end()) {
343  return false;
344  }
345 
346  Entry& entry = it->second;
347  entry.access_count++;
348  entry.used_this_frame = true;
349 
350  if (entry.image) {
351  entry.image->draw(canvas, nullptr);
352  return true;
353  }
354 
355  return false;
356 }
RasterCacheKey< uint32_t > DisplayListRasterCacheKey

◆ Draw() [3/3]

bool flutter::RasterCache::Draw ( const Layer layer,
SkCanvas &  canvas,
SkPaint *  paint = nullptr 
) const

Definition at line 358 of file raster_cache.cc.

References flutter::Layer::unique_id().

360  {
361  LayerRasterCacheKey cache_key(layer->unique_id(), canvas.getTotalMatrix());
362  auto it = layer_cache_.find(cache_key);
363  if (it == layer_cache_.end()) {
364  return false;
365  }
366 
367  Entry& entry = it->second;
368  entry.access_count++;
369  entry.used_this_frame = true;
370 
371  if (entry.image) {
372  entry.image->draw(canvas, paint);
373  return true;
374  }
375 
376  return false;
377 }
RasterCacheKey< uint64_t > LayerRasterCacheKey

◆ EstimateLayerCacheByteSize()

size_t flutter::RasterCache::EstimateLayerCacheByteSize ( ) const

Estimate how much memory is used by layer raster cache entries in bytes.

Only SkImage's memory usage is counted as other objects are often much smaller compared to SkImage. SkImageInfo::computeMinByteSize is used to estimate the SkImage memory usage.

Definition at line 433 of file raster_cache.cc.

Referenced by flutter::FrameTimingsRecorder::RecordRasterEnd(), SetCheckboardCacheImages(), and flutter::testing::TEST().

433  {
434  size_t layer_cache_bytes = 0;
435  for (const auto& item : layer_cache_) {
436  if (item.second.image) {
437  layer_cache_bytes += item.second.image->image_bytes();
438  }
439  }
440  return layer_cache_bytes;
441 }

◆ EstimatePictureCacheByteSize()

size_t flutter::RasterCache::EstimatePictureCacheByteSize ( ) const

Estimate how much memory is used by picture raster cache entries in bytes, including cache entries in the SkPicture cache and the DisplayList cache.

Only SkImage's memory usage is counted as other objects are often much smaller compared to SkImage. SkImageInfo::computeMinByteSize is used to estimate the SkImage memory usage.

Definition at line 443 of file raster_cache.cc.

Referenced by flutter::FrameTimingsRecorder::RecordRasterEnd(), SetCheckboardCacheImages(), and flutter::testing::TEST().

443  {
444  size_t picture_cache_bytes = 0;
445  for (const auto& item : picture_cache_) {
446  if (item.second.image) {
447  picture_cache_bytes += item.second.image->image_bytes();
448  }
449  }
450  for (const auto& item : display_list_cache_) {
451  if (item.second.image) {
452  picture_cache_bytes += item.second.image->image_bytes();
453  }
454  }
455  return picture_cache_bytes;
456 }

◆ GetCachedEntriesCount()

size_t flutter::RasterCache::GetCachedEntriesCount ( ) const

Definition at line 395 of file raster_cache.cc.

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

395  {
396  return layer_cache_.size() + picture_cache_.size() +
397  display_list_cache_.size();
398 }

◆ GetDeviceBounds()

static SkIRect flutter::RasterCache::GetDeviceBounds ( const SkRect &  rect,
const SkMatrix &  ctm 
)
inlinestatic

Definition at line 105 of file raster_cache.h.

Referenced by flutter::RasterCacheResult::draw(), flutter::Rasterize(), flutter::testing::MockRasterCache::RasterizeLayer(), and flutter::testing::MockRasterCache::RasterizePicture().

105  {
106  SkRect device_rect;
107  ctm.mapRect(&device_rect, rect);
108  SkIRect bounds;
109  device_rect.roundOut(&bounds);
110  return bounds;
111  }

◆ GetIntegralTransCTM()

static SkMatrix flutter::RasterCache::GetIntegralTransCTM ( const SkMatrix &  ctm)
inlinestatic

Snap the translation components of the matrix to integers.

The snapping will only happen if the matrix only has scale and translation transformations.

Parameters
ctmthe current transformation matrix.
Returns
SkMatrix the snapped transformation matrix.

Definition at line 122 of file raster_cache.h.

References result.

Referenced by flutter::DisplayListLayer::DisplayListLayer(), flutter::OpacityLayer::OpacityLayer(), flutter::PictureLayer::Paint(), flutter::OpacityLayer::Paint(), flutter::DisplayListLayer::Paint(), flutter::PictureLayer::PictureLayer(), Prepare(), flutter::OpacityLayer::Preroll(), and flutter::testing::TEST_F().

122  {
123  // Avoid integral snapping if the matrix has complex transformation to avoid
124  // the artifact observed in https://github.com/flutter/flutter/issues/41654.
125  if (!ctm.isScaleTranslate()) {
126  return ctm;
127  }
128  SkMatrix result = ctm;
129  result[SkMatrix::kMTransX] = SkScalarRoundToScalar(ctm.getTranslateX());
130  result[SkMatrix::kMTransY] = SkScalarRoundToScalar(ctm.getTranslateY());
131  return result;
132  }
GAsyncResult * result

◆ GetLayerCachedEntriesCount()

size_t flutter::RasterCache::GetLayerCachedEntriesCount ( ) const

Definition at line 400 of file raster_cache.cc.

Referenced by flutter::FrameTimingsRecorder::RecordRasterEnd(), and SetCheckboardCacheImages().

400  {
401  return layer_cache_.size();
402 }

◆ GetPictureCachedEntriesCount()

size_t flutter::RasterCache::GetPictureCachedEntriesCount ( ) const

Definition at line 404 of file raster_cache.cc.

Referenced by flutter::FrameTimingsRecorder::RecordRasterEnd(), and SetCheckboardCacheImages().

404  {
405  return picture_cache_.size() + display_list_cache_.size();
406 }

◆ Prepare() [1/3]

bool flutter::RasterCache::Prepare ( PrerollContext context,
SkPicture *  picture,
bool  is_complex,
bool  will_change,
const SkMatrix &  untranslated_matrix,
const SkPoint &  offset = SkPoint() 
)

Definition at line 215 of file raster_cache.cc.

References flutter::PrerollContext::dst_color_space, GetIntegralTransCTM(), flutter::PrerollContext::gr_context, flutter::IsPictureWorthRasterizing(), flutter::MatrixDecomposition::IsValid(), and RasterizePicture().

Referenced by flutter::testing::TEST(), and flutter::ContainerLayer::TryToPrepareRasterCache().

220  {
221  if (!GenerateNewCacheInThisFrame()) {
222  return false;
223  }
224 
225  if (!IsPictureWorthRasterizing(picture, will_change, is_complex)) {
226  // We only deal with pictures that are worthy of rasterization.
227  return false;
228  }
229 
230  SkMatrix transformation_matrix = untranslated_matrix;
231  transformation_matrix.preTranslate(offset.x(), offset.y());
232 
233  // Decompose the matrix (once) for all subsequent operations. We want to make
234  // sure to avoid volumetric distortions while accounting for scaling.
235  const MatrixDecomposition matrix(transformation_matrix);
236 
237  if (!matrix.IsValid()) {
238  // The matrix was singular. No point in going further.
239  return false;
240  }
241 
242  PictureRasterCacheKey cache_key(picture->uniqueID(), transformation_matrix);
243 
244  // Creates an entry, if not present prior.
245  Entry& entry = picture_cache_[cache_key];
246  if (entry.access_count < access_threshold_) {
247  // Frame threshold has not yet been reached.
248  return false;
249  }
250 
251  if (!entry.image) {
252  // GetIntegralTransCTM effect for matrix which only contains scale,
253  // translate, so it won't affect result of matrix decomposition and cache
254  // key.
255 #ifndef SUPPORT_FRACTIONAL_TRANSLATION
256  transformation_matrix = GetIntegralTransCTM(transformation_matrix);
257 #endif
258  entry.image =
259  RasterizePicture(picture, context->gr_context, transformation_matrix,
260  context->dst_color_space, checkerboard_images_);
261  picture_cached_this_frame_++;
262  }
263  return true;
264 }
virtual std::unique_ptr< RasterCacheResult > RasterizePicture(SkPicture *picture, GrDirectContext *context, const SkMatrix &ctm, SkColorSpace *dst_color_space, bool checkerboard) const
Rasterize a picture object and produce a RasterCacheResult to be stored in the cache.
static bool IsPictureWorthRasterizing(SkPicture *picture, bool will_change, bool is_complex)
Definition: raster_cache.cc:61
RasterCacheKey< uint32_t > PictureRasterCacheKey
static SkMatrix GetIntegralTransCTM(const SkMatrix &ctm)
Snap the translation components of the matrix to integers.
Definition: raster_cache.h:122

◆ Prepare() [2/3]

bool flutter::RasterCache::Prepare ( PrerollContext context,
DisplayList display_list,
bool  is_complex,
bool  will_change,
const SkMatrix &  untranslated_matrix,
const SkPoint &  offset = SkPoint() 
)

Definition at line 266 of file raster_cache.cc.

References flutter::PrerollContext::dst_color_space, GetIntegralTransCTM(), flutter::PrerollContext::gr_context, flutter::IsDisplayListWorthRasterizing(), flutter::MatrixDecomposition::IsValid(), RasterizeDisplayList(), and flutter::DisplayList::unique_id().

271  {
272  if (!GenerateNewCacheInThisFrame()) {
273  return false;
274  }
275 
276  if (!IsDisplayListWorthRasterizing(display_list, will_change, is_complex)) {
277  // We only deal with display lists that are worthy of rasterization.
278  return false;
279  }
280 
281  SkMatrix transformation_matrix = untranslated_matrix;
282  transformation_matrix.preTranslate(offset.x(), offset.y());
283 
284  // Decompose the matrix (once) for all subsequent operations. We want to make
285  // sure to avoid volumetric distortions while accounting for scaling.
286  const MatrixDecomposition matrix(transformation_matrix);
287 
288  if (!matrix.IsValid()) {
289  // The matrix was singular. No point in going further.
290  return false;
291  }
292 
293  DisplayListRasterCacheKey cache_key(display_list->unique_id(),
294  transformation_matrix);
295 
296  // Creates an entry, if not present prior.
297  Entry& entry = display_list_cache_[cache_key];
298  if (entry.access_count < access_threshold_) {
299  // Frame threshold has not yet been reached.
300  return false;
301  }
302 
303  if (!entry.image) {
304  // GetIntegralTransCTM effect for matrix which only contains scale,
305  // translate, so it won't affect result of matrix decomposition and cache
306  // key.
307 #ifndef SUPPORT_FRACTIONAL_TRANSLATION
308  transformation_matrix = GetIntegralTransCTM(transformation_matrix);
309 #endif
310  entry.image = RasterizeDisplayList(
311  display_list, context->gr_context, transformation_matrix,
312  context->dst_color_space, checkerboard_images_);
313  display_list_cached_this_frame_++;
314  }
315  return true;
316 }
static bool IsDisplayListWorthRasterizing(DisplayList *display_list, bool will_change, bool is_complex)
Definition: raster_cache.cc:87
static SkMatrix GetIntegralTransCTM(const SkMatrix &ctm)
Snap the translation components of the matrix to integers.
Definition: raster_cache.h:122
RasterCacheKey< uint32_t > DisplayListRasterCacheKey
virtual std::unique_ptr< RasterCacheResult > RasterizeDisplayList(DisplayList *display_list, GrDirectContext *context, const SkMatrix &ctm, SkColorSpace *dst_color_space, bool checkerboard) const

◆ Prepare() [3/3]

void flutter::RasterCache::Prepare ( PrerollContext context,
Layer layer,
const SkMatrix &  ctm 
)

Definition at line 172 of file raster_cache.cc.

References RasterizeLayer(), and flutter::Layer::unique_id().

174  {
175  LayerRasterCacheKey cache_key(layer->unique_id(), ctm);
176  Entry& entry = layer_cache_[cache_key];
177  entry.access_count++;
178  entry.used_this_frame = true;
179  if (!entry.image) {
180  entry.image = RasterizeLayer(context, layer, ctm, checkerboard_images_);
181  }
182 }
virtual std::unique_ptr< RasterCacheResult > RasterizeLayer(PrerollContext *context, Layer *layer, const SkMatrix &ctm, bool checkerboard) const
Rasterize an engine Layer and produce a RasterCacheResult to be stored in the cache.
RasterCacheKey< uint64_t > LayerRasterCacheKey

◆ RasterizeDisplayList()

std::unique_ptr< RasterCacheResult > flutter::RasterCache::RasterizeDisplayList ( DisplayList display_list,
GrDirectContext *  context,
const SkMatrix &  ctm,
SkColorSpace *  dst_color_space,
bool  checkerboard 
) const
virtual

Definition at line 161 of file raster_cache.cc.

References flutter::DisplayList::bounds(), flutter::Rasterize(), and flutter::DisplayList::RenderTo().

Referenced by Prepare().

166  {
167  return Rasterize(context, ctm, dst_color_space, checkerboard,
168  display_list->bounds(),
169  [=](SkCanvas* canvas) { display_list->RenderTo(canvas); });
170 }
static std::unique_ptr< RasterCacheResult > Rasterize(GrDirectContext *context, const SkMatrix &ctm, SkColorSpace *dst_color_space, bool checkerboard, const SkRect &logical_rect, const std::function< void(SkCanvas *)> &draw_function)

◆ RasterizeLayer()

std::unique_ptr< RasterCacheResult > flutter::RasterCache::RasterizeLayer ( PrerollContext context,
Layer layer,
const SkMatrix &  ctm,
bool  checkerboard 
) const
virtual

Rasterize an engine Layer and produce a RasterCacheResult to be stored in the cache.

Parameters
contextthe PrerollContext containing important information needed for rendering a layer.
layerthe Layer object to be cached.
ctmthe transformation matrix used for rendering.
checkerboarda flag indicating whether or not a checkerboard pattern should be rendered into the cached image for debug analysis
Returns
a RasterCacheResult that can draw the rendered layer into the destination using a simple image blit

Reimplemented in flutter::testing::MockRasterCache.

Definition at line 184 of file raster_cache.cc.

References flutter::PrerollContext::checkerboard_offscreen_layers, flutter::PrerollContext::dst_color_space, flutter::PrerollContext::frame_device_pixel_ratio, flutter::PrerollContext::gr_context, flutter::PrerollContext::has_platform_view, flutter::Layer::needs_painting(), flutter::Layer::Paint(), flutter::Layer::paint_bounds(), flutter::PrerollContext::raster_cache, flutter::PrerollContext::raster_time, flutter::Rasterize(), flutter::PrerollContext::texture_registry, and flutter::PrerollContext::ui_time.

Referenced by Prepare().

188  {
189  return Rasterize(
190  context->gr_context, ctm, context->dst_color_space, checkerboard,
191  layer->paint_bounds(), [layer, context](SkCanvas* canvas) {
192  SkISize canvas_size = canvas->getBaseLayerSize();
193  SkNWayCanvas internal_nodes_canvas(canvas_size.width(),
194  canvas_size.height());
195  internal_nodes_canvas.setMatrix(canvas->getTotalMatrix());
196  internal_nodes_canvas.addCanvas(canvas);
197  Layer::PaintContext paintContext = {
198  /* internal_nodes_canvas= */ static_cast<SkCanvas*>(
199  &internal_nodes_canvas),
200  /* leaf_nodes_canvas= */ canvas,
201  /* gr_context= */ context->gr_context,
202  /* view_embedder= */ nullptr,
203  context->raster_time,
204  context->ui_time,
205  context->texture_registry,
206  context->has_platform_view ? nullptr : context->raster_cache,
207  context->checkerboard_offscreen_layers,
208  context->frame_device_pixel_ratio};
209  if (layer->needs_painting(paintContext)) {
210  layer->Paint(paintContext);
211  }
212  });
213 }
static std::unique_ptr< RasterCacheResult > Rasterize(GrDirectContext *context, const SkMatrix &ctm, SkColorSpace *dst_color_space, bool checkerboard, const SkRect &logical_rect, const std::function< void(SkCanvas *)> &draw_function)

◆ RasterizePicture()

std::unique_ptr< RasterCacheResult > flutter::RasterCache::RasterizePicture ( SkPicture *  picture,
GrDirectContext *  context,
const SkMatrix &  ctm,
SkColorSpace *  dst_color_space,
bool  checkerboard 
) const
virtual

Rasterize a picture object and produce a RasterCacheResult to be stored in the cache.

Parameters
picturethe SkPicture object to be cached.
contextthe GrDirectContext used for rendering.
ctmthe transformation matrix used for rendering.
dst_color_spacethe destination color space that the cached rendering will be drawn into
checkerboarda flag indicating whether or not a checkerboard pattern should be rendered into the cached image for debug analysis
Returns
a RasterCacheResult that can draw the rendered picture into the destination using a simple image blit

Reimplemented in flutter::testing::MockRasterCache.

Definition at line 150 of file raster_cache.cc.

References flutter::Rasterize().

Referenced by Prepare().

155  {
156  return Rasterize(context, ctm, dst_color_space, checkerboard,
157  picture->cullRect(),
158  [=](SkCanvas* canvas) { canvas->drawPicture(picture); });
159 }
static std::unique_ptr< RasterCacheResult > Rasterize(GrDirectContext *context, const SkMatrix &ctm, SkColorSpace *dst_color_space, bool checkerboard, const SkRect &logical_rect, const std::function< void(SkCanvas *)> &draw_function)

◆ SetCheckboardCacheImages()

void flutter::RasterCache::SetCheckboardCacheImages ( bool  checkerboard)

Definition at line 408 of file raster_cache.cc.

References Clear(), EstimateLayerCacheByteSize(), EstimatePictureCacheByteSize(), FML_TRACE_COUNTER, GetLayerCachedEntriesCount(), GetPictureCachedEntriesCount(), and flutter::kMegaByteSizeInBytes.

Referenced by flutter::LayerTree::Preroll().

408  {
409  if (checkerboard_images_ == checkerboard) {
410  return;
411  }
412 
413  checkerboard_images_ = checkerboard;
414 
415  // Clear all existing entries so previously rasterized items (with or without
416  // a checkerboard) will be refreshed in subsequent passes.
417  Clear();
418 }

◆ sweep_count()

int flutter::RasterCache::sweep_count ( ) const
inline

Return the count of cache sweeps that have occured.

The sweep count will help to determine if a sweep of the cache may have removed expired entries since the last time the method was called. The count will increment even if the sweep performs no evictions.

Definition at line 217 of file raster_cache.h.

Referenced by flutter::FrameTimingsRecorder::RecordRasterEnd(), and flutter::FrameTimingsRecorder::RecordRasterStart().

217 { return sweep_count_; }

◆ SweepAfterFrame()

void flutter::RasterCache::SweepAfterFrame ( )

Definition at line 379 of file raster_cache.cc.

Referenced by flutter::CompositorContext::CompositorContext(), and flutter::testing::TEST().

379  {
380  TraceStatsToTimeline();
381  SweepOneCacheAfterFrame(picture_cache_);
382  SweepOneCacheAfterFrame(display_list_cache_);
383  SweepOneCacheAfterFrame(layer_cache_);
384  picture_cached_this_frame_ = 0;
385  display_list_cached_this_frame_ = 0;
386  sweep_count_++;
387 }

Member Data Documentation

◆ kDefaultPictureAndDispLayListCacheLimitPerFrame

constexpr int flutter::RasterCache::kDefaultPictureAndDispLayListCacheLimitPerFrame = 3
static

Definition at line 49 of file raster_cache.h.


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