| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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) { | 153 bool GbmSurfaceFactory::CanCreateNativePixmap(BufferUsage usage) { |
| 154 DCHECK(thread_checker_.CalledOnValidThread()); | 154 DCHECK(thread_checker_.CalledOnValidThread()); |
| 155 switch (usage) { | 155 switch (usage) { |
| 156 case MAP: | 156 case MAP: |
| 157 return false; | 157 return false; |
| 158 case PERSISTENT_MAP: |
| 159 return false; |
| 158 case SCANOUT: | 160 case SCANOUT: |
| 159 return true; | 161 return true; |
| 160 } | 162 } |
| 161 NOTREACHED(); | 163 NOTREACHED(); |
| 162 return false; | 164 return false; |
| 163 } | 165 } |
| 164 | 166 |
| 165 scoped_refptr<GbmDevice> GbmSurfaceFactory::GetGbmDevice( | 167 scoped_refptr<GbmDevice> GbmSurfaceFactory::GetGbmDevice( |
| 166 gfx::AcceleratedWidget widget) { | 168 gfx::AcceleratedWidget widget) { |
| 167 return static_cast<GbmDevice*>( | 169 return static_cast<GbmDevice*>( |
| 168 drm_device_manager_->GetDrmDevice(widget).get()); | 170 drm_device_manager_->GetDrmDevice(widget).get()); |
| 169 } | 171 } |
| 170 | 172 |
| 171 } // namespace ui | 173 } // namespace ui |
| OLD | NEW |