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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 131 |
132 return surface.Pass(); | 132 return surface.Pass(); |
133 } | 133 } |
134 | 134 |
135 scoped_ptr<SurfaceOzoneEGL> | 135 scoped_ptr<SurfaceOzoneEGL> |
136 GbmSurfaceFactory::CreateSurfacelessEGLSurfaceForWidget( | 136 GbmSurfaceFactory::CreateSurfacelessEGLSurfaceForWidget( |
137 gfx::AcceleratedWidget widget) { | 137 gfx::AcceleratedWidget widget) { |
138 if (!allow_surfaceless_) | 138 if (!allow_surfaceless_) |
139 return nullptr; | 139 return nullptr; |
140 | 140 |
141 return scoped_ptr<SurfaceOzoneEGL>( | 141 return make_scoped_ptr( |
142 new GbmSurfaceless(window_manager_->GetWindowDelegate(widget))); | 142 new GbmSurfaceless(window_manager_->GetWindowDelegate(widget))); |
143 } | 143 } |
144 | 144 |
145 scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap( | 145 scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap( |
146 gfx::AcceleratedWidget widget, | 146 gfx::AcceleratedWidget widget, |
147 gfx::Size size, | 147 gfx::Size size, |
148 BufferFormat format, | 148 BufferFormat format, |
149 BufferUsage usage) { | 149 BufferUsage usage) { |
150 if (usage == MAP) | 150 if (usage == MAP) |
151 return nullptr; | 151 return nullptr; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 return false; | 213 return false; |
214 } | 214 } |
215 | 215 |
216 scoped_refptr<GbmWrapper> GbmSurfaceFactory::GetGbmDevice( | 216 scoped_refptr<GbmWrapper> GbmSurfaceFactory::GetGbmDevice( |
217 gfx::AcceleratedWidget widget) { | 217 gfx::AcceleratedWidget widget) { |
218 return static_cast<GbmWrapper*>( | 218 return static_cast<GbmWrapper*>( |
219 drm_device_manager_->GetDrmDevice(widget).get()); | 219 drm_device_manager_->GetDrmDevice(widget).get()); |
220 } | 220 } |
221 | 221 |
222 } // namespace ui | 222 } // namespace ui |
OLD | NEW |