| 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/drm/gpu/gbm_surface_factory.h" | 5 #include "ui/ozone/platform/drm/gpu/gbm_surface_factory.h" |
| 6 | 6 |
| 7 #include <gbm.h> | 7 #include <gbm.h> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "third_party/khronos/EGL/egl.h" | 10 #include "third_party/khronos/EGL/egl.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 OverlayPlane(pixmap->buffer(), plane_z_order, plane_transform, | 143 OverlayPlane(pixmap->buffer(), plane_z_order, plane_transform, |
| 144 display_bounds, crop_rect)); | 144 display_bounds, crop_rect)); |
| 145 return true; | 145 return true; |
| 146 } | 146 } |
| 147 | 147 |
| 148 bool GbmSurfaceFactory::CanShowPrimaryPlaneAsOverlay() { | 148 bool GbmSurfaceFactory::CanShowPrimaryPlaneAsOverlay() { |
| 149 DCHECK(thread_checker_.CalledOnValidThread()); | 149 DCHECK(thread_checker_.CalledOnValidThread()); |
| 150 return allow_surfaceless_; | 150 return allow_surfaceless_; |
| 151 } | 151 } |
| 152 | 152 |
| 153 bool GbmSurfaceFactory::CanCreateNativePixmap(BufferUsage usage) { | |
| 154 DCHECK(thread_checker_.CalledOnValidThread()); | |
| 155 switch (usage) { | |
| 156 case MAP: | |
| 157 return false; | |
| 158 case PERSISTENT_MAP: | |
| 159 return false; | |
| 160 case SCANOUT: | |
| 161 return true; | |
| 162 } | |
| 163 NOTREACHED(); | |
| 164 return false; | |
| 165 } | |
| 166 | |
| 167 scoped_refptr<GbmDevice> GbmSurfaceFactory::GetGbmDevice( | 153 scoped_refptr<GbmDevice> GbmSurfaceFactory::GetGbmDevice( |
| 168 gfx::AcceleratedWidget widget) { | 154 gfx::AcceleratedWidget widget) { |
| 169 return static_cast<GbmDevice*>( | 155 return static_cast<GbmDevice*>( |
| 170 drm_device_manager_->GetDrmDevice(widget).get()); | 156 drm_device_manager_->GetDrmDevice(widget).get()); |
| 171 } | 157 } |
| 172 | 158 |
| 173 } // namespace ui | 159 } // namespace ui |
| OLD | NEW |