| 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/drm/gpu/gbm_surface_factory.h" | 5 #include "ui/ozone/platform/drm/gpu/gbm_surface_factory.h" |
| 6 | 6 |
| 7 #include <gbm.h> | 7 #include <gbm.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 } | 47 } |
| 48 | 48 |
| 49 GbmSurfaceless* GbmSurfaceFactory::GetSurface( | 49 GbmSurfaceless* GbmSurfaceFactory::GetSurface( |
| 50 gfx::AcceleratedWidget widget) const { | 50 gfx::AcceleratedWidget widget) const { |
| 51 DCHECK(thread_checker_.CalledOnValidThread()); | 51 DCHECK(thread_checker_.CalledOnValidThread()); |
| 52 auto it = widget_to_surface_map_.find(widget); | 52 auto it = widget_to_surface_map_.find(widget); |
| 53 DCHECK(it != widget_to_surface_map_.end()); | 53 DCHECK(it != widget_to_surface_map_.end()); |
| 54 return it->second; | 54 return it->second; |
| 55 } | 55 } |
| 56 | 56 |
| 57 bool GbmSurfaceFactory::UseNewSurfaceAPI() { | |
| 58 return true; | |
| 59 } | |
| 60 | |
| 61 scoped_refptr<gl::GLSurface> GbmSurfaceFactory::CreateViewGLSurface( | 57 scoped_refptr<gl::GLSurface> GbmSurfaceFactory::CreateViewGLSurface( |
| 62 gl::GLImplementation implementation, | 58 gl::GLImplementation implementation, |
| 63 gfx::AcceleratedWidget widget) { | 59 gfx::AcceleratedWidget widget) { |
| 64 DCHECK(thread_checker_.CalledOnValidThread()); | 60 DCHECK(thread_checker_.CalledOnValidThread()); |
| 65 | 61 |
| 66 if (implementation != gl::kGLImplementationEGLGLES2) { | 62 if (implementation != gl::kGLImplementationEGLGLES2) { |
| 67 NOTREACHED(); | 63 NOTREACHED(); |
| 68 return nullptr; | 64 return nullptr; |
| 69 } | 65 } |
| 70 | 66 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 } | 165 } |
| 170 | 166 |
| 171 scoped_refptr<GbmBuffer> buffer = drm_thread_->CreateBufferFromFds( | 167 scoped_refptr<GbmBuffer> buffer = drm_thread_->CreateBufferFromFds( |
| 172 widget, size, format, std::move(scoped_fds), planes); | 168 widget, size, format, std::move(scoped_fds), planes); |
| 173 if (!buffer) | 169 if (!buffer) |
| 174 return nullptr; | 170 return nullptr; |
| 175 return make_scoped_refptr(new GbmPixmap(this, buffer)); | 171 return make_scoped_refptr(new GbmPixmap(this, buffer)); |
| 176 } | 172 } |
| 177 | 173 |
| 178 } // namespace ui | 174 } // namespace ui |
| OLD | NEW |