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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 } | 113 } |
114 scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() override { | 114 scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() override { |
115 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateProxy( | 115 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateProxy( |
116 gpu_platform_support_host_.get(), device_manager_.get(), | 116 gpu_platform_support_host_.get(), device_manager_.get(), |
117 display_manager_.get())); | 117 display_manager_.get())); |
118 } | 118 } |
119 void InitializeUI() override { | 119 void InitializeUI() override { |
120 display_manager_.reset(new DisplayManager()); | 120 display_manager_.reset(new DisplayManager()); |
121 // Needed since the browser process creates the accelerated widgets and that | 121 // Needed since the browser process creates the accelerated widgets and that |
122 // happens through SFO. | 122 // happens through SFO. |
123 surface_factory_ozone_.reset(new GbmSurfaceFactory(use_surfaceless_)); | 123 if (!surface_factory_ozone_) |
| 124 surface_factory_ozone_.reset(new GbmSurfaceFactory(use_surfaceless_)); |
124 device_manager_ = CreateDeviceManager(); | 125 device_manager_ = CreateDeviceManager(); |
125 gpu_platform_support_host_.reset(new DriGpuPlatformSupportHost()); | 126 gpu_platform_support_host_.reset(new DriGpuPlatformSupportHost()); |
126 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone); | 127 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone); |
127 window_manager_.reset( | 128 window_manager_.reset( |
128 new DriWindowManager(gpu_platform_support_host_.get())); | 129 new DriWindowManager(gpu_platform_support_host_.get())); |
129 event_factory_ozone_.reset(new EventFactoryEvdev(window_manager_->cursor(), | 130 event_factory_ozone_.reset(new EventFactoryEvdev(window_manager_->cursor(), |
130 device_manager_.get())); | 131 device_manager_.get())); |
131 } | 132 } |
132 | 133 |
133 void InitializeGPU() override { | 134 void InitializeGPU() override { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 }; | 175 }; |
175 | 176 |
176 } // namespace | 177 } // namespace |
177 | 178 |
178 OzonePlatform* CreateOzonePlatformGbm() { | 179 OzonePlatform* CreateOzonePlatformGbm() { |
179 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 180 CommandLine* cmd = CommandLine::ForCurrentProcess(); |
180 return new OzonePlatformGbm(cmd->HasSwitch(switches::kOzoneUseSurfaceless)); | 181 return new OzonePlatformGbm(cmd->HasSwitch(switches::kOzoneUseSurfaceless)); |
181 } | 182 } |
182 | 183 |
183 } // namespace ui | 184 } // namespace ui |
OLD | NEW |