| 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 |
| 11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
| 13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 14 #include "third_party/khronos/EGL/egl.h" | 14 #include "third_party/khronos/EGL/egl.h" |
| 15 #include "ui/gfx/buffer_format_util.h" | 15 #include "ui/gfx/buffer_format_util.h" |
| 16 #include "ui/gfx/native_pixmap.h" |
| 16 #include "ui/gl/gl_surface_egl.h" | 17 #include "ui/gl/gl_surface_egl.h" |
| 17 #include "ui/ozone/common/egl_util.h" | 18 #include "ui/ozone/common/egl_util.h" |
| 18 #include "ui/ozone/common/gl_ozone_egl.h" | 19 #include "ui/ozone/common/gl_ozone_egl.h" |
| 19 #include "ui/ozone/platform/drm/common/drm_util.h" | 20 #include "ui/ozone/platform/drm/common/drm_util.h" |
| 20 #include "ui/ozone/platform/drm/gpu/drm_thread_proxy.h" | 21 #include "ui/ozone/platform/drm/gpu/drm_thread_proxy.h" |
| 21 #include "ui/ozone/platform/drm/gpu/drm_window_proxy.h" | 22 #include "ui/ozone/platform/drm/gpu/drm_window_proxy.h" |
| 22 #include "ui/ozone/platform/drm/gpu/gbm_buffer.h" | 23 #include "ui/ozone/platform/drm/gpu/gbm_buffer.h" |
| 23 #include "ui/ozone/platform/drm/gpu/gbm_surface.h" | 24 #include "ui/ozone/platform/drm/gpu/gbm_surface.h" |
| 24 #include "ui/ozone/platform/drm/gpu/gbm_surfaceless.h" | 25 #include "ui/ozone/platform/drm/gpu/gbm_surfaceless.h" |
| 25 #include "ui/ozone/platform/drm/gpu/proxy_helpers.h" | 26 #include "ui/ozone/platform/drm/gpu/proxy_helpers.h" |
| 26 #include "ui/ozone/platform/drm/gpu/screen_manager.h" | 27 #include "ui/ozone/platform/drm/gpu/screen_manager.h" |
| 27 #include "ui/ozone/public/native_pixmap.h" | |
| 28 #include "ui/ozone/public/surface_ozone_canvas.h" | 28 #include "ui/ozone/public/surface_ozone_canvas.h" |
| 29 | 29 |
| 30 namespace ui { | 30 namespace ui { |
| 31 | 31 |
| 32 namespace { | 32 namespace { |
| 33 | 33 |
| 34 class GLOzoneEGLGbm : public GLOzoneEGL { | 34 class GLOzoneEGLGbm : public GLOzoneEGL { |
| 35 public: | 35 public: |
| 36 GLOzoneEGLGbm(GbmSurfaceFactory* surface_factory, | 36 GLOzoneEGLGbm(GbmSurfaceFactory* surface_factory, |
| 37 DrmThreadProxy* drm_thread_proxy) | 37 DrmThreadProxy* drm_thread_proxy) |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 } | 175 } |
| 176 | 176 |
| 177 scoped_refptr<GbmBuffer> buffer = drm_thread_proxy_->CreateBufferFromFds( | 177 scoped_refptr<GbmBuffer> buffer = drm_thread_proxy_->CreateBufferFromFds( |
| 178 widget, size, format, std::move(scoped_fds), planes); | 178 widget, size, format, std::move(scoped_fds), planes); |
| 179 if (!buffer) | 179 if (!buffer) |
| 180 return nullptr; | 180 return nullptr; |
| 181 return make_scoped_refptr(new GbmPixmap(this, buffer)); | 181 return make_scoped_refptr(new GbmPixmap(this, buffer)); |
| 182 } | 182 } |
| 183 | 183 |
| 184 } // namespace ui | 184 } // namespace ui |
| OLD | NEW |