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

Unified Diff: components/viz/client/client_compositor_frame_sink.h

Issue 2875753002: Implement aura::WindowPortMus::CreateCompositorFrameSink() (Closed)
Patch Set: Address review issues. Created 3 years, 7 months 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: components/viz/client/client_compositor_frame_sink.h
diff --git a/components/viz/client/client_compositor_frame_sink.h b/components/viz/client/client_compositor_frame_sink.h
index 407aa4130c4cf8850a37d536a3970c328a63f805..62c84dead044188df1c50800ae1560a7f2f81db5 100644
--- a/components/viz/client/client_compositor_frame_sink.h
+++ b/components/viz/client/client_compositor_frame_sink.h
@@ -21,15 +21,24 @@ class ClientCompositorFrameSink
public cc::mojom::MojoCompositorFrameSinkClient,
public cc::ExternalBeginFrameSourceClient {
public:
+ // If |generate_local_surface_id| is true, a local surface id will be
+ // generated for a new frame with different size, otherwise the
+ // |SetLocalSurfaceId| should be used for providing a valid local surface
+ // id.
ClientCompositorFrameSink(
scoped_refptr<cc::ContextProvider> context_provider,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
cc::mojom::MojoCompositorFrameSinkPtrInfo compositor_frame_sink_info,
cc::mojom::MojoCompositorFrameSinkClientRequest client_request,
- bool enable_surface_synchronization);
+ bool generate_local_surface_id);
~ClientCompositorFrameSink() override;
+ using SurfaceChangedCallback =
+ base::Callback<void(const cc::LocalSurfaceId&, const gfx::Size&)>;
+ // Set a callback which will be called when the surface is changed.
+ void SetSurfaceChangedCallback(const SurfaceChangedCallback& callback);
+
// cc::CompositorFrameSink implementation.
bool BindToClient(cc::CompositorFrameSinkClient* client) override;
void DetachFromClient() override;
@@ -57,7 +66,9 @@ class ClientCompositorFrameSink
std::unique_ptr<mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient>>
client_binding_;
THREAD_CHECKER(thread_checker_);
- const bool enable_surface_synchronization_;
+ const bool generate_local_surface_id_;
+
+ SurfaceChangedCallback surface_changed_callback_;
DISALLOW_COPY_AND_ASSIGN(ClientCompositorFrameSink);
};

Powered by Google App Engine
This is Rietveld 408576698