diff options
| author | 2021-11-11 18:38:36 -0800 | |
|---|---|---|
| committer | 2022-03-24 18:13:32 -0700 | |
| commit | c723db39c7a508ca6445c328ab85f506bce4927a (patch) | |
| tree | 03c040fcb33c81001464db349ecbecd5542a9fb0 /src/core | |
| parent | hle: nvflinger: Move implementation for Parcel to its own header. (diff) | |
| download | yuzu-c723db39c7a508ca6445c328ab85f506bce4927a.tar.gz yuzu-c723db39c7a508ca6445c328ab85f506bce4927a.tar.xz yuzu-c723db39c7a508ca6445c328ab85f506bce4927a.zip | |
hle: nvflinger: Add implementation for BufferItem class.
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | src/core/hle/service/nvflinger/buffer_item.h | 46 |
2 files changed, 47 insertions, 0 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 367d44cf3..a1139068d 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -538,6 +538,7 @@ add_library(core STATIC | |||
| 538 | hle/service/nvflinger/buffer_queue.cpp | 538 | hle/service/nvflinger/buffer_queue.cpp |
| 539 | hle/service/nvflinger/buffer_queue.h | 539 | hle/service/nvflinger/buffer_queue.h |
| 540 | hle/service/nvflinger/binder.h | 540 | hle/service/nvflinger/binder.h |
| 541 | hle/service/nvflinger/buffer_item.h | ||
| 541 | hle/service/nvflinger/buffer_queue_defs.h | 542 | hle/service/nvflinger/buffer_queue_defs.h |
| 542 | hle/service/nvflinger/buffer_transform_flags.h | 543 | hle/service/nvflinger/buffer_transform_flags.h |
| 543 | hle/service/nvflinger/consumer_listener.h | 544 | hle/service/nvflinger/consumer_listener.h |
diff --git a/src/core/hle/service/nvflinger/buffer_item.h b/src/core/hle/service/nvflinger/buffer_item.h new file mode 100644 index 000000000..9dc6f3fee --- /dev/null +++ b/src/core/hle/service/nvflinger/buffer_item.h | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-3.0-or-later | ||
| 2 | // Copyright 2021 yuzu Emulator Project | ||
| 3 | // Copyright 2014 The Android Open Source Project | ||
| 4 | // Parts of this implementation were base on: | ||
| 5 | // https://cs.android.com/android/platform/superproject/+/android-5.1.1_r38:frameworks/native/include/gui/BufferItem.h | ||
| 6 | |||
| 7 | #pragma once | ||
| 8 | |||
| 9 | #include <memory> | ||
| 10 | |||
| 11 | #include "common/common_types.h" | ||
| 12 | #include "core/hle/service/nvflinger/ui/fence.h" | ||
| 13 | #include "core/hle/service/nvflinger/ui/rect.h" | ||
| 14 | #include "core/hle/service/nvflinger/window.h" | ||
| 15 | |||
| 16 | namespace android { | ||
| 17 | |||
| 18 | class GraphicBuffer; | ||
| 19 | |||
| 20 | class BufferItem final { | ||
| 21 | public: | ||
| 22 | constexpr BufferItem() = default; | ||
| 23 | |||
| 24 | std::shared_ptr<GraphicBuffer> graphic_buffer; | ||
| 25 | Fence fence; | ||
| 26 | Rect crop; | ||
| 27 | NativeWindowTransform transform{}; | ||
| 28 | u32 scaling_mode{}; | ||
| 29 | s64 timestamp{}; | ||
| 30 | bool is_auto_timestamp{}; | ||
| 31 | u64 frame_number{}; | ||
| 32 | |||
| 33 | // The default value for buf, used to indicate this doesn't correspond to a slot. | ||
| 34 | static constexpr s32 INVALID_BUFFER_SLOT = -1; | ||
| 35 | union { | ||
| 36 | s32 slot{INVALID_BUFFER_SLOT}; | ||
| 37 | s32 buf; | ||
| 38 | }; | ||
| 39 | |||
| 40 | bool is_droppable{}; | ||
| 41 | bool acquire_called{}; | ||
| 42 | bool transform_to_display_inverse{}; | ||
| 43 | s32 swap_interval{}; | ||
| 44 | }; | ||
| 45 | |||
| 46 | } // namespace android | ||