OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/display_manager.h" | 5 #include "services/ui/ws/display_manager.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
9 #include "services/ui/display/platform_screen.h" | 9 #include "services/ui/display/platform_screen.h" |
10 #include "services/ui/ws/display.h" | 10 #include "services/ui/ws/display.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 void DisplayManager::OnDisplayAdded(int64_t id, | 170 void DisplayManager::OnDisplayAdded(int64_t id, |
171 const gfx::Rect& bounds, | 171 const gfx::Rect& bounds, |
172 const gfx::Size& pixel_size, | 172 const gfx::Size& pixel_size, |
173 float scale_factor) { | 173 float scale_factor) { |
174 TRACE_EVENT1("mus-ws", "OnDisplayAdded", "id", id); | 174 TRACE_EVENT1("mus-ws", "OnDisplayAdded", "id", id); |
175 PlatformDisplayInitParams params; | 175 PlatformDisplayInitParams params; |
176 params.display_id = id; | 176 params.display_id = id; |
177 params.metrics.bounds = bounds; | 177 params.metrics.bounds = bounds; |
178 params.metrics.pixel_size = pixel_size; | 178 params.metrics.pixel_size = pixel_size; |
179 params.metrics.device_scale_factor = scale_factor; | 179 params.metrics.device_scale_factor = scale_factor; |
180 params.surfaces_state = window_server_->GetSurfacesState(); | 180 params.display_compositor = window_server_->GetDisplayCompositor(); |
181 | 181 |
182 ws::Display* display = new ws::Display(window_server_, params); | 182 ws::Display* display = new ws::Display(window_server_, params); |
183 display->Init(nullptr); | 183 display->Init(nullptr); |
184 | 184 |
185 window_server_->delegate()->UpdateTouchTransforms(); | 185 window_server_->delegate()->UpdateTouchTransforms(); |
186 } | 186 } |
187 | 187 |
188 void DisplayManager::OnDisplayRemoved(int64_t id) { | 188 void DisplayManager::OnDisplayRemoved(int64_t id) { |
189 TRACE_EVENT1("mus-ws", "OnDisplayRemoved", "id", id); | 189 TRACE_EVENT1("mus-ws", "OnDisplayRemoved", "id", id); |
190 Display* display = GetDisplayById(id); | 190 Display* display = GetDisplayById(id); |
191 if (display) | 191 if (display) |
192 DestroyDisplay(display); | 192 DestroyDisplay(display); |
193 } | 193 } |
194 | 194 |
195 void DisplayManager::OnDisplayModified(int64_t id, | 195 void DisplayManager::OnDisplayModified(int64_t id, |
196 const gfx::Rect& bounds, | 196 const gfx::Rect& bounds, |
197 const gfx::Size& pixel_size, | 197 const gfx::Size& pixel_size, |
198 float scale_factor) { | 198 float scale_factor) { |
199 // TODO(kylechar): Implement. | 199 // TODO(kylechar): Implement. |
200 NOTREACHED(); | 200 NOTREACHED(); |
201 } | 201 } |
202 | 202 |
203 } // namespace ws | 203 } // namespace ws |
204 } // namespace ui | 204 } // namespace ui |
OLD | NEW |