| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/drm/gpu/gbm_device.h" | 5 #include "ui/ozone/platform/drm/gpu/gbm_device.h" |
| 6 | 6 |
| 7 #include <gbm.h> | 7 #include <gbm.h> |
| 8 | 8 |
| 9 namespace ui { | 9 namespace ui { |
| 10 | 10 |
| 11 GbmDevice::GbmDevice(const base::FilePath& device_path, | 11 GbmDevice::GbmDevice(const base::FilePath& device_path, |
| 12 base::File file, | 12 base::File file, |
| 13 bool is_primary_device) | 13 bool is_primary_device) |
| 14 : DrmDevice(device_path, file.Pass(), is_primary_device) {} | 14 : DrmDevice(device_path, std::move(file), is_primary_device) {} |
| 15 | 15 |
| 16 GbmDevice::~GbmDevice() { | 16 GbmDevice::~GbmDevice() { |
| 17 if (device_) | 17 if (device_) |
| 18 gbm_device_destroy(device_); | 18 gbm_device_destroy(device_); |
| 19 } | 19 } |
| 20 | 20 |
| 21 bool GbmDevice::Initialize(bool use_atomic) { | 21 bool GbmDevice::Initialize(bool use_atomic) { |
| 22 if (!DrmDevice::Initialize(use_atomic)) | 22 if (!DrmDevice::Initialize(use_atomic)) |
| 23 return false; | 23 return false; |
| 24 | 24 |
| 25 device_ = gbm_create_device(get_fd()); | 25 device_ = gbm_create_device(get_fd()); |
| 26 if (!device_) { | 26 if (!device_) { |
| 27 PLOG(ERROR) << "Unable to initialize GBM for " << device_path().value(); | 27 PLOG(ERROR) << "Unable to initialize GBM for " << device_path().value(); |
| 28 return false; | 28 return false; |
| 29 } | 29 } |
| 30 | 30 |
| 31 return true; | 31 return true; |
| 32 } | 32 } |
| 33 | 33 |
| 34 } // namespace ui | 34 } // namespace ui |
| OLD | NEW |