| 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 "ui/ozone/platform/drm/ozone_platform_gbm.h" | 5 #include "ui/ozone/platform/drm/ozone_platform_gbm.h" |
| 6 | 6 |
| 7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <gbm.h> | 9 #include <gbm.h> |
| 10 #include <stdlib.h> | 10 #include <stdlib.h> |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 std::unique_ptr<DrmWindowHost> platform_window(new DrmWindowHost( | 132 std::unique_ptr<DrmWindowHost> platform_window(new DrmWindowHost( |
| 133 delegate, bounds, adapter, event_factory_ozone_.get(), cursor_.get(), | 133 delegate, bounds, adapter, event_factory_ozone_.get(), cursor_.get(), |
| 134 window_manager_.get(), display_manager_.get(), overlay_manager_.get())); | 134 window_manager_.get(), display_manager_.get(), overlay_manager_.get())); |
| 135 platform_window->Initialize(); | 135 platform_window->Initialize(); |
| 136 return std::move(platform_window); | 136 return std::move(platform_window); |
| 137 } | 137 } |
| 138 std::unique_ptr<display::NativeDisplayDelegate> CreateNativeDisplayDelegate() | 138 std::unique_ptr<display::NativeDisplayDelegate> CreateNativeDisplayDelegate() |
| 139 override { | 139 override { |
| 140 return base::MakeUnique<DrmNativeDisplayDelegate>(display_manager_.get()); | 140 return base::MakeUnique<DrmNativeDisplayDelegate>(display_manager_.get()); |
| 141 } | 141 } |
| 142 void InitializeUI() override { | |
| 143 InitParams default_params; | |
| 144 InitializeUI(default_params); | |
| 145 } | |
| 146 void InitializeUI(const InitParams& args) override { | 142 void InitializeUI(const InitParams& args) override { |
| 147 // Ozone drm can operate in three modes configured at runtime: | 143 // Ozone drm can operate in three modes configured at runtime: |
| 148 // 1. legacy mode where browser and gpu components communicate | 144 // 1. legacy mode where browser and gpu components communicate |
| 149 // via param traits IPC. | 145 // via param traits IPC. |
| 150 // 2. single-process mode where browser and gpu components | 146 // 2. single-process mode where browser and gpu components |
| 151 // communicate via PostTask. | 147 // communicate via PostTask. |
| 152 // 3. mojo mode where browser and gpu components communicate | 148 // 3. mojo mode where browser and gpu components communicate |
| 153 // via mojo IPC. | 149 // via mojo IPC. |
| 154 // Currently, mojo mode uses mojo in a single process but this is | 150 // Currently, mojo mode uses mojo in a single process but this is |
| 155 // an interim implementation detail that will be eliminated in a | 151 // an interim implementation detail that will be eliminated in a |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 event_factory_ozone_->input_controller())); | 196 event_factory_ozone_->input_controller())); |
| 201 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone); | 197 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone); |
| 202 overlay_manager_.reset( | 198 overlay_manager_.reset( |
| 203 new DrmOverlayManager(adapter, window_manager_.get())); | 199 new DrmOverlayManager(adapter, window_manager_.get())); |
| 204 | 200 |
| 205 if (using_mojo_ || single_process_) { | 201 if (using_mojo_ || single_process_) { |
| 206 mus_thread_proxy_->ProvideManagers(display_manager_.get(), | 202 mus_thread_proxy_->ProvideManagers(display_manager_.get(), |
| 207 overlay_manager_.get()); | 203 overlay_manager_.get()); |
| 208 } | 204 } |
| 209 } | 205 } |
| 210 void InitializeGPU() override { | |
| 211 InitParams default_params; | |
| 212 InitializeGPU(default_params); | |
| 213 } | |
| 214 void InitializeGPU(const InitParams& args) override { | 206 void InitializeGPU(const InitParams& args) override { |
| 215 // TODO(rjkroege): services/ui should initialize this with a connector. | 207 // TODO(rjkroege): services/ui should initialize this with a connector. |
| 216 // However, in-progress refactorings in services/ui make it difficult to | 208 // However, in-progress refactorings in services/ui make it difficult to |
| 217 // require this at present. Set using_mojo_ like below once this is | 209 // require this at present. Set using_mojo_ like below once this is |
| 218 // complete. | 210 // complete. |
| 219 // using_mojo_ = args.connector != nullptr; | 211 // using_mojo_ = args.connector != nullptr; |
| 220 | 212 |
| 221 InterThreadMessagingProxy* itmp; | 213 InterThreadMessagingProxy* itmp; |
| 222 if (using_mojo_ || single_process_) { | 214 if (using_mojo_ || single_process_) { |
| 223 itmp = mus_thread_proxy_.get(); | 215 itmp = mus_thread_proxy_.get(); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 DISALLOW_COPY_AND_ASSIGN(OzonePlatformGbm); | 267 DISALLOW_COPY_AND_ASSIGN(OzonePlatformGbm); |
| 276 }; | 268 }; |
| 277 | 269 |
| 278 } // namespace | 270 } // namespace |
| 279 | 271 |
| 280 OzonePlatform* CreateOzonePlatformGbm() { | 272 OzonePlatform* CreateOzonePlatformGbm() { |
| 281 return new OzonePlatformGbm; | 273 return new OzonePlatformGbm; |
| 282 } | 274 } |
| 283 | 275 |
| 284 } // namespace ui | 276 } // namespace ui |
| OLD | NEW |