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