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

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

Issue 2683553004: Cleanup ServerWindowCompositorFrameSinkManager and FrameGenerator (Closed)
Patch Set: Created 3 years, 10 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 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 "cc/ipc/display_compositor.mojom.h" 7 #include "cc/ipc/display_compositor.mojom.h"
8 #include "mojo/public/cpp/bindings/strong_binding.h" 8 #include "mojo/public/cpp/bindings/strong_binding.h"
9 #include "services/ui/ws/ids.h" 9 #include "services/ui/ws/ids.h"
10 #include "services/ui/ws/server_window.h" 10 #include "services/ui/ws/server_window.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 mojo::MakeRequest(&frame_sink_data_->compositor_frame_sink); 102 mojo::MakeRequest(&frame_sink_data_->compositor_frame_sink);
103 frame_sink_data_->compositor_frame_sink->AddChildFrameSink(frame_sink_id); 103 frame_sink_data_->compositor_frame_sink->AddChildFrameSink(frame_sink_id);
104 } 104 }
105 105
106 void ServerWindowCompositorFrameSinkManager::RemoveChildFrameSinkId( 106 void ServerWindowCompositorFrameSinkManager::RemoveChildFrameSinkId(
107 const cc::FrameSinkId& frame_sink_id) { 107 const cc::FrameSinkId& frame_sink_id) {
108 DCHECK(frame_sink_data_); 108 DCHECK(frame_sink_data_);
109 frame_sink_data_->compositor_frame_sink->RemoveChildFrameSink(frame_sink_id); 109 frame_sink_data_->compositor_frame_sink->RemoveChildFrameSink(frame_sink_id);
110 } 110 }
111 111
112 bool ServerWindowCompositorFrameSinkManager::HasCompositorFrameSink() const {
113 return !!frame_sink_data_;
114 }
115
116 gfx::Size ServerWindowCompositorFrameSinkManager::GetLatestFrameSize() const { 112 gfx::Size ServerWindowCompositorFrameSinkManager::GetLatestFrameSize() const {
117 if (!frame_sink_data_) 113 if (!frame_sink_data_)
118 return gfx::Size(); 114 return gfx::Size();
119 115
120 return frame_sink_data_->latest_submitted_surface_info.size_in_pixels(); 116 return frame_sink_data_->latest_submitted_surface_info.size_in_pixels();
121 } 117 }
122 118
123 cc::SurfaceId ServerWindowCompositorFrameSinkManager::GetLatestSurfaceId()
124 const {
125 if (!frame_sink_data_)
126 return cc::SurfaceId();
127
128 return frame_sink_data_->latest_submitted_surface_info.id();
129 }
130
131 void ServerWindowCompositorFrameSinkManager::SetLatestSurfaceInfo( 119 void ServerWindowCompositorFrameSinkManager::SetLatestSurfaceInfo(
132 const cc::SurfaceInfo& surface_info) { 120 const cc::SurfaceInfo& surface_info) {
133 if (!frame_sink_data_) 121 if (!frame_sink_data_)
134 frame_sink_data_ = base::MakeUnique<CompositorFrameSinkData>(); 122 frame_sink_data_ = base::MakeUnique<CompositorFrameSinkData>();
135 123
136 frame_sink_data_->latest_submitted_surface_info = surface_info; 124 frame_sink_data_->latest_submitted_surface_info = surface_info;
137 } 125 }
138 126
139 void ServerWindowCompositorFrameSinkManager::OnRootChanged( 127 void ServerWindowCompositorFrameSinkManager::OnRootChanged(
140 ServerWindow* old_root, 128 ServerWindow* old_root,
(...skipping 22 matching lines...) Expand all
163 151
164 CompositorFrameSinkData& CompositorFrameSinkData::operator=( 152 CompositorFrameSinkData& CompositorFrameSinkData::operator=(
165 CompositorFrameSinkData&& other) { 153 CompositorFrameSinkData&& other) {
166 latest_submitted_surface_info = other.latest_submitted_surface_info; 154 latest_submitted_surface_info = other.latest_submitted_surface_info;
167 compositor_frame_sink = std::move(other.compositor_frame_sink); 155 compositor_frame_sink = std::move(other.compositor_frame_sink);
168 return *this; 156 return *this;
169 } 157 }
170 158
171 } // namespace ws 159 } // namespace ws
172 } // namespace ui 160 } // 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