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