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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 } | 146 } |
147 | 147 |
148 scoped_ptr<SurfaceOzoneEGL> GbmSurfaceFactory::CreateEGLSurfaceForWidget( | 148 scoped_ptr<SurfaceOzoneEGL> GbmSurfaceFactory::CreateEGLSurfaceForWidget( |
149 gfx::AcceleratedWidget widget) { | 149 gfx::AcceleratedWidget widget) { |
150 DCHECK(state_ == INITIALIZED); | 150 DCHECK(state_ == INITIALIZED); |
151 | 151 |
152 DriWindowDelegate* delegate = GetOrCreateWindowDelegate(widget); | 152 DriWindowDelegate* delegate = GetOrCreateWindowDelegate(widget); |
153 | 153 |
154 scoped_ptr<GbmSurface> surface(new GbmSurface(delegate, device_, drm_)); | 154 scoped_ptr<GbmSurface> surface(new GbmSurface(delegate, device_, drm_)); |
155 if (!surface->Initialize()) | 155 if (!surface->Initialize()) |
156 return scoped_ptr<SurfaceOzoneEGL>(); | 156 return nullptr; |
157 | 157 |
158 return surface.PassAs<SurfaceOzoneEGL>(); | 158 return surface.Pass(); |
159 } | 159 } |
160 | 160 |
161 scoped_ptr<SurfaceOzoneEGL> | 161 scoped_ptr<SurfaceOzoneEGL> |
162 GbmSurfaceFactory::CreateSurfacelessEGLSurfaceForWidget( | 162 GbmSurfaceFactory::CreateSurfacelessEGLSurfaceForWidget( |
163 gfx::AcceleratedWidget widget) { | 163 gfx::AcceleratedWidget widget) { |
164 if (!allow_surfaceless_) | 164 if (!allow_surfaceless_) |
165 return scoped_ptr<SurfaceOzoneEGL>(); | 165 return scoped_ptr<SurfaceOzoneEGL>(); |
166 | 166 |
167 DriWindowDelegate* delegate = GetOrCreateWindowDelegate(widget); | 167 DriWindowDelegate* delegate = GetOrCreateWindowDelegate(widget); |
168 return scoped_ptr<SurfaceOzoneEGL>(new GbmSurfaceless(delegate)); | 168 return scoped_ptr<SurfaceOzoneEGL>(new GbmSurfaceless(delegate)); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 scoped_ptr<DriWindowDelegate> delegate( | 222 scoped_ptr<DriWindowDelegate> delegate( |
223 new DriWindowDelegateImpl(widget, screen_manager_)); | 223 new DriWindowDelegateImpl(widget, screen_manager_)); |
224 delegate->Initialize(); | 224 delegate->Initialize(); |
225 window_manager_->AddWindowDelegate(widget, delegate.Pass()); | 225 window_manager_->AddWindowDelegate(widget, delegate.Pass()); |
226 } | 226 } |
227 | 227 |
228 return window_manager_->GetWindowDelegate(widget); | 228 return window_manager_->GetWindowDelegate(widget); |
229 } | 229 } |
230 | 230 |
231 } // namespace ui | 231 } // namespace ui |
OLD | NEW |