| OLD | NEW |
| 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 #include "services/ui/ws/server_window_compositor_frame_sink_manager.h" | 5 #include "services/ui/ws/server_window_compositor_frame_sink_manager.h" |
| 6 | 6 |
| 7 #include "mojo/public/cpp/bindings/strong_binding.h" | 7 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 8 #include "services/ui/surfaces/display_compositor.h" | 8 #include "services/ui/surfaces/display_compositor.h" |
| 9 #include "services/ui/ws/gpu_compositor_frame_sink.h" | 9 #include "services/ui/ws/gpu_compositor_frame_sink.h" |
| 10 #include "services/ui/ws/ids.h" | 10 #include "services/ui/ws/ids.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request; | 52 cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request; |
| 53 if (data.pending_compositor_frame_sink_request.is_pending()) { | 53 if (data.pending_compositor_frame_sink_request.is_pending()) { |
| 54 private_request = std::move(data.pending_compositor_frame_sink_request); | 54 private_request = std::move(data.pending_compositor_frame_sink_request); |
| 55 } else { | 55 } else { |
| 56 private_request = mojo::GetProxy(&data.compositor_frame_sink); | 56 private_request = mojo::GetProxy(&data.compositor_frame_sink); |
| 57 } | 57 } |
| 58 | 58 |
| 59 // TODO(fsamuel): Create the CompositorFrameSink through the DisplayCompositor | 59 // TODO(fsamuel): Create the CompositorFrameSink through the DisplayCompositor |
| 60 // mojo interface. | 60 // mojo interface. |
| 61 mojo::MakeStrongBinding( | 61 data.compositor_frame_sink_impl_ = base::MakeUnique<GpuCompositorFrameSink>( |
| 62 base::MakeUnique<GpuCompositorFrameSink>( | 62 window_->delegate()->GetDisplayCompositor(), frame_sink_id, widget, |
| 63 window_->delegate()->GetDisplayCompositor(), frame_sink_id, widget, | 63 gpu_memory_buffer_manager, std::move(context_provider), |
| 64 gpu_memory_buffer_manager, std::move(context_provider), | 64 std::move(request), std::move(private_request), std::move(client)); |
| 65 std::move(request), std::move(client)), | |
| 66 std::move(private_request)); | |
| 67 if (window_->parent()) { | 65 if (window_->parent()) { |
| 68 window_->delegate() | 66 window_->delegate() |
| 69 ->GetRootWindow(window_) | 67 ->GetRootWindow(window_) |
| 70 ->GetOrCreateCompositorFrameSinkManager() | 68 ->GetOrCreateCompositorFrameSinkManager() |
| 71 ->AddChildFrameSinkId(mojom::CompositorFrameSinkType::DEFAULT, | 69 ->AddChildFrameSinkId(mojom::CompositorFrameSinkType::DEFAULT, |
| 72 frame_sink_id); | 70 frame_sink_id); |
| 73 } | 71 } |
| 74 } | 72 } |
| 75 | 73 |
| 76 void ServerWindowCompositorFrameSinkManager::AddChildFrameSinkId( | 74 void ServerWindowCompositorFrameSinkManager::AddChildFrameSinkId( |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 157 |
| 160 CompositorFrameSinkData& CompositorFrameSinkData::operator=( | 158 CompositorFrameSinkData& CompositorFrameSinkData::operator=( |
| 161 CompositorFrameSinkData&& other) { | 159 CompositorFrameSinkData&& other) { |
| 162 latest_submitted_surface_id = other.latest_submitted_surface_id; | 160 latest_submitted_surface_id = other.latest_submitted_surface_id; |
| 163 compositor_frame_sink = std::move(other.compositor_frame_sink); | 161 compositor_frame_sink = std::move(other.compositor_frame_sink); |
| 164 return *this; | 162 return *this; |
| 165 } | 163 } |
| 166 | 164 |
| 167 } // namespace ws | 165 } // namespace ws |
| 168 } // namespace ui | 166 } // namespace ui |
| OLD | NEW |