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 #ifndef UI_OZONE_PLATFORM_DRM_GPU_DRM_BUFFER_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_DRM_BUFFER_H_ |
6 #define UI_OZONE_PLATFORM_DRM_GPU_DRM_BUFFER_H_ | 6 #define UI_OZONE_PLATFORM_DRM_GPU_DRM_BUFFER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "skia/ext/refptr.h" | 9 #include "third_party/skia/include/core/SkRefCnt.h" |
10 #include "third_party/skia/include/core/SkSurface.h" | 10 #include "third_party/skia/include/core/SkSurface.h" |
11 #include "ui/ozone/ozone_export.h" | 11 #include "ui/ozone/ozone_export.h" |
12 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h" | 12 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h" |
13 | 13 |
14 namespace ui { | 14 namespace ui { |
15 | 15 |
16 class DrmDevice; | 16 class DrmDevice; |
17 | 17 |
18 // Wrapper for a DRM allocated buffer. Keeps track of the native properties of | 18 // Wrapper for a DRM allocated buffer. Keeps track of the native properties of |
19 // the buffer and wraps the pixel memory into a SkSurface which can be used to | 19 // the buffer and wraps the pixel memory into a SkSurface which can be used to |
(...skipping 30 matching lines...) Expand all Loading... |
50 void* mmap_base_ = 0; | 50 void* mmap_base_ = 0; |
51 | 51 |
52 // Size for memory mapping. | 52 // Size for memory mapping. |
53 size_t mmap_size_ = 0; | 53 size_t mmap_size_ = 0; |
54 | 54 |
55 // Buffer ID used by the DRM modesettings API. This is set when the buffer is | 55 // Buffer ID used by the DRM modesettings API. This is set when the buffer is |
56 // registered with the CRTC. | 56 // registered with the CRTC. |
57 uint32_t framebuffer_ = 0; | 57 uint32_t framebuffer_ = 0; |
58 | 58 |
59 // Wrapper around the native pixel memory. | 59 // Wrapper around the native pixel memory. |
60 skia::RefPtr<SkSurface> surface_; | 60 sk_sp<SkSurface> surface_; |
61 | 61 |
62 DISALLOW_COPY_AND_ASSIGN(DrmBuffer); | 62 DISALLOW_COPY_AND_ASSIGN(DrmBuffer); |
63 }; | 63 }; |
64 | 64 |
65 class OZONE_EXPORT DrmBufferGenerator : public ScanoutBufferGenerator { | 65 class OZONE_EXPORT DrmBufferGenerator : public ScanoutBufferGenerator { |
66 public: | 66 public: |
67 DrmBufferGenerator(); | 67 DrmBufferGenerator(); |
68 ~DrmBufferGenerator() override; | 68 ~DrmBufferGenerator() override; |
69 | 69 |
70 // ScanoutBufferGenerator: | 70 // ScanoutBufferGenerator: |
71 scoped_refptr<ScanoutBuffer> Create(const scoped_refptr<DrmDevice>& drm, | 71 scoped_refptr<ScanoutBuffer> Create(const scoped_refptr<DrmDevice>& drm, |
72 const gfx::Size& size) override; | 72 const gfx::Size& size) override; |
73 | 73 |
74 private: | 74 private: |
75 DISALLOW_COPY_AND_ASSIGN(DrmBufferGenerator); | 75 DISALLOW_COPY_AND_ASSIGN(DrmBufferGenerator); |
76 }; | 76 }; |
77 | 77 |
78 } // namespace ui | 78 } // namespace ui |
79 | 79 |
80 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_BUFFER_H_ | 80 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_BUFFER_H_ |
OLD | NEW |