[go: nahoru, domu]

Allow giving TransferableResource as an input for cc.

This lets LayerTreeResourceProvider accept a TransferableResource
in order to generate a ResourceId. Then, when exported as part of
a CompositorFrame, the TransferableResource is forwarded into the
CompositorFrame.

This can replace the use of TextureMailbox for passing resources
into the layer compositor for forwarding through to the display
compositor. Since the layer compositor always forwards resources,
it has no need of any other data format, and can just pass along
the TransferableResource verbatim (with a ResourceId change to
the local ResourceProvider's namespace).

Next steps from here would be to change cc clients to pass a
TransferableResource instead of a TextureMailbox through the
TextureLayer. Then remove all concept of "external" resources
in ResourceProvider, as resources usable by the ResourceProvider
client will always be "internal" in the layer compositor, and
will always be internal or delegated (soon to be always
delegated hopefully) in the display compositor.

R=piman@chromium.org

Bug: 769423
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I3d8674fbd7ab6830f52ba99c5ce4459d0c5241c8
Reviewed-on: https://chromium-review.googlesource.com/691080
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516587}
diff --git a/cc/BUILD.gn b/cc/BUILD.gn
index 3a96df7..7896441 100644
--- a/cc/BUILD.gn
+++ b/cc/BUILD.gn
@@ -632,6 +632,7 @@
     "raster/synchronous_task_graph_runner_unittest.cc",
     "raster/task_graph_work_queue_unittest.cc",
     "raster/texture_compressor_etc1_unittest.cc",
+    "resources/layer_tree_resource_provider_unittest.cc",
     "resources/resource_pool_unittest.cc",
     "resources/resource_provider_unittest.cc",
     "resources/resource_util_unittest.cc",