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

Side by Side Diff: services/ui/ws/server_window_compositor_frame_sink_manager.cc

Issue 2521763002: Give ServerWindowCompositorFrameSinkManager ownership of GpuCompositorFrameSink (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « services/ui/ws/server_window_compositor_frame_sink_manager.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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
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
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
OLDNEW
« no previous file with comments | « services/ui/ws/server_window_compositor_frame_sink_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698