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

Side by Side Diff: services/ui/ws/gpu_compositor_frame_sink.h

Issue 2527443002: Display Compositor: Allocate LocalFrameId in client. (Closed)
Patch Set: Addressed sadrul's 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef SERVICES_UI_WS_GPU_COMPOSITOR_FRAME_SINK_H_ 5 #ifndef SERVICES_UI_WS_GPU_COMPOSITOR_FRAME_SINK_H_
6 #define SERVICES_UI_WS_GPU_COMPOSITOR_FRAME_SINK_H_ 6 #define SERVICES_UI_WS_GPU_COMPOSITOR_FRAME_SINK_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <set> 9 #include <set>
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, 55 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
56 scoped_refptr<SurfacesContextProvider> context_provider, 56 scoped_refptr<SurfacesContextProvider> context_provider,
57 cc::mojom::MojoCompositorFrameSinkRequest request, 57 cc::mojom::MojoCompositorFrameSinkRequest request,
58 cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request, 58 cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request,
59 cc::mojom::MojoCompositorFrameSinkClientPtr client); 59 cc::mojom::MojoCompositorFrameSinkClientPtr client);
60 60
61 ~GpuCompositorFrameSink() override; 61 ~GpuCompositorFrameSink() override;
62 62
63 // cc::mojom::MojoCompositorFrameSink: 63 // cc::mojom::MojoCompositorFrameSink:
64 void SetNeedsBeginFrame(bool needs_begin_frame) override; 64 void SetNeedsBeginFrame(bool needs_begin_frame) override;
65 void SubmitCompositorFrame(cc::CompositorFrame frame) override; 65 void SubmitCompositorFrame(const cc::LocalFrameId& local_frame_id,
66 cc::CompositorFrame frame) override;
66 67
67 // cc::mojom::MojoCompositorFrameSinkPrivate: 68 // cc::mojom::MojoCompositorFrameSinkPrivate:
68 void AddChildFrameSink(const cc::FrameSinkId& child_frame_sink_id) override; 69 void AddChildFrameSink(const cc::FrameSinkId& child_frame_sink_id) override;
69 void RemoveChildFrameSink( 70 void RemoveChildFrameSink(
70 const cc::FrameSinkId& child_frame_sink_id) override; 71 const cc::FrameSinkId& child_frame_sink_id) override;
71 72
72 private: 73 private:
73 void InitDisplay(gfx::AcceleratedWidget widget, 74 void InitDisplay(gfx::AcceleratedWidget widget,
74 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, 75 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
75 scoped_refptr<SurfacesContextProvider> context_provider); 76 scoped_refptr<SurfacesContextProvider> context_provider);
(...skipping 18 matching lines...) Expand all
94 void UpdateNeedsBeginFramesInternal(); 95 void UpdateNeedsBeginFramesInternal();
95 96
96 const cc::FrameSinkId frame_sink_id_; 97 const cc::FrameSinkId frame_sink_id_;
97 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 98 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
98 99
99 // TODO(fsamuel): We hold a reference to DisplayCompositor so we can talk to 100 // TODO(fsamuel): We hold a reference to DisplayCompositor so we can talk to
100 // SurfaceManager in the destructor. In the future, DisplayCompositor will own 101 // SurfaceManager in the destructor. In the future, DisplayCompositor will own
101 // GpuCompositorFrameSink. 102 // GpuCompositorFrameSink.
102 scoped_refptr<DisplayCompositor> display_compositor_; 103 scoped_refptr<DisplayCompositor> display_compositor_;
103 104
104 gfx::Size last_submitted_frame_size_;
105 // GpuCompositorFrameSink holds a cc::Display if it created with 105 // GpuCompositorFrameSink holds a cc::Display if it created with
106 // non-null gfx::AcceleratedWidget. In the window server, the display root 106 // non-null gfx::AcceleratedWidget. In the window server, the display root
107 // window's CompositorFrameSink will have a valid gfx::AcceleratedWidget. 107 // window's CompositorFrameSink will have a valid gfx::AcceleratedWidget.
108 std::unique_ptr<cc::Display> display_; 108 std::unique_ptr<cc::Display> display_;
109 109
110 cc::LocalFrameId local_frame_id_; 110 cc::LocalFrameId local_frame_id_;
111 cc::SurfaceIdAllocator surface_id_allocator_;
112 cc::SurfaceFactory surface_factory_; 111 cc::SurfaceFactory surface_factory_;
113 // Counts the number of CompositorFrames that have been submitted and have not 112 // Counts the number of CompositorFrames that have been submitted and have not
114 // yet received an ACK. 113 // yet received an ACK.
115 int ack_pending_count_ = 0; 114 int ack_pending_count_ = 0;
116 cc::ReturnedResourceArray surface_returned_resources_; 115 cc::ReturnedResourceArray surface_returned_resources_;
117 116
118 // The begin frame source being observered. Null if none. 117 // The begin frame source being observered. Null if none.
119 cc::BeginFrameSource* begin_frame_source_ = nullptr; 118 cc::BeginFrameSource* begin_frame_source_ = nullptr;
120 119
121 // The last begin frame args generated by the begin frame source. 120 // The last begin frame args generated by the begin frame source.
(...skipping 10 matching lines...) Expand all
132 mojo::Binding<cc::mojom::MojoCompositorFrameSinkPrivate> private_binding_; 131 mojo::Binding<cc::mojom::MojoCompositorFrameSinkPrivate> private_binding_;
133 132
134 DISALLOW_COPY_AND_ASSIGN(GpuCompositorFrameSink); 133 DISALLOW_COPY_AND_ASSIGN(GpuCompositorFrameSink);
135 }; 134 };
136 135
137 } // namespace ws 136 } // namespace ws
138 137
139 } // namespace ui 138 } // namespace ui
140 139
141 #endif // SERVICES_UI_WS_GPU_COMPOSITOR_FRAME_SINK_H_ 140 #endif // SERVICES_UI_WS_GPU_COMPOSITOR_FRAME_SINK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698