aquamarine/include/aquamarine/allocator/Allocator.hpp

30 lines
1.3 KiB
C++

#pragma once
#include <hyprutils/memory/SharedPtr.hpp>
#include "../buffer/Buffer.hpp"
#include <drm_fourcc.h>
namespace Aquamarine {
class CBackend;
class CSwapchain;
struct SAllocatorBufferParams {
Hyprutils::Math::Vector2D size;
uint32_t format = DRM_FORMAT_INVALID;
bool scanout = false, cursor = false, multigpu = false;
};
enum eAllocatorType {
AQ_ALLOCATOR_TYPE_GBM = 0,
};
class IAllocator {
public:
virtual ~IAllocator() = default;
virtual Hyprutils::Memory::CSharedPointer<IBuffer> acquire(const SAllocatorBufferParams& params, Hyprutils::Memory::CSharedPointer<CSwapchain> swapchain) = 0;
virtual Hyprutils::Memory::CSharedPointer<CBackend> getBackend() = 0;
virtual int drmFD() = 0;
virtual eAllocatorType type() = 0;
};
};