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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 if (!surface->Initialize()) | 127 if (!surface->Initialize()) |
128 return nullptr; | 128 return nullptr; |
129 | 129 |
130 return surface.Pass(); | 130 return surface.Pass(); |
131 } | 131 } |
132 | 132 |
133 scoped_ptr<SurfaceOzoneEGL> | 133 scoped_ptr<SurfaceOzoneEGL> |
134 GbmSurfaceFactory::CreateSurfacelessEGLSurfaceForWidget( | 134 GbmSurfaceFactory::CreateSurfacelessEGLSurfaceForWidget( |
135 gfx::AcceleratedWidget widget) { | 135 gfx::AcceleratedWidget widget) { |
136 if (!allow_surfaceless_) | 136 if (!allow_surfaceless_) |
137 return scoped_ptr<SurfaceOzoneEGL>(); | 137 return nullptr; |
138 | 138 |
139 DriWindowDelegate* delegate = GetOrCreateWindowDelegate(widget); | 139 DriWindowDelegate* delegate = GetOrCreateWindowDelegate(widget); |
140 return scoped_ptr<SurfaceOzoneEGL>(new GbmSurfaceless(delegate)); | 140 return scoped_ptr<SurfaceOzoneEGL>(new GbmSurfaceless(delegate)); |
141 } | 141 } |
142 | 142 |
143 scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap( | 143 scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap( |
144 gfx::AcceleratedWidget widget, | 144 gfx::AcceleratedWidget widget, |
145 gfx::Size size, | 145 gfx::Size size, |
146 BufferFormat format, | 146 BufferFormat format, |
147 BufferUsage usage) { | 147 BufferUsage usage) { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 scoped_ptr<DriWindowDelegate> delegate(new DriWindowDelegateImpl( | 214 scoped_ptr<DriWindowDelegate> delegate(new DriWindowDelegateImpl( |
215 widget, gbm_, window_manager_, screen_manager_)); | 215 widget, gbm_, window_manager_, screen_manager_)); |
216 delegate->Initialize(); | 216 delegate->Initialize(); |
217 window_manager_->AddWindowDelegate(widget, delegate.Pass()); | 217 window_manager_->AddWindowDelegate(widget, delegate.Pass()); |
218 } | 218 } |
219 | 219 |
220 return window_manager_->GetWindowDelegate(widget); | 220 return window_manager_->GetWindowDelegate(widget); |
221 } | 221 } |
222 | 222 |
223 } // namespace ui | 223 } // namespace ui |
OLD | NEW |