| 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" |
| 11 #include "ui/ozone/platform/drm/gpu/gbm_buffer.h" | 11 #include "ui/ozone/platform/drm/gpu/gbm_buffer.h" |
| 12 #include "ui/ozone/platform/drm/gpu/proxy_helpers.h" | 12 #include "ui/ozone/platform/drm/gpu/proxy_helpers.h" |
| 13 | 13 |
| 14 namespace ui { | 14 namespace ui { |
| 15 | 15 |
| 16 DrmThreadProxy::DrmThreadProxy() {} | 16 DrmThreadProxy::DrmThreadProxy() {} |
| 17 | 17 |
| 18 DrmThreadProxy::~DrmThreadProxy() {} | 18 DrmThreadProxy::~DrmThreadProxy() {} |
| 19 | 19 |
| 20 void DrmThreadProxy::BindThreadIntoMessagingProxy( | 20 void DrmThreadProxy::BindThreadIntoMessagingProxy( |
| 21 InterThreadMessagingProxy* messaging_proxy) { | 21 InterThreadMessagingProxy* messaging_proxy) { |
| 22 messaging_proxy->SetDrmThread(&drm_thread_); | 22 messaging_proxy->SetDrmThread(&drm_thread_); |
| 23 } | 23 } |
| 24 | 24 |
| 25 std::unique_ptr<DrmWindowProxy> DrmThreadProxy::CreateDrmWindowProxy( | 25 std::unique_ptr<DrmWindowProxy> DrmThreadProxy::CreateDrmWindowProxy( |
| 26 gfx::AcceleratedWidget widget) { | 26 gfx::AcceleratedWidget widget) { |
| 27 return base::WrapUnique(new DrmWindowProxy(widget, &drm_thread_)); | 27 return base::MakeUnique<DrmWindowProxy>(widget, &drm_thread_); |
| 28 } | 28 } |
| 29 | 29 |
| 30 scoped_refptr<GbmBuffer> DrmThreadProxy::CreateBuffer( | 30 scoped_refptr<GbmBuffer> DrmThreadProxy::CreateBuffer( |
| 31 gfx::AcceleratedWidget widget, | 31 gfx::AcceleratedWidget widget, |
| 32 const gfx::Size& size, | 32 const gfx::Size& size, |
| 33 gfx::BufferFormat format, | 33 gfx::BufferFormat format, |
| 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(), |
| (...skipping 26 matching lines...) Expand all Loading... |
| 64 } | 64 } |
| 65 | 65 |
| 66 void DrmThreadProxy::AddBinding(ozone::mojom::DeviceCursorRequest request) { | 66 void DrmThreadProxy::AddBinding(ozone::mojom::DeviceCursorRequest request) { |
| 67 drm_thread_.task_runner()->PostTask( | 67 drm_thread_.task_runner()->PostTask( |
| 68 FROM_HERE, | 68 FROM_HERE, |
| 69 base::Bind(&DrmThread::AddBinding, base::Unretained(&drm_thread_), | 69 base::Bind(&DrmThread::AddBinding, base::Unretained(&drm_thread_), |
| 70 base::Passed(&request))); | 70 base::Passed(&request))); |
| 71 } | 71 } |
| 72 | 72 |
| 73 } // namespace ui | 73 } // namespace ui |
| OLD | NEW |