| 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/gbm_surface_factory.h" | 5 #include "ui/ozone/platform/dri/gbm_surface_factory.h" |
| 6 | 6 |
| 7 #include <gbm.h> | 7 #include <gbm.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 DrmDeviceManager* drm_device_manager, | 79 DrmDeviceManager* drm_device_manager, |
| 80 DriWindowDelegateManager* window_manager) { | 80 DriWindowDelegateManager* window_manager) { |
| 81 drm_device_manager_ = drm_device_manager; | 81 drm_device_manager_ = drm_device_manager; |
| 82 window_manager_ = window_manager; | 82 window_manager_ = window_manager; |
| 83 } | 83 } |
| 84 | 84 |
| 85 intptr_t GbmSurfaceFactory::GetNativeDisplay() { | 85 intptr_t GbmSurfaceFactory::GetNativeDisplay() { |
| 86 #if defined(USE_MESA_PLATFORM_NULL) | 86 #if defined(USE_MESA_PLATFORM_NULL) |
| 87 return EGL_DEFAULT_DISPLAY; | 87 return EGL_DEFAULT_DISPLAY; |
| 88 #else | 88 #else |
| 89 scoped_refptr<GbmWrapper> gbm = GetGbmDevice(gfx::kNullAcceleratedWidget); | 89 scoped_refptr<GbmDevice> gbm = GetGbmDevice(gfx::kNullAcceleratedWidget); |
| 90 DCHECK(gbm); | 90 DCHECK(gbm); |
| 91 return reinterpret_cast<intptr_t>(gbm->device()); | 91 return reinterpret_cast<intptr_t>(gbm->device()); |
| 92 #endif | 92 #endif |
| 93 } | 93 } |
| 94 | 94 |
| 95 int GbmSurfaceFactory::GetDrmFd() { | 95 int GbmSurfaceFactory::GetDrmFd() { |
| 96 scoped_refptr<GbmDevice> gbm = GetGbmDevice(gfx::kNullAcceleratedWidget); | 96 scoped_refptr<GbmDevice> gbm = GetGbmDevice(gfx::kNullAcceleratedWidget); |
| 97 DCHECK(gbm); | 97 DCHECK(gbm); |
| 98 return gbm->get_fd(); | 98 return gbm->get_fd(); |
| 99 } | 99 } |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 return false; | 220 return false; |
| 221 } | 221 } |
| 222 | 222 |
| 223 scoped_refptr<GbmDevice> GbmSurfaceFactory::GetGbmDevice( | 223 scoped_refptr<GbmDevice> GbmSurfaceFactory::GetGbmDevice( |
| 224 gfx::AcceleratedWidget widget) { | 224 gfx::AcceleratedWidget widget) { |
| 225 return static_cast<GbmDevice*>( | 225 return static_cast<GbmDevice*>( |
| 226 drm_device_manager_->GetDrmDevice(widget).get()); | 226 drm_device_manager_->GetDrmDevice(widget).get()); |
| 227 } | 227 } |
| 228 | 228 |
| 229 } // namespace ui | 229 } // namespace ui |
| OLD | NEW |