Commit 284a2b22 authored by xidachen's avatar xidachen Committed by Commit bot

Move part of display_compositor's interface to cc/ipc

In display_compositor, we have CompositorFrameSink and CompositorFrameSinkClient
interface. Since we already have cc/output/compositor_frame_sink class,
it makes more sense to move these two interfaces to cc/ipc.
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel

Review-Url: https://codereview.chromium.org/2344183002
Cr-Commit-Position: refs/heads/master@{#419248}
parent 17d49a70
......@@ -43,6 +43,7 @@ mojom("interfaces") {
"compositor_frame_metadata.mojom",
"filter_operation.mojom",
"filter_operations.mojom",
"mojo_compositor_frame_sink.mojom",
"quads.mojom",
"render_pass.mojom",
"render_pass_id.mojom",
......
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module cc.mojom;
import "cc/ipc/compositor_frame.mojom";
import "cc/ipc/returned_resource.mojom";
// A MojoCompositorFrameSink is an interface for receiving CompositorFrame
// structs. A CompositorFrame contains the complete output meant for display.
// Each time a client has a graphical update, and receives an OnBeginFrame, it
// is responsible for creating a CompositorFrame to update its portion of the
// screen.
interface MojoCompositorFrameSink {
// After the submitted frame is either drawn for the first time by the display
// compositor or discarded, the callback will be called. Clients should use
// this acknowledgement to ratelimit frame submissions.
// TODO(fsamuel): We should support identifying the CF in the callback.
SubmitCompositorFrame(cc.mojom.CompositorFrame frame) => ();
// Lets the display compositor know that the client wishes to receive the next
// BeginFrame event.
SetNeedsBeginFrame(bool needs_begin_frame);
// TODO(fsamuel): ReadbackBitmap API would be useful here.
};
interface MojoCompositorFrameSinkClient {
ReturnResources(array<cc.mojom.ReturnedResource> resources);
};
......@@ -20,6 +20,7 @@ source_set("display_compositor") {
deps = [
"//base",
"//cc",
"//cc/ipc:interfaces",
"//cc/surfaces",
"//cc/surfaces:surface_id",
"//services/ui/public/interfaces/gpu:interfaces",
......
......@@ -6,12 +6,12 @@
#define SERVICES_UI_GPU_DISPLAY_COMPOSITOR_COMPOSITOR_FRAME_SINK_IMPL_H_
#include "base/memory/ref_counted.h"
#include "cc/ipc/mojo_compositor_frame_sink.mojom.h"
#include "cc/scheduler/begin_frame_source.h"
#include "cc/surfaces/surface_factory.h"
#include "cc/surfaces/surface_factory_client.h"
#include "cc/surfaces/surface_id.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "services/ui/public/interfaces/gpu/display_compositor.mojom.h"
#include "services/ui/surfaces/surfaces_state.h"
namespace ui {
......@@ -22,7 +22,7 @@ class CompositorFrameSinkDelegate;
// A client presents visuals to screen by submitting CompositorFrames to a
// CompositorFrameSink.
class CompositorFrameSinkImpl : public cc::SurfaceFactoryClient,
public mojom::CompositorFrameSink,
public cc::mojom::MojoCompositorFrameSink,
public cc::BeginFrameObserver {
public:
CompositorFrameSinkImpl(
......@@ -33,7 +33,7 @@ class CompositorFrameSinkImpl : public cc::SurfaceFactoryClient,
mojom::CompositorFrameSinkClientPtr client);
~CompositorFrameSinkImpl() override;
// mojom::CompositorFrameSink implementation.
// cc::mojom::MojoCompositorFrameSink implementation.
void SetNeedsBeginFrame(bool needs_begin_frame) override;
void SubmitCompositorFrame(
cc::CompositorFrame compositor_frame,
......
......@@ -26,29 +26,6 @@ interface CompositorFrameSinkFactory {
CompositorFrameSinkClient client);
};
// A CompositorFrameSink is an interface for receiving CompositorFrame structs.
// A CompositorFrame contains the complete output meant for display. Each time a
// client has a graphical update, and receives an OnBeginFrame, it is
// responsible for creating a CompositorFrame to update its portion of the
// screen.
interface CompositorFrameSink {
// After the submitted frame is either drawn for the first time by the display
// compositor or discarded, the callback will be called. Clients should use
// this acknowledgement to ratelimit frame submissions.
// TODO(fsamuel): We should support identifying the CF in the callback.
SubmitCompositorFrame(cc.mojom.CompositorFrame frame) => ();
// Lets the display compositor know that the client wishes to receive the next
// BeginFrame event.
SetNeedsBeginFrame(bool needs_begin_frame);
// TODO(fsamuel): ReadbackBitmap API would be useful here.
};
interface CompositorFrameSinkClient {
ReturnResources(array<cc.mojom.ReturnedResource> resources);
};
// This is a public interface implemented by Display clients.
// Each client implements a single instance of the DisplayClient interface.
interface DisplayClient {
......
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