| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 surface_factory_ozone_->InitializeGpu( | 143 surface_factory_ozone_->InitializeGpu( |
| 144 dri_.get(), buffer_generator_->device(), screen_manager_.get(), | 144 dri_.get(), buffer_generator_->device(), screen_manager_.get(), |
| 145 window_delegate_manager_.get()); | 145 window_delegate_manager_.get()); |
| 146 scoped_ptr<NativeDisplayDelegateDri> ndd( | 146 scoped_ptr<NativeDisplayDelegateDri> ndd( |
| 147 new NativeDisplayDelegateDri(dri_.get(), screen_manager_.get())); | 147 new NativeDisplayDelegateDri(dri_.get(), screen_manager_.get())); |
| 148 ndd->Initialize(); | 148 ndd->Initialize(); |
| 149 gpu_platform_support_.reset( | 149 gpu_platform_support_.reset( |
| 150 new DriGpuPlatformSupport(dri_.get(), window_delegate_manager_.get(), | 150 new DriGpuPlatformSupport(dri_.get(), window_delegate_manager_.get(), |
| 151 screen_manager_.get(), ndd.Pass())); | 151 screen_manager_.get(), ndd.Pass())); |
| 152 if (surface_factory_ozone_->InitializeHardware() != | |
| 153 DriSurfaceFactory::INITIALIZED) | |
| 154 LOG(FATAL) << "failed to initialize display hardware"; | |
| 155 } | 152 } |
| 156 | 153 |
| 157 private: | 154 private: |
| 158 bool use_surfaceless_; | 155 bool use_surfaceless_; |
| 159 scoped_ptr<DriWrapper> dri_; | 156 scoped_ptr<DriWrapper> dri_; |
| 160 scoped_ptr<GbmBufferGenerator> buffer_generator_; | 157 scoped_ptr<GbmBufferGenerator> buffer_generator_; |
| 161 scoped_ptr<ScreenManager> screen_manager_; | 158 scoped_ptr<ScreenManager> screen_manager_; |
| 162 scoped_ptr<DeviceManager> device_manager_; | 159 scoped_ptr<DeviceManager> device_manager_; |
| 163 | 160 |
| 164 scoped_ptr<GbmSurfaceFactory> surface_factory_ozone_; | 161 scoped_ptr<GbmSurfaceFactory> surface_factory_ozone_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 177 }; | 174 }; |
| 178 | 175 |
| 179 } // namespace | 176 } // namespace |
| 180 | 177 |
| 181 OzonePlatform* CreateOzonePlatformGbm() { | 178 OzonePlatform* CreateOzonePlatformGbm() { |
| 182 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 179 CommandLine* cmd = CommandLine::ForCurrentProcess(); |
| 183 return new OzonePlatformGbm(cmd->HasSwitch(switches::kOzoneUseSurfaceless)); | 180 return new OzonePlatformGbm(cmd->HasSwitch(switches::kOzoneUseSurfaceless)); |
| 184 } | 181 } |
| 185 | 182 |
| 186 } // namespace ui | 183 } // namespace ui |
| OLD | NEW |