| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/drm_thread_proxy.h" | 5 #include "ui/ozone/platform/drm/gpu/drm_thread_proxy.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "ui/ozone/platform/drm/gpu/drm_thread_message_proxy.h" | 9 #include "ui/ozone/platform/drm/gpu/drm_thread_message_proxy.h" |
| 10 #include "ui/ozone/platform/drm/gpu/drm_window_proxy.h" | 10 #include "ui/ozone/platform/drm/gpu/drm_window_proxy.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 gfx::BufferUsage usage) { | 34 gfx::BufferUsage usage) { |
| 35 scoped_refptr<GbmBuffer> buffer; | 35 scoped_refptr<GbmBuffer> buffer; |
| 36 PostSyncTask( | 36 PostSyncTask( |
| 37 drm_thread_.task_runner(), | 37 drm_thread_.task_runner(), |
| 38 base::Bind(&DrmThread::CreateBuffer, base::Unretained(&drm_thread_), | 38 base::Bind(&DrmThread::CreateBuffer, base::Unretained(&drm_thread_), |
| 39 widget, size, format, usage, &buffer)); | 39 widget, size, format, usage, &buffer)); |
| 40 return buffer; | 40 return buffer; |
| 41 } | 41 } |
| 42 | 42 |
| 43 scoped_refptr<GbmBuffer> DrmThreadProxy::CreateBufferFromFds( | 43 scoped_refptr<GbmBuffer> DrmThreadProxy::CreateBufferFromFds( |
| 44 gfx::AcceleratedWidget widget, |
| 44 const gfx::Size& size, | 45 const gfx::Size& size, |
| 45 gfx::BufferFormat format, | 46 gfx::BufferFormat format, |
| 46 std::vector<base::ScopedFD>&& fds, | 47 std::vector<base::ScopedFD>&& fds, |
| 47 std::vector<int> strides, | 48 std::vector<int> strides, |
| 48 std::vector<int> offsets) { | 49 std::vector<int> offsets) { |
| 49 scoped_refptr<GbmBuffer> buffer; | 50 scoped_refptr<GbmBuffer> buffer; |
| 50 PostSyncTask( | 51 PostSyncTask( |
| 51 drm_thread_.task_runner(), | 52 drm_thread_.task_runner(), |
| 52 base::Bind(&DrmThread::CreateBufferFromFds, | 53 base::Bind(&DrmThread::CreateBufferFromFds, |
| 53 base::Unretained(&drm_thread_), size, format, | 54 base::Unretained(&drm_thread_), widget, size, format, |
| 54 base::Passed(std::move(fds)), strides, offsets, &buffer)); | 55 base::Passed(std::move(fds)), strides, offsets, &buffer)); |
| 55 return buffer; | 56 return buffer; |
| 56 } | 57 } |
| 57 | 58 |
| 58 void DrmThreadProxy::GetScanoutFormats( | 59 void DrmThreadProxy::GetScanoutFormats( |
| 59 gfx::AcceleratedWidget widget, | 60 gfx::AcceleratedWidget widget, |
| 60 std::vector<gfx::BufferFormat>* scanout_formats) { | 61 std::vector<gfx::BufferFormat>* scanout_formats) { |
| 61 PostSyncTask( | 62 PostSyncTask( |
| 62 drm_thread_.task_runner(), | 63 drm_thread_.task_runner(), |
| 63 base::Bind(&DrmThread::GetScanoutFormats, base::Unretained(&drm_thread_), | 64 base::Bind(&DrmThread::GetScanoutFormats, base::Unretained(&drm_thread_), |
| 64 widget, scanout_formats)); | 65 widget, scanout_formats)); |
| 65 } | 66 } |
| 66 | 67 |
| 67 } // namespace ui | 68 } // namespace ui |
| OLD | NEW |