Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
9f44aad
Collection Need RasterCache Layer in Preroll
JsouLiang Mar 9, 2022
bb6a4cc
Collection Need RasterCache DisplayListLayer In Preroll
JsouLiang Mar 9, 2022
51ae333
Collection Need RasterCache DisplayListLayer In Preroll
JsouLiang Mar 31, 2022
bb86e3a
Differentiate RasterCacheableEntry Layer DisplayList SkPicture
JsouLiang Mar 31, 2022
98b4ad6
Collection Raster Cacheable OpacityLayer in Preroll
JsouLiang Apr 2, 2022
2a0fbc3
Add PictureLayer RasterCache
JsouLiang Apr 8, 2022
9a71e09
Use Cacheable Object to entry the layer
JsouLiang Apr 16, 2022
0f60777
Fix some failed cases; Add new test case for collect RasterCacheable …
JsouLiang Apr 16, 2022
d53733e
Fix RasterCacheDisabledWithPlatformViews test error
JsouLiang Apr 16, 2022
4600cd6
ImageFilterLayer NeedCache check filter is nullptr
JsouLiang Apr 16, 2022
7626d11
Fix the PrerollContext size is different in windows platform
JsouLiang Apr 17, 2022
d88aff2
Change the logic of raster cache entry
JsouLiang Apr 19, 2022
45b28cf
Change the Cacheable interface capacity
JsouLiang Apr 20, 2022
57a8d16
Update the LayerTree::TryToRasterCache logic; Change some comments
JsouLiang Apr 22, 2022
e4eb2a0
fix conflict
JsouLiang Apr 23, 2022
7e5af26
Add RasterCache test in Container_layer_unittest file
JsouLiang Apr 24, 2022
879ee10
If parent cached success, we will try to remove the children cache
JsouLiang Apr 26, 2022
2c038e9
Move Prepare, Touch, Draw from RasterCache to CacheableItem
JsouLiang Apr 30, 2022
829e9f4
fix shell unittest test failed
JsouLiang Apr 30, 2022
91cf4e9
Optimize structure
JsouLiang May 3, 2022
ba5694e
Change RasterCacheItem struct and fix some test cases
JsouLiang May 4, 2022
45448d4
Fix test cases
JsouLiang May 5, 2022
dc089ad
Remove the RasterCacheResult survival count
JsouLiang May 7, 2022
2f1eb2f
fix naming issues
JsouLiang May 10, 2022
473288b
Change the RasterCache of ClipLayer
JsouLiang May 17, 2022
a80a037
Fix some comments
JsouLiang May 20, 2022
fd82489
Change the licenses
JsouLiang May 20, 2022
d3883c6
fix some comments
JsouLiang Jun 13, 2022
3e1ed6c
Rebase master
JsouLiang Jun 14, 2022
a25e920
Remove redundant logic
JsouLiang Jun 15, 2022
fd3bc8e
resolve conflicting files
JsouLiang Jun 23, 2022
cdc123d
Fix comments
JsouLiang Jun 23, 2022
d8d373a
Update licenses
JsouLiang Jun 23, 2022
9e0e52b
fix the display_list_raster_item set cache entry logic
JsouLiang Jun 24, 2022
9b68847
ImageFilterLayer Reset cache_children; Fix some comments
JsouLiang Jun 27, 2022
7c7fc4c
LayerRCI use GetPaintBoundsFromLayer to paint cache
JsouLiang Jun 29, 2022
91f7278
Change lambda capture variable; fix nits
JsouLiang Jun 30, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix the display_list_raster_item set cache entry logic
  • Loading branch information
JsouLiang committed Jun 24, 2022
commit 9e0e52b6e343b01dddc9ec5531bc210426b138cb
28 changes: 17 additions & 11 deletions flow/layers/display_list_raster_cache_item.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,21 @@ void DisplayListRasterCacheItem::PrerollFinalize(PrerollContext* context,
}
auto* raster_cache = context->raster_cache;
SkRect bounds = display_list_->bounds().makeOffset(offset_.x(), offset_.y());
// If the display_list bounds and the cull_rect don't intersect then we will
// return prematurely. Another we will check the access count, if the access
// count is less than access_threshold we shouldn't cache the display_list.
if (raster_cache->MarkSeen(key_id_, transformation_matrix_) <
raster_cache->access_threshold() ||
!SkRect::Intersects(context->cull_rect, bounds)) {
cache_state_ = CacheState::kNone;
return;
// We must to create an entry whenever if the react is intersect.
// if the rect is intersect we will get the entry access_count to confirm if
// it great than the threshold. Otherwise we only increase the entry
// access_count.
if (context->cull_rect.intersect(bounds)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be "intersects"? Is this a bug? I'm curious why it never showed up anywhere. Perhaps because we don't use this cull_rect for much during preroll?

if (raster_cache->MarkSeen(key_id_, transformation_matrix_) <
raster_cache->access_threshold()) {
cache_state_ = CacheState::kNone;
return;
}
context->subtree_can_inherit_opacity = true;
cache_state_ = CacheState::kCurrent;
} else {
raster_cache->Touch(key_id_, matrix);
}
context->subtree_can_inherit_opacity = true;
cache_state_ = CacheState::kCurrent;
return;
}

Expand All @@ -129,10 +133,12 @@ bool DisplayListRasterCacheItem::Draw(const PaintContext& context,
if (!context.raster_cache || !canvas) {
return false;
}
context.raster_cache->Touch(key_id_, canvas->getTotalMatrix());
if (cache_state_ == CacheState::kCurrent) {
return context.raster_cache->Draw(key_id_, *canvas, paint);
}
// This display_list doesn't cache itself, this only increase the entry
// access_count;
context.raster_cache->Touch(key_id_, canvas->getTotalMatrix());
return false;
}

Expand Down
1 change: 0 additions & 1 deletion flow/layers/layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "third_party/skia/include/core/SkColorFilter.h"
#include "third_party/skia/include/core/SkMatrix.h"
#include "third_party/skia/include/core/SkPath.h"
#include "third_party/skia/include/core/SkPicture.h"
#include "third_party/skia/include/core/SkRRect.h"
#include "third_party/skia/include/core/SkRect.h"
#include "third_party/skia/include/utils/SkNWayCanvas.h"
Expand Down