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

Unified Diff: ui/aura/mus/window_port_mus.cc

Issue 2764433003: mus-ws: Plumb FrameSinkId to Children (Closed)
Patch Set: Addressed Antoine's comment Created 3 years, 9 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
« no previous file with comments | « ui/aura/mus/window_port_mus.h ('k') | ui/aura/mus/window_tree_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/mus/window_port_mus.cc
diff --git a/ui/aura/mus/window_port_mus.cc b/ui/aura/mus/window_port_mus.cc
index fc09504eb86c6f580aaa7974aeae215c3906e560..2d503705a4ec781091925ed19659f743c5dcf4e8 100644
--- a/ui/aura/mus/window_port_mus.cc
+++ b/ui/aura/mus/window_port_mus.cc
@@ -82,18 +82,39 @@ void WindowPortMus::Embed(
window_tree_client_->Embed(window_, std::move(client), flags, callback);
}
-std::unique_ptr<ui::ClientCompositorFrameSink>
-WindowPortMus::RequestCompositorFrameSink(
+void WindowPortMus::RequestCompositorFrameSink(
scoped_refptr<cc::ContextProvider> context_provider,
- gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) {
+ gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
+ const CompositorFrameSinkCallback& callback) {
+ DCHECK(pending_compositor_frame_sink_request_.is_null());
+ // If we haven't received a FrameSinkId from the window server yet then we
+ // bind the parameters to a closure that will be called once the FrameSinkId
+ // is available.
+ if (!frame_sink_id_.is_valid()) {
+ pending_compositor_frame_sink_request_ =
+ base::Bind(&WindowPortMus::RequestCompositorFrameSinkInternal,
+ base::Unretained(this), std::move(context_provider),
+ gpu_memory_buffer_manager, callback);
+ return;
+ }
+
+ RequestCompositorFrameSinkInternal(std::move(context_provider),
+ gpu_memory_buffer_manager, callback);
+}
+
+void WindowPortMus::RequestCompositorFrameSinkInternal(
+ scoped_refptr<cc::ContextProvider> context_provider,
+ gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
+ const CompositorFrameSinkCallback& callback) {
+ DCHECK(frame_sink_id_.is_valid());
std::unique_ptr<ui::ClientCompositorFrameSinkBinding>
compositor_frame_sink_binding;
std::unique_ptr<ui::ClientCompositorFrameSink> compositor_frame_sink =
ui::ClientCompositorFrameSink::Create(
- cc::FrameSinkId(server_id(), 0), std::move(context_provider),
+ frame_sink_id_, std::move(context_provider),
gpu_memory_buffer_manager, &compositor_frame_sink_binding);
AttachCompositorFrameSink(std::move(compositor_frame_sink_binding));
- return compositor_frame_sink;
+ callback.Run(std::move(compositor_frame_sink));
}
void WindowPortMus::AttachCompositorFrameSink(
@@ -247,6 +268,13 @@ void WindowPortMus::SetPropertyFromServer(
property_data);
}
+void WindowPortMus::SetFrameSinkIdFromServer(
+ const cc::FrameSinkId& frame_sink_id) {
+ frame_sink_id_ = frame_sink_id;
+ if (!pending_compositor_frame_sink_request_.is_null())
+ base::ResetAndReturn(&pending_compositor_frame_sink_request_).Run();
+}
+
void WindowPortMus::SetSurfaceInfoFromServer(
const cc::SurfaceInfo& surface_info) {
if (surface_info_.is_valid()) {
« no previous file with comments | « ui/aura/mus/window_port_mus.h ('k') | ui/aura/mus/window_tree_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698