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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 make_scoped_ptr(new StubKeyboardLayoutEngine())); | 145 make_scoped_ptr(new StubKeyboardLayoutEngine())); |
146 #endif | 146 #endif |
147 event_factory_ozone_.reset(new EventFactoryEvdev( | 147 event_factory_ozone_.reset(new EventFactoryEvdev( |
148 cursor_.get(), device_manager_.get(), | 148 cursor_.get(), device_manager_.get(), |
149 KeyboardLayoutEngineManager::GetKeyboardLayoutEngine())); | 149 KeyboardLayoutEngineManager::GetKeyboardLayoutEngine())); |
150 } | 150 } |
151 | 151 |
152 void InitializeGPU() override { | 152 void InitializeGPU() override { |
153 gl_api_loader_.reset(new GlApiLoader()); | 153 gl_api_loader_.reset(new GlApiLoader()); |
154 // Async page flips are supported only on surfaceless mode. | 154 // Async page flips are supported only on surfaceless mode. |
155 gbm_.reset(new GbmWrapper(kDefaultGraphicsCardPath, !use_surfaceless_)); | 155 gbm_.reset(new GbmWrapper(kDefaultGraphicsCardPath)); |
156 gbm_->Initialize(); | 156 gbm_->Initialize(); |
157 buffer_generator_.reset(new GbmBufferGenerator()); | 157 buffer_generator_.reset(new GbmBufferGenerator()); |
158 screen_manager_.reset( | 158 screen_manager_.reset( |
159 new ScreenManager(gbm_.get(), buffer_generator_.get())); | 159 new ScreenManager(gbm_.get(), buffer_generator_.get())); |
160 window_delegate_manager_.reset(new DriWindowDelegateManager()); | 160 window_delegate_manager_.reset(new DriWindowDelegateManager()); |
161 if (!surface_factory_ozone_) | 161 if (!surface_factory_ozone_) |
162 surface_factory_ozone_.reset(new GbmSurfaceFactory(use_surfaceless_)); | 162 surface_factory_ozone_.reset(new GbmSurfaceFactory(use_surfaceless_)); |
163 | 163 |
164 surface_factory_ozone_->InitializeGpu(gbm_.get(), screen_manager_.get(), | 164 surface_factory_ozone_->InitializeGpu(gbm_.get(), screen_manager_.get(), |
165 window_delegate_manager_.get()); | 165 window_delegate_manager_.get()); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 OzonePlatform* CreateOzonePlatformGbm() { | 204 OzonePlatform* CreateOzonePlatformGbm() { |
205 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); | 205 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); |
206 #if defined(USE_MESA_PLATFORM_NULL) | 206 #if defined(USE_MESA_PLATFORM_NULL) |
207 // Only works with surfaceless. | 207 // Only works with surfaceless. |
208 cmd->AppendSwitch(switches::kOzoneUseSurfaceless); | 208 cmd->AppendSwitch(switches::kOzoneUseSurfaceless); |
209 #endif | 209 #endif |
210 return new OzonePlatformGbm(cmd->HasSwitch(switches::kOzoneUseSurfaceless)); | 210 return new OzonePlatformGbm(cmd->HasSwitch(switches::kOzoneUseSurfaceless)); |
211 } | 211 } |
212 | 212 |
213 } // namespace ui | 213 } // namespace ui |
OLD | NEW |