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 | |
Tom Anderson | 374e3451 | 2019-12-10 23:27:16 | [diff] [blame^] | 5 | #ifndef UI_GFX_LINUX_GBM_DEVICE_H_ |
| 6 | #define UI_GFX_LINUX_GBM_DEVICE_H_ |
Michael Spang | 6d378be | 2018-08-01 19:11:14 | [diff] [blame] | 7 | |
Michael Spang | 2829d0d | 2019-03-21 21:10:25 | [diff] [blame] | 8 | #include <gbm.h> |
| 9 | #include <memory> |
| 10 | |
Michael Spang | 6d378be | 2018-08-01 19:11:14 | [diff] [blame] | 11 | #include "base/files/file.h" |
| 12 | #include "base/macros.h" |
Michael Spang | 20fccf3 | 2018-08-03 22:13:10 | [diff] [blame] | 13 | #include "ui/gfx/geometry/size.h" |
| 14 | #include "ui/gfx/native_pixmap_handle.h" |
Michael Spang | 6d378be | 2018-08-01 19:11:14 | [diff] [blame] | 15 | |
Michael Spang | 6d378be | 2018-08-01 19:11:14 | [diff] [blame] | 16 | namespace ui { |
| 17 | |
Michael Spang | 20fccf3 | 2018-08-03 22:13:10 | [diff] [blame] | 18 | class GbmBuffer; |
| 19 | |
Michael Spang | 6d378be | 2018-08-01 19:11:14 | [diff] [blame] | 20 | class GbmDevice { |
| 21 | public: |
Michael Spang | 20fccf3 | 2018-08-03 22:13:10 | [diff] [blame] | 22 | virtual ~GbmDevice() {} |
Michael Spang | 6d378be | 2018-08-01 19:11:14 | [diff] [blame] | 23 | |
Michael Spang | 20fccf3 | 2018-08-03 22:13:10 | [diff] [blame] | 24 | virtual std::unique_ptr<GbmBuffer> CreateBuffer(uint32_t format, |
| 25 | const gfx::Size& size, |
| 26 | uint32_t flags) = 0; |
| 27 | virtual std::unique_ptr<GbmBuffer> CreateBufferWithModifiers( |
| 28 | uint32_t format, |
| 29 | const gfx::Size& size, |
| 30 | uint32_t flags, |
| 31 | const std::vector<uint64_t>& modifiers) = 0; |
Sergey Ulanov | ac89bb9 | 2019-03-22 18:46:49 | [diff] [blame] | 32 | virtual std::unique_ptr<GbmBuffer> CreateBufferFromHandle( |
Michael Spang | 20fccf3 | 2018-08-03 22:13:10 | [diff] [blame] | 33 | uint32_t format, |
| 34 | const gfx::Size& size, |
Sergey Ulanov | ac89bb9 | 2019-03-22 18:46:49 | [diff] [blame] | 35 | gfx::NativePixmapHandle handle) = 0; |
Michael Spang | 6d378be | 2018-08-01 19:11:14 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | } // namespace ui |
| 39 | |
Tom Anderson | 374e3451 | 2019-12-10 23:27:16 | [diff] [blame^] | 40 | #endif // UI_GFX_LINUX_GBM_DEVICE_H_ |