| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 virtual scoped_ptr<TouchscreenDeviceManager> | 120 virtual scoped_ptr<TouchscreenDeviceManager> |
| 121 CreateTouchscreenDeviceManager() OVERRIDE { | 121 CreateTouchscreenDeviceManager() OVERRIDE { |
| 122 return scoped_ptr<TouchscreenDeviceManager>( | 122 return scoped_ptr<TouchscreenDeviceManager>( |
| 123 new TouchscreenDeviceManagerOzone()); | 123 new TouchscreenDeviceManagerOzone()); |
| 124 } | 124 } |
| 125 #endif | 125 #endif |
| 126 virtual void InitializeUI() OVERRIDE { | 126 virtual void InitializeUI() OVERRIDE { |
| 127 vt_manager_.reset(new VirtualTerminalManager()); | 127 vt_manager_.reset(new VirtualTerminalManager()); |
| 128 // Needed since the browser process creates the accelerated widgets and that | 128 // Needed since the browser process creates the accelerated widgets and that |
| 129 // happens through SFO. | 129 // happens through SFO. |
| 130 surface_factory_ozone_.reset(new GbmSurfaceFactory(use_surfaceless_)); | 130 if (!surface_factory_ozone_) |
| 131 surface_factory_ozone_.reset(new GbmSurfaceFactory(use_surfaceless_)); |
| 131 device_manager_ = CreateDeviceManager(); | 132 device_manager_ = CreateDeviceManager(); |
| 132 gpu_platform_support_host_.reset(new GpuPlatformSupportHostGbm()); | 133 gpu_platform_support_host_.reset(new GpuPlatformSupportHostGbm()); |
| 133 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone); | 134 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone); |
| 134 cursor_.reset(new DriCursor(gpu_platform_support_host_.get())); | 135 cursor_.reset(new DriCursor(gpu_platform_support_host_.get())); |
| 135 event_factory_ozone_.reset( | 136 event_factory_ozone_.reset( |
| 136 new EventFactoryEvdev(cursor_.get(), device_manager_.get())); | 137 new EventFactoryEvdev(cursor_.get(), device_manager_.get())); |
| 137 } | 138 } |
| 138 | 139 |
| 139 virtual void InitializeGPU() OVERRIDE { | 140 virtual void InitializeGPU() OVERRIDE { |
| 140 dri_.reset(new DriWrapper(kDefaultGraphicsCardPath)); | 141 dri_.reset(new DriWrapper(kDefaultGraphicsCardPath)); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 }; | 189 }; |
| 189 | 190 |
| 190 } // namespace | 191 } // namespace |
| 191 | 192 |
| 192 OzonePlatform* CreateOzonePlatformGbm() { | 193 OzonePlatform* CreateOzonePlatformGbm() { |
| 193 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 194 CommandLine* cmd = CommandLine::ForCurrentProcess(); |
| 194 return new OzonePlatformGbm(cmd->HasSwitch(switches::kOzoneUseSurfaceless)); | 195 return new OzonePlatformGbm(cmd->HasSwitch(switches::kOzoneUseSurfaceless)); |
| 195 } | 196 } |
| 196 | 197 |
| 197 } // namespace ui | 198 } // namespace ui |
| OLD | NEW |