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 shell unittest test failed
  • Loading branch information
JsouLiang committed Jun 23, 2022
commit 829e9f411c3e4547bc11b32695627c5a4860ea3d
2 changes: 1 addition & 1 deletion flow/raster_cacheable_entry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ std::unique_ptr<RasterCacheResult> LayerCacheableItem::CreateRasterCache(
PaintContext context = {
// clang-format off
.internal_nodes_canvas = static_cast<SkCanvas*>(&internal_nodes_canvas),
.leaf_nodes_canvas = paint_context->leaf_nodes_canvas,
.leaf_nodes_canvas = canvas,
.gr_context = paint_context->gr_context,
.dst_color_space = paint_context->dst_color_space,
.view_embedder = paint_context->view_embedder,
Expand Down
62 changes: 32 additions & 30 deletions shell/common/shell_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2412,17 +2412,17 @@ TEST_F(ShellTest, OnServiceProtocolEstimateRasterCacheMemoryWorks) {

// 2. Rasterize the picture and the picture layer in the raster cache.
std::promise<bool> rasterized;
shell->GetTaskRunners().GetRasterTaskRunner()->PostTask([&shell, &rasterized,
&picture] {
auto* compositor_context = shell->GetRasterizer()->compositor_context();
auto& raster_cache = compositor_context->raster_cache();

FixedRefreshRateStopwatch raster_time;
FixedRefreshRateStopwatch ui_time;
MutatorsStack mutators_stack;
TextureRegistry texture_registry;
PaintContext paint_context = {
// clang-format off
shell->GetTaskRunners().GetRasterTaskRunner()->PostTask(
[&shell, &rasterized, &picture, &picture_layer] {
auto* compositor_context = shell->GetRasterizer()->compositor_context();
auto& raster_cache = compositor_context->raster_cache();

FixedRefreshRateStopwatch raster_time;
FixedRefreshRateStopwatch ui_time;
MutatorsStack mutators_stack;
TextureRegistry texture_registry;
PaintContext paint_context = {
// clang-format off
.internal_nodes_canvas = nullptr,
.leaf_nodes_canvas = nullptr,
.gr_context = nullptr,
Expand All @@ -2435,26 +2435,28 @@ TEST_F(ShellTest, OnServiceProtocolEstimateRasterCacheMemoryWorks) {
.checkerboard_offscreen_layers = false,
.frame_device_pixel_ratio = 1.0f,
.inherited_opacity = SK_Scalar1,
// clang-format on
};

// 2.1. Rasterize the picture. Call Draw multiple times to pass the
// access threshold (default to 3) so a cache can be generated.
SkCanvas dummy_canvas;
bool picture_cache_generated;
SkPictureCacheableItem cacheable_picture(
picture.get(), picture.get()->cullRect(), SkMatrix::I(), true, false);
cacheable_picture.set_matrix(SkMatrix::I());
for (int i = 0; i < 4; i += 1) {
picture_cache_generated = cacheable_picture.Prepare(&paint_context);
cacheable_picture.Draw(paint_context.raster_cache, dummy_canvas);
}
ASSERT_TRUE(picture_cache_generated);
// clang-format on
};

// 2.1. Rasterize the picture. Call Draw multiple times to pass the
// access threshold (default to 3) so a cache can be generated.
SkCanvas dummy_canvas;
bool picture_cache_generated;
SkPictureCacheableItem cacheable_picture(picture.get(),
picture.get()->cullRect(),
SkMatrix::I(), true, false);
cacheable_picture.set_matrix(SkMatrix::I());
for (int i = 0; i < 4; i += 1) {
picture_cache_generated = cacheable_picture.Prepare(&paint_context);
cacheable_picture.Draw(paint_context.raster_cache, dummy_canvas);
}
ASSERT_TRUE(picture_cache_generated);

// 2.2. Rasterize the picture layer.
cacheable_picture.Prepare(&paint_context);
rasterized.set_value(true);
});
// 2.2. Rasterize the picture layer.
LayerCacheableItem layer_item(picture_layer.get());
layer_item.Prepare(&paint_context);
rasterized.set_value(true);
});
rasterized.get_future().wait();

// 3. Call the service protocol and check its output.
Expand Down