Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Side by Side Diff: cc/ipc/mojo_compositor_frame_sink.mojom

Issue 2544103002: Added MojoCompositorFrameSink::EvictFrame() and MojoCompositorFrameSinkClient::WillDrawSurface() (Closed)
Patch Set: Addressed a comment Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 module cc.mojom; 5 module cc.mojom;
6 6
7 import "cc/ipc/begin_frame_args.mojom"; 7 import "cc/ipc/begin_frame_args.mojom";
8 import "cc/ipc/compositor_frame.mojom"; 8 import "cc/ipc/compositor_frame.mojom";
9 import "cc/ipc/frame_sink_id.mojom"; 9 import "cc/ipc/frame_sink_id.mojom";
10 import "cc/ipc/local_frame_id.mojom"; 10 import "cc/ipc/local_frame_id.mojom";
(...skipping 13 matching lines...) Expand all
24 // to screen the next time frames from all CompositorFrameSinks are aggregated 24 // to screen the next time frames from all CompositorFrameSinks are aggregated
25 // to produce a display CompositorFrame. If a client wishes to allocate a new 25 // to produce a display CompositorFrame. If a client wishes to allocate a new
26 // surface (e.g. during resize), then it can simply allocate a new 26 // surface (e.g. during resize), then it can simply allocate a new
27 // |local_frame_id|. 27 // |local_frame_id|.
28 // For successful swaps, the implementation must call 28 // For successful swaps, the implementation must call
29 // DidReceiveCompositorFrameAck() asynchronously when the frame has been 29 // DidReceiveCompositorFrameAck() asynchronously when the frame has been
30 // processed in order to unthrottle the next frame. 30 // processed in order to unthrottle the next frame.
31 SubmitCompositorFrame(cc.mojom.LocalFrameId local_frame_id, 31 SubmitCompositorFrame(cc.mojom.LocalFrameId local_frame_id,
32 cc.mojom.CompositorFrame frame); 32 cc.mojom.CompositorFrame frame);
33 33
34 // Notify that the surface is no longer in use (and is okay to be evicted) so
35 // that its resources gets returned in time.
36 EvictFrame();
37
34 // TODO(fsamuel): ReadbackBitmap API would be useful here. 38 // TODO(fsamuel): ReadbackBitmap API would be useful here.
35 }; 39 };
36 40
37 interface MojoCompositorFrameSinkClient { 41 interface MojoCompositorFrameSinkClient {
38 // Notification that the previous CompositorFrame given to 42 // Notification that the previous CompositorFrame given to
39 // SubmitCompositorFrame() has been processed and that another frame 43 // SubmitCompositorFrame() has been processed and that another frame
40 // can be submitted. This provides backpressure from the display compositor 44 // can be submitted. This provides backpressure from the display compositor
41 // so that frames are submitted only at the rate it can handle them. 45 // so that frames are submitted only at the rate it can handle them.
42 // TODO(fsamuel): This method ought not be necessary with unified BeginFrame. 46 // TODO(fsamuel): This method ought not be necessary with unified BeginFrame.
43 // However, there's a fair amount of cleanup and refactoring necessary to get 47 // However, there's a fair amount of cleanup and refactoring necessary to get
44 // rid of it. 48 // rid of it.
45 DidReceiveCompositorFrameAck(); 49 DidReceiveCompositorFrameAck();
46 50
47 // Notification for the client to generate a CompositorFrame. 51 // Notification for the client to generate a CompositorFrame.
48 OnBeginFrame(BeginFrameArgs args); 52 OnBeginFrame(BeginFrameArgs args);
49 53
50 // Returns resources sent to SubmitCompositorFrame to be reused or freed. 54 // Returns resources sent to SubmitCompositorFrame to be reused or freed.
51 ReclaimResources(ReturnedResourceArray resources); 55 ReclaimResources(ReturnedResourceArray resources);
56
57 // Called when surface is being scheduled for a draw.
58 WillDrawSurface();
danakj 2016/12/02 00:01:14 no damage rect or local frame id?
Alex Z. 2016/12/02 16:17:15 This was first added in https://codereview.chromiu
52 }; 59 };
53 60
54 // MojoCompositorFrameSinkPrivate is used by the display compositor host to set 61 // MojoCompositorFrameSinkPrivate is used by the display compositor host to set
55 // up BeginFrameSource hierarchies. This API lives in SurfaceManager but is 62 // up BeginFrameSource hierarchies. This API lives in SurfaceManager but is
56 // called from here in order to ensure that hierarchy registration does not race 63 // called from here in order to ensure that hierarchy registration does not race
57 // CompositorFrameSink creation. 64 // CompositorFrameSink creation.
58 interface MojoCompositorFrameSinkPrivate { 65 interface MojoCompositorFrameSinkPrivate {
59 AddChildFrameSink(FrameSinkId child_frame_sink_id); 66 AddChildFrameSink(FrameSinkId child_frame_sink_id);
60 RemoveChildFrameSink(FrameSinkId child_frame_sink_id); 67 RemoveChildFrameSink(FrameSinkId child_frame_sink_id);
61 }; 68 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698