OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/mus/ws/display_manager.h" | 5 #include "components/mus/ws/display_manager.h" |
6 | 6 |
7 #include "base/numerics/safe_conversions.h" | 7 #include "base/numerics/safe_conversions.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "cc/output/compositor_frame.h" | 9 #include "cc/output/compositor_frame.h" |
10 #include "cc/output/delegated_frame_data.h" | 10 #include "cc/output/delegated_frame_data.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "components/mus/ws/server_window_surface.h" | 21 #include "components/mus/ws/server_window_surface.h" |
22 #include "components/mus/ws/server_window_surface_manager.h" | 22 #include "components/mus/ws/server_window_surface_manager.h" |
23 #include "components/mus/ws/window_coordinate_conversions.h" | 23 #include "components/mus/ws/window_coordinate_conversions.h" |
24 #include "mojo/converters/geometry/geometry_type_converters.h" | 24 #include "mojo/converters/geometry/geometry_type_converters.h" |
25 #include "mojo/converters/input_events/input_events_type_converters.h" | 25 #include "mojo/converters/input_events/input_events_type_converters.h" |
26 #include "mojo/converters/input_events/mojo_extended_key_event_data.h" | 26 #include "mojo/converters/input_events/mojo_extended_key_event_data.h" |
27 #include "mojo/converters/surfaces/surfaces_type_converters.h" | 27 #include "mojo/converters/surfaces/surfaces_type_converters.h" |
28 #include "mojo/converters/surfaces/surfaces_utils.h" | 28 #include "mojo/converters/surfaces/surfaces_utils.h" |
29 #include "mojo/converters/transform/transform_type_converters.h" | 29 #include "mojo/converters/transform/transform_type_converters.h" |
30 #include "mojo/shell/public/cpp/application_connection.h" | 30 #include "mojo/shell/public/cpp/application_connection.h" |
31 #include "mojo/shell/public/cpp/application_impl.h" | 31 #include "mojo/shell/public/cpp/shell.h" |
32 #include "third_party/skia/include/core/SkXfermode.h" | 32 #include "third_party/skia/include/core/SkXfermode.h" |
33 #include "ui/base/cursor/cursor_loader.h" | 33 #include "ui/base/cursor/cursor_loader.h" |
34 #include "ui/events/event.h" | 34 #include "ui/events/event.h" |
35 #include "ui/events/event_utils.h" | 35 #include "ui/events/event_utils.h" |
36 #include "ui/gfx/display.h" | 36 #include "ui/gfx/display.h" |
37 #include "ui/platform_window/platform_ime_controller.h" | 37 #include "ui/platform_window/platform_ime_controller.h" |
38 #include "ui/platform_window/platform_window.h" | 38 #include "ui/platform_window/platform_window.h" |
39 | 39 |
40 #if defined(OS_WIN) | 40 #if defined(OS_WIN) |
41 #include "ui/platform_window/win/win_window.h" | 41 #include "ui/platform_window/win/win_window.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 } | 147 } |
148 } | 148 } |
149 | 149 |
150 } // namespace | 150 } // namespace |
151 | 151 |
152 // static | 152 // static |
153 DisplayManagerFactory* DisplayManager::factory_ = nullptr; | 153 DisplayManagerFactory* DisplayManager::factory_ = nullptr; |
154 | 154 |
155 // static | 155 // static |
156 DisplayManager* DisplayManager::Create( | 156 DisplayManager* DisplayManager::Create( |
157 mojo::ApplicationImpl* app_impl, | 157 mojo::Shell* shell, |
158 const scoped_refptr<GpuState>& gpu_state, | 158 const scoped_refptr<GpuState>& gpu_state, |
159 const scoped_refptr<SurfacesState>& surfaces_state) { | 159 const scoped_refptr<SurfacesState>& surfaces_state) { |
160 if (factory_) { | 160 if (factory_) |
161 return factory_->CreateDisplayManager(app_impl, gpu_state, | 161 return factory_->CreateDisplayManager(shell, gpu_state, surfaces_state); |
162 surfaces_state); | 162 return new DefaultDisplayManager(shell, gpu_state, surfaces_state); |
163 } | |
164 return new DefaultDisplayManager(app_impl, gpu_state, | |
165 surfaces_state); | |
166 } | 163 } |
167 | 164 |
168 DefaultDisplayManager::DefaultDisplayManager( | 165 DefaultDisplayManager::DefaultDisplayManager( |
169 mojo::ApplicationImpl* app_impl, | 166 mojo::Shell* shell, |
170 const scoped_refptr<GpuState>& gpu_state, | 167 const scoped_refptr<GpuState>& gpu_state, |
171 const scoped_refptr<SurfacesState>& surfaces_state) | 168 const scoped_refptr<SurfacesState>& surfaces_state) |
172 : app_impl_(app_impl), | 169 : shell_(shell), |
173 gpu_state_(gpu_state), | 170 gpu_state_(gpu_state), |
174 surfaces_state_(surfaces_state), | 171 surfaces_state_(surfaces_state), |
175 delegate_(nullptr), | 172 delegate_(nullptr), |
176 draw_timer_(false, false), | 173 draw_timer_(false, false), |
177 frame_pending_(false), | 174 frame_pending_(false), |
178 #if !defined(OS_ANDROID) | 175 #if !defined(OS_ANDROID) |
179 cursor_loader_(ui::CursorLoader::Create()), | 176 cursor_loader_(ui::CursorLoader::Create()), |
180 #endif | 177 #endif |
181 weak_factory_(this) { | 178 weak_factory_(this) { |
182 metrics_.size_in_pixels = mojo::Size::New(); | 179 metrics_.size_in_pixels = mojo::Size::New(); |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 | 417 |
421 void DefaultDisplayManager::OnAcceleratedWidgetDestroyed() { | 418 void DefaultDisplayManager::OnAcceleratedWidgetDestroyed() { |
422 NOTREACHED(); | 419 NOTREACHED(); |
423 } | 420 } |
424 | 421 |
425 void DefaultDisplayManager::OnActivationChanged(bool active) {} | 422 void DefaultDisplayManager::OnActivationChanged(bool active) {} |
426 | 423 |
427 } // namespace ws | 424 } // namespace ws |
428 | 425 |
429 } // namespace mus | 426 } // namespace mus |
OLD | NEW |