| 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/dri/ozone_platform_gbm.h" | 5 #include "ui/ozone/platform/dri/ozone_platform_gbm.h" |
| 6 | 6 |
| 7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
| 8 #include <gbm.h> | 8 #include <gbm.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 | 10 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 } | 121 } |
| 122 scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() override { | 122 scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() override { |
| 123 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateProxy( | 123 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateProxy( |
| 124 gpu_platform_support_host_.get(), device_manager_.get(), | 124 gpu_platform_support_host_.get(), device_manager_.get(), |
| 125 display_manager_.get())); | 125 display_manager_.get())); |
| 126 } | 126 } |
| 127 void InitializeUI() override { | 127 void InitializeUI() override { |
| 128 display_manager_.reset(new DisplayManager()); | 128 display_manager_.reset(new DisplayManager()); |
| 129 // Needed since the browser process creates the accelerated widgets and that | 129 // Needed since the browser process creates the accelerated widgets and that |
| 130 // happens through SFO. | 130 // happens through SFO. |
| 131 surface_factory_ozone_.reset(new GbmSurfaceFactory(use_surfaceless_)); | 131 if (!surface_factory_ozone_) |
| 132 surface_factory_ozone_.reset(new GbmSurfaceFactory(use_surfaceless_)); |
| 132 device_manager_ = CreateDeviceManager(); | 133 device_manager_ = CreateDeviceManager(); |
| 133 gpu_platform_support_host_.reset(new DriGpuPlatformSupportHost()); | 134 gpu_platform_support_host_.reset(new DriGpuPlatformSupportHost()); |
| 134 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone); | 135 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone); |
| 135 window_manager_.reset( | 136 window_manager_.reset( |
| 136 new DriWindowManager(gpu_platform_support_host_.get())); | 137 new DriWindowManager(gpu_platform_support_host_.get())); |
| 137 #if defined(USE_XKBCOMMON) | 138 #if defined(USE_XKBCOMMON) |
| 138 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(make_scoped_ptr( | 139 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(make_scoped_ptr( |
| 139 new XkbKeyboardLayoutEngine(xkb_evdev_code_converter_))); | 140 new XkbKeyboardLayoutEngine(xkb_evdev_code_converter_))); |
| 140 #else | 141 #else |
| 141 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( | 142 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 }; | 195 }; |
| 195 | 196 |
| 196 } // namespace | 197 } // namespace |
| 197 | 198 |
| 198 OzonePlatform* CreateOzonePlatformGbm() { | 199 OzonePlatform* CreateOzonePlatformGbm() { |
| 199 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); | 200 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); |
| 200 return new OzonePlatformGbm(cmd->HasSwitch(switches::kOzoneUseSurfaceless)); | 201 return new OzonePlatformGbm(cmd->HasSwitch(switches::kOzoneUseSurfaceless)); |
| 201 } | 202 } |
| 202 | 203 |
| 203 } // namespace ui | 204 } // namespace ui |
| OLD | NEW |