buffer_item.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. #pragma once
  7. #include <memory>
  8. #include "common/common_types.h"
  9. #include "core/hle/service/nvflinger/ui/fence.h"
  10. #include "core/hle/service/nvflinger/ui/rect.h"
  11. #include "core/hle/service/nvflinger/window.h"
  12. namespace Service::android {
  13. class GraphicBuffer;
  14. class BufferItem final {
  15. public:
  16. constexpr BufferItem() = default;
  17. std::shared_ptr<GraphicBuffer> graphic_buffer;
  18. Fence fence;
  19. Rect crop;
  20. NativeWindowTransform transform{};
  21. u32 scaling_mode{};
  22. s64 timestamp{};
  23. bool is_auto_timestamp{};
  24. u64 frame_number{};
  25. // The default value for buf, used to indicate this doesn't correspond to a slot.
  26. static constexpr s32 INVALID_BUFFER_SLOT = -1;
  27. union {
  28. s32 slot{INVALID_BUFFER_SLOT};
  29. s32 buf;
  30. };
  31. bool is_droppable{};
  32. bool acquire_called{};
  33. bool transform_to_display_inverse{};
  34. s32 swap_interval{};
  35. };
  36. } // namespace Service::android