Commit 114d87bd authored by Fernando Serboncini's avatar Fernando Serboncini Committed by Commit Bot

Create a single IPC call for OffscreenCanvasProvider

For BeginFrameProvider, we don't need the multi-call location.
Hence, we can remove one IPC call from the process.

Bug: 833902
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Id360cd544cfdb6c583f408b083850b30990f4231
Reviewed-on: https://chromium-review.googlesource.com/1032798Reviewed-by: default avatarJustin Novosad <junov@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarOlivia Lai <xlai@chromium.org>
Commit-Queue: Fernando Serboncini <fserb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554829}
parent a6889a09
......@@ -66,6 +66,18 @@ void OffscreenCanvasProviderImpl::CreateCompositorFrameSink(
std::move(request));
}
void OffscreenCanvasProviderImpl::CreateSimpleCompositorFrameSink(
const viz::FrameSinkId& parent_frame_sink_id,
const viz::FrameSinkId& frame_sink_id,
blink::mojom::OffscreenCanvasSurfaceClientPtr surface_client,
viz::mojom::CompositorFrameSinkClientPtr client,
viz::mojom::CompositorFrameSinkRequest request) {
CreateOffscreenCanvasSurface(parent_frame_sink_id, frame_sink_id,
std::move(surface_client));
CreateCompositorFrameSink(frame_sink_id, std::move(client),
std::move(request));
}
void OffscreenCanvasProviderImpl::DestroyOffscreenCanvasSurface(
viz::FrameSinkId frame_sink_id) {
canvas_map_.erase(frame_sink_id);
......
......@@ -41,6 +41,12 @@ class CONTENT_EXPORT OffscreenCanvasProviderImpl
const viz::FrameSinkId& frame_sink_id,
viz::mojom::CompositorFrameSinkClientPtr client,
viz::mojom::CompositorFrameSinkRequest request) override;
void CreateSimpleCompositorFrameSink(
const viz::FrameSinkId& parent_frame_sink_id,
const viz::FrameSinkId& frame_sink_id,
blink::mojom::OffscreenCanvasSurfaceClientPtr surface_client,
viz::mojom::CompositorFrameSinkClientPtr client,
viz::mojom::CompositorFrameSinkRequest request) override;
private:
friend class OffscreenCanvasProviderImplTest;
......
......@@ -27,4 +27,12 @@ interface OffscreenCanvasProvider {
CreateCompositorFrameSink(viz.mojom.FrameSinkId frame_sink_id,
viz.mojom.CompositorFrameSinkClient client,
viz.mojom.CompositorFrameSink& sink);
// Ceate CompositorFrameSink directly in a single call (instead of going
// through both function above).
CreateSimpleCompositorFrameSink(viz.mojom.FrameSinkId parent_frame_sink_id,
viz.mojom.FrameSinkId frame_sink_id,
OffscreenCanvasSurfaceClient surface_client,
viz.mojom.CompositorFrameSinkClient client,
viz.mojom.CompositorFrameSink& sink);
};
......@@ -37,15 +37,12 @@ void BeginFrameProvider::CreateCompositorFrameSink() {
mojom::blink::OffscreenCanvasSurfaceClientPtr ocs_client;
ocs_binding_.Bind(mojo::MakeRequest(&ocs_client), task_runner);
canvas_provider->CreateOffscreenCanvasSurface(
parent_frame_sink_id_, frame_sink_id_, std::move(ocs_client));
viz::mojom::blink::CompositorFrameSinkClientPtr client;
cfs_binding_.Bind(mojo::MakeRequest(&client), task_runner);
canvas_provider->CreateCompositorFrameSink(
frame_sink_id_, std::move(client),
mojo::MakeRequest(&compositor_frame_sink_));
canvas_provider->CreateSimpleCompositorFrameSink(
parent_frame_sink_id_, frame_sink_id_, std::move(ocs_client),
std::move(client), mojo::MakeRequest(&compositor_frame_sink_));
}
void BeginFrameProvider::RequestBeginFrame() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment