| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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)); | 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(), |
| 165 window_delegate_manager_.get()); | 165 window_delegate_manager_.get()); |
| 166 scoped_ptr<NativeDisplayDelegateDri> ndd( | 166 scoped_ptr<NativeDisplayDelegateDri> ndd( |
| 167 new NativeDisplayDelegateDri(gbm_.get(), screen_manager_.get())); | 167 new NativeDisplayDelegateDri(gbm_.get(), screen_manager_.get())); |
| 168 ndd->Initialize(); | 168 ndd->Initialize(); |
| 169 gpu_platform_support_.reset( | 169 gpu_platform_support_.reset( |
| 170 new DriGpuPlatformSupport(gbm_.get(), window_delegate_manager_.get(), | 170 new DriGpuPlatformSupport(gbm_.get(), window_delegate_manager_.get(), |
| 171 screen_manager_.get(), ndd.Pass())); | 171 screen_manager_.get(), ndd.Pass())); |
| 172 } | 172 } |
| 173 | 173 |
| 174 private: | 174 private: |
| (...skipping 29 matching lines...) Expand all 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 |