[go: nahoru, domu]

[blimp] Add SkPicture caching support.

This CL adds support for de-duplication of SkPicture blobs across
consecutive frames.

Previously all DrawingDisplayItems and their respective SkPictures were
transferred from the engine to the client whenever the frames that
contained them was sent to the client. This lead to the same SkPictures
being sent over and over.

This CL changes this behavior so the engine can assume that the client
always keeps around the contents of the interest rect since last commit
and only sends down the new SkPictures that occur in the interest rect.

Both the engine and the client agrees on what is currently part of the
interest rect, and as such they can separately control their own caches
accordingly.

This has the benefit of sending less data from the engine to the client
whenever two consecutive frames have a lot of the same content.

This CL also creates //cc/blimp which is to be used for blimp-related
code living in //cc.

BUG=597811
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Review-Url: https://codereview.chromium.org/1982893002
Cr-Commit-Position: refs/heads/master@{#402006}
diff --git a/cc/BUILD.gn b/cc/BUILD.gn
index bd3c386..2064895 100644
--- a/cc/BUILD.gn
+++ b/cc/BUILD.gn
@@ -40,6 +40,13 @@
     "animation/transform_operation.h",
     "animation/transform_operations.cc",
     "animation/transform_operations.h",
+    "blimp/client_picture_cache.h",
+    "blimp/engine_picture_cache.h",
+    "blimp/image_serialization_processor.h",
+    "blimp/picture_data.cc",
+    "blimp/picture_data.h",
+    "blimp/picture_data_conversions.cc",
+    "blimp/picture_data_conversions.h",
     "debug/benchmark_instrumentation.cc",
     "debug/benchmark_instrumentation.h",
     "debug/debug_colors.cc",
@@ -311,7 +318,6 @@
     "proto/gfx_conversions.h",
     "proto/gpu_conversions.cc",
     "proto/gpu_conversions.h",
-    "proto/image_serialization_processor.h",
     "proto/skia_conversions.cc",
     "proto/skia_conversions.h",
     "proto/synced_property_conversions.cc",
@@ -588,8 +594,12 @@
     "test/failure_output_surface.h",
     "test/fake_channel_impl.cc",
     "test/fake_channel_impl.h",
+    "test/fake_client_picture_cache.cc",
+    "test/fake_client_picture_cache.h",
     "test/fake_content_layer_client.cc",
     "test/fake_content_layer_client.h",
+    "test/fake_engine_picture_cache.cc",
+    "test/fake_engine_picture_cache.h",
     "test/fake_external_begin_frame_source.cc",
     "test/fake_external_begin_frame_source.h",
     "test/fake_image_serialization_processor.cc",
@@ -667,6 +677,8 @@
     "test/ordered_texture_map.h",
     "test/paths.cc",
     "test/paths.h",
+    "test/picture_cache_model.cc",
+    "test/picture_cache_model.h",
     "test/pixel_comparator.cc",
     "test/pixel_comparator.h",
     "test/pixel_test.cc",
@@ -792,6 +804,7 @@
     "base/simple_enclosed_region_unittest.cc",
     "base/tiling_data_unittest.cc",
     "base/unique_notifier_unittest.cc",
+    "blimp/picture_data_conversions_unittest.cc",
     "debug/layer_tree_debug_state_unittest.cc",
     "debug/micro_benchmark_controller_unittest.cc",
     "debug/rendering_stats_unittest.cc",