Michael Spang | 6d378be | 2018-08-01 19:11:14 | [diff] [blame] | 1 | // Copyright 2018 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef UI_OZONE_COMMON_LINUX_GBM_DEVICE_H_ |
| 6 | #define UI_OZONE_COMMON_LINUX_GBM_DEVICE_H_ |
| 7 | |
| 8 | #include "base/files/file.h" |
| 9 | #include "base/macros.h" |
Michael Spang | 20fccf3 | 2018-08-03 22:13:10 | [diff] [blame^] | 10 | #include "ui/gfx/geometry/size.h" |
| 11 | #include "ui/gfx/native_pixmap_handle.h" |
Michael Spang | 6d378be | 2018-08-01 19:11:14 | [diff] [blame] | 12 | |
Michael Spang | 20fccf3 | 2018-08-03 22:13:10 | [diff] [blame^] | 13 | #include <gbm.h> |
Michael Spang | 6d378be | 2018-08-01 19:11:14 | [diff] [blame] | 14 | |
| 15 | namespace ui { |
| 16 | |
Michael Spang | 20fccf3 | 2018-08-03 22:13:10 | [diff] [blame^] | 17 | class GbmBuffer; |
| 18 | |
Michael Spang | 6d378be | 2018-08-01 19:11:14 | [diff] [blame] | 19 | class GbmDevice { |
| 20 | public: |
Michael Spang | 20fccf3 | 2018-08-03 22:13:10 | [diff] [blame^] | 21 | virtual ~GbmDevice() {} |
Michael Spang | 6d378be | 2018-08-01 19:11:14 | [diff] [blame] | 22 | |
Michael Spang | 20fccf3 | 2018-08-03 22:13:10 | [diff] [blame^] | 23 | virtual std::unique_ptr<GbmBuffer> CreateBuffer(uint32_t format, |
| 24 | const gfx::Size& size, |
| 25 | uint32_t flags) = 0; |
| 26 | virtual std::unique_ptr<GbmBuffer> CreateBufferWithModifiers( |
| 27 | uint32_t format, |
| 28 | const gfx::Size& size, |
| 29 | uint32_t flags, |
| 30 | const std::vector<uint64_t>& modifiers) = 0; |
| 31 | virtual std::unique_ptr<GbmBuffer> CreateBufferFromFds( |
| 32 | uint32_t format, |
| 33 | const gfx::Size& size, |
| 34 | std::vector<base::ScopedFD> fds, |
| 35 | const std::vector<gfx::NativePixmapPlane>& planes) = 0; |
Michael Spang | 6d378be | 2018-08-01 19:11:14 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | } // namespace ui |
| 39 | |
| 40 | #endif // UI_OZONE_COMMON_LINUX_GBM_DEVICE_H_ |