| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 GbmSurfaceFactory::CreateSurfacelessEGLSurfaceForWidget( | 161 GbmSurfaceFactory::CreateSurfacelessEGLSurfaceForWidget( |
| 162 gfx::AcceleratedWidget widget) { | 162 gfx::AcceleratedWidget widget) { |
| 163 if (!allow_surfaceless_) | 163 if (!allow_surfaceless_) |
| 164 return scoped_ptr<SurfaceOzoneEGL>(); | 164 return scoped_ptr<SurfaceOzoneEGL>(); |
| 165 | 165 |
| 166 DriWindowDelegate* delegate = GetOrCreateWindowDelegate(widget); | 166 DriWindowDelegate* delegate = GetOrCreateWindowDelegate(widget); |
| 167 return scoped_ptr<SurfaceOzoneEGL>(new GbmSurfaceless(delegate)); | 167 return scoped_ptr<SurfaceOzoneEGL>(new GbmSurfaceless(delegate)); |
| 168 } | 168 } |
| 169 | 169 |
| 170 scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap( | 170 scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap( |
| 171 gfx::AcceleratedWidget widget, |
| 171 gfx::Size size, | 172 gfx::Size size, |
| 172 BufferFormat format, | 173 BufferFormat format, |
| 173 BufferUsage usage) { | 174 BufferUsage usage) { |
| 174 if (usage == MAP) | 175 if (usage == MAP) |
| 175 return NULL; | 176 return NULL; |
| 176 | 177 |
| 177 scoped_refptr<GbmBuffer> buffer = | 178 scoped_refptr<GbmBuffer> buffer = |
| 178 GbmBuffer::CreateBuffer(drm_, device_, format, size, true); | 179 GbmBuffer::CreateBuffer(drm_, device_, format, size, true); |
| 179 if (!buffer.get()) | 180 if (!buffer.get()) |
| 180 return NULL; | 181 return NULL; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 scoped_ptr<DriWindowDelegate> delegate( | 241 scoped_ptr<DriWindowDelegate> delegate( |
| 241 new DriWindowDelegateImpl(widget, screen_manager_)); | 242 new DriWindowDelegateImpl(widget, screen_manager_)); |
| 242 delegate->Initialize(); | 243 delegate->Initialize(); |
| 243 window_manager_->AddWindowDelegate(widget, delegate.Pass()); | 244 window_manager_->AddWindowDelegate(widget, delegate.Pass()); |
| 244 } | 245 } |
| 245 | 246 |
| 246 return window_manager_->GetWindowDelegate(widget); | 247 return window_manager_->GetWindowDelegate(widget); |
| 247 } | 248 } |
| 248 | 249 |
| 249 } // namespace ui | 250 } // namespace ui |
| OLD | NEW |