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

Unified Diff: services/ui/ws/frame_generator.h

Issue 2471503002: Mus+Ash: Unify CompositorFrameSinks (Closed)
Patch Set: Added comment Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: services/ui/ws/frame_generator.h
diff --git a/services/ui/ws/frame_generator.h b/services/ui/ws/frame_generator.h
index dd322d5b1dd61ea089ec2df33b437f5bd4cab53f..276e763f7c19581f970df68c850bc1e71903779f 100644
--- a/services/ui/ws/frame_generator.h
+++ b/services/ui/ws/frame_generator.h
@@ -48,7 +48,8 @@ class ServerWindowCompositorFrameSink;
// Responsible for redrawing the display in response to the redraw requests by
// submitting CompositorFrames to the owned CompositorFrameSink.
-class FrameGenerator : public ServerWindowTracker {
+class FrameGenerator : public ServerWindowTracker,
+ public cc::mojom::MojoCompositorFrameSinkClient {
public:
FrameGenerator(FrameGeneratorDelegate* delegate,
ServerWindow* root_window,
@@ -66,6 +67,10 @@ class FrameGenerator : public ServerWindowTracker {
private:
friend class ui::ws::test::FrameGeneratorTest;
+ // cc::mojom::MojoCompositorFrameSinkClient implementation:
+ void DidReceiveCompositorFrameAck() override;
+ void ReclaimResources(const cc::ReturnedResourceArray& resources) override;
+
void WantToDraw();
// This method initiates a top level redraw of the display.
@@ -73,10 +78,6 @@ class FrameGenerator : public ServerWindowTracker {
// changes.
void Draw();
- // This is called after the CompositorFrameSink has completed generating a new
- // frame for the display.
- void DidDraw();
-
// Generates the CompositorFrame for the current |dirty_rect_|.
cc::CompositorFrame GenerateCompositorFrame(const gfx::Rect& output_rect);
@@ -115,10 +116,11 @@ class FrameGenerator : public ServerWindowTracker {
FrameGeneratorDelegate* delegate_;
scoped_refptr<DisplayCompositor> display_compositor_;
cc::FrameSinkId frame_sink_id_;
+ ServerWindow* const root_window_;
cc::SurfaceSequenceGenerator surface_sequence_generator_;
scoped_refptr<gpu::GpuChannelHost> gpu_channel_;
- std::unique_ptr<DisplayCompositorFrameSink> compositor_frame_sink_;
+ cc::mojom::MojoCompositorFrameSinkPtr compositor_frame_sink_;
gfx::AcceleratedWidget widget_ = gfx::kNullAcceleratedWidget;
// The region that needs to be redrawn next time the compositor frame is
@@ -133,6 +135,8 @@ class FrameGenerator : public ServerWindowTracker {
std::unordered_map<cc::FrameSinkId, SurfaceDependency, cc::FrameSinkIdHash>
dependencies_;
+ mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient> binding_;
+
base::WeakPtrFactory<FrameGenerator> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(FrameGenerator);

Powered by Google App Engine
This is Rietveld 408576698