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/gbm_surface_factory.h" | 5 #include "ui/ozone/platform/drm/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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 OverlayPlane(pixmap->buffer(), plane_z_order, plane_transform, | 202 OverlayPlane(pixmap->buffer(), plane_z_order, plane_transform, |
203 display_bounds, crop_rect)); | 203 display_bounds, crop_rect)); |
204 return true; | 204 return true; |
205 } | 205 } |
206 | 206 |
207 bool GbmSurfaceFactory::CanShowPrimaryPlaneAsOverlay() { | 207 bool GbmSurfaceFactory::CanShowPrimaryPlaneAsOverlay() { |
208 DCHECK(thread_checker_.CalledOnValidThread()); | 208 DCHECK(thread_checker_.CalledOnValidThread()); |
209 return allow_surfaceless_; | 209 return allow_surfaceless_; |
210 } | 210 } |
211 | 211 |
212 bool GbmSurfaceFactory::CanCreateNativePixmap(BufferUsage usage) { | |
213 DCHECK(thread_checker_.CalledOnValidThread()); | |
214 switch (usage) { | |
215 case MAP: | |
216 return false; | |
217 case SCANOUT: | |
218 return true; | |
219 } | |
220 NOTREACHED(); | |
221 return false; | |
222 } | |
223 | |
224 scoped_refptr<GbmDevice> GbmSurfaceFactory::GetGbmDevice( | 212 scoped_refptr<GbmDevice> GbmSurfaceFactory::GetGbmDevice( |
225 gfx::AcceleratedWidget widget) { | 213 gfx::AcceleratedWidget widget) { |
226 return static_cast<GbmDevice*>( | 214 return static_cast<GbmDevice*>( |
227 drm_device_manager_->GetDrmDevice(widget).get()); | 215 drm_device_manager_->GetDrmDevice(widget).get()); |
228 } | 216 } |
229 | 217 |
230 } // namespace ui | 218 } // namespace ui |
OLD | NEW |