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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 return nullptr; | 124 return nullptr; |
125 | 125 |
126 return pixmap; | 126 return pixmap; |
127 } | 127 } |
128 | 128 |
129 bool GbmSurfaceFactory::CanShowPrimaryPlaneAsOverlay() { | 129 bool GbmSurfaceFactory::CanShowPrimaryPlaneAsOverlay() { |
130 DCHECK(thread_checker_.CalledOnValidThread()); | 130 DCHECK(thread_checker_.CalledOnValidThread()); |
131 return allow_surfaceless_; | 131 return allow_surfaceless_; |
132 } | 132 } |
133 | 133 |
134 bool GbmSurfaceFactory::CanCreateNativePixmap(BufferUsage usage) { | |
135 DCHECK(thread_checker_.CalledOnValidThread()); | |
136 switch (usage) { | |
137 case MAP: | |
138 return false; | |
139 case PERSISTENT_MAP: | |
140 return false; | |
141 case SCANOUT: | |
142 return true; | |
143 } | |
144 NOTREACHED(); | |
145 return false; | |
146 } | |
147 | |
148 scoped_refptr<GbmDevice> GbmSurfaceFactory::GetGbmDevice( | 134 scoped_refptr<GbmDevice> GbmSurfaceFactory::GetGbmDevice( |
149 gfx::AcceleratedWidget widget) { | 135 gfx::AcceleratedWidget widget) { |
150 return static_cast<GbmDevice*>( | 136 return static_cast<GbmDevice*>( |
151 drm_device_manager_->GetDrmDevice(widget).get()); | 137 drm_device_manager_->GetDrmDevice(widget).get()); |
152 } | 138 } |
153 | 139 |
154 } // namespace ui | 140 } // namespace ui |
OLD | NEW |