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 #ifndef UI_OZONE_PLATFORM_DRM_GPU_DRM_THREAD_PROXY_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_DRM_THREAD_PROXY_H_ |
6 #define UI_OZONE_PLATFORM_DRM_GPU_DRM_THREAD_PROXY_H_ | 6 #define UI_OZONE_PLATFORM_DRM_GPU_DRM_THREAD_PROXY_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "ui/ozone/platform/drm/gpu/drm_thread.h" | 12 #include "ui/ozone/platform/drm/gpu/drm_thread.h" |
12 | 13 |
13 namespace ui { | 14 namespace ui { |
14 | 15 |
15 class DrmWindowProxy; | 16 class DrmWindowProxy; |
16 class InterThreadMessagingProxy; | 17 class InterThreadMessagingProxy; |
17 | 18 |
18 // Mediates the communication between GPU main/IO threads and the DRM thread. It | 19 // Mediates the communication between GPU main/IO threads and the DRM thread. It |
19 // serves proxy objects that are safe to call on the GPU threads. The proxy | 20 // serves proxy objects that are safe to call on the GPU threads. The proxy |
20 // objects then deal with safely posting the messages to the DRM thread. | 21 // objects then deal with safely posting the messages to the DRM thread. |
21 class DrmThreadProxy { | 22 class DrmThreadProxy { |
22 public: | 23 public: |
23 explicit DrmThreadProxy(); | 24 explicit DrmThreadProxy(); |
24 ~DrmThreadProxy(); | 25 ~DrmThreadProxy(); |
25 | 26 |
26 void BindThreadIntoMessagingProxy(InterThreadMessagingProxy* messaging_proxy); | 27 void BindThreadIntoMessagingProxy(InterThreadMessagingProxy* messaging_proxy); |
27 | 28 |
28 scoped_ptr<DrmWindowProxy> CreateDrmWindowProxy( | 29 std::unique_ptr<DrmWindowProxy> CreateDrmWindowProxy( |
29 gfx::AcceleratedWidget widget); | 30 gfx::AcceleratedWidget widget); |
30 | 31 |
31 scoped_refptr<GbmBuffer> CreateBuffer(gfx::AcceleratedWidget widget, | 32 scoped_refptr<GbmBuffer> CreateBuffer(gfx::AcceleratedWidget widget, |
32 const gfx::Size& size, | 33 const gfx::Size& size, |
33 gfx::BufferFormat format, | 34 gfx::BufferFormat format, |
34 gfx::BufferUsage usage); | 35 gfx::BufferUsage usage); |
35 | 36 |
36 scoped_refptr<GbmBuffer> CreateBufferFromFD(const gfx::Size& size, | 37 scoped_refptr<GbmBuffer> CreateBufferFromFD(const gfx::Size& size, |
37 gfx::BufferFormat format, | 38 gfx::BufferFormat format, |
38 base::ScopedFD fd, | 39 base::ScopedFD fd, |
39 int stride); | 40 int stride); |
40 | 41 |
41 void GetScanoutFormats(gfx::AcceleratedWidget widget, | 42 void GetScanoutFormats(gfx::AcceleratedWidget widget, |
42 std::vector<gfx::BufferFormat>* scanout_formats); | 43 std::vector<gfx::BufferFormat>* scanout_formats); |
43 | 44 |
44 private: | 45 private: |
45 DrmThread drm_thread_; | 46 DrmThread drm_thread_; |
46 | 47 |
47 DISALLOW_COPY_AND_ASSIGN(DrmThreadProxy); | 48 DISALLOW_COPY_AND_ASSIGN(DrmThreadProxy); |
48 }; | 49 }; |
49 | 50 |
50 } // namespace ui | 51 } // namespace ui |
51 | 52 |
52 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_THREAD_PROXY_H_ | 53 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_THREAD_PROXY_H_ |
OLD | NEW |