summaryrefslogtreecommitdiff
path: root/src/render/Texture.hpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2024-11-14 20:15:51 +0000
committerGitHub <noreply@github.com>2024-11-14 20:15:51 +0000
commit20031cea92417a852410827a5cdb4adbcaee4342 (patch)
tree665917c3c02f5de7311c27110ec4e76eb5becd6c /src/render/Texture.hpp
parent3fb47372b79265ebdabeeefdad10359d5b18377a (diff)
pointer: add drm dumb buffers for cursors (#8399)
--------- Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
Diffstat (limited to 'src/render/Texture.hpp')
-rw-r--r--src/render/Texture.hpp34
1 files changed, 20 insertions, 14 deletions
diff --git a/src/render/Texture.hpp b/src/render/Texture.hpp
index e0ef5503..ae949d5f 100644
--- a/src/render/Texture.hpp
+++ b/src/render/Texture.hpp
@@ -24,26 +24,32 @@ class CTexture {
CTexture(const CTexture&&) = delete;
CTexture(const CTexture&) = delete;
- CTexture(uint32_t drmFormat, uint8_t* pixels, uint32_t stride, const Vector2D& size);
+ CTexture(uint32_t drmFormat, uint8_t* pixels, uint32_t stride, const Vector2D& size, bool keepDataCopy = false);
- CTexture(const SP<Aquamarine::IBuffer> buffer);
+ CTexture(const SP<Aquamarine::IBuffer> buffer, bool keepDataCopy = false);
// this ctor takes ownership of the eglImage.
CTexture(const Aquamarine::SDMABUFAttrs&, void* image);
~CTexture();
- void destroyTexture();
- void allocate();
- void update(uint32_t drmFormat, uint8_t* pixels, uint32_t stride, const CRegion& damage);
+ void destroyTexture();
+ void allocate();
+ void update(uint32_t drmFormat, uint8_t* pixels, uint32_t stride, const CRegion& damage);
+ const std::vector<uint8_t>& dataCopy();
- TEXTURETYPE m_iType = TEXTURE_RGBA;
- GLenum m_iTarget = GL_TEXTURE_2D;
- GLuint m_iTexID = 0;
- Vector2D m_vSize = {};
- void* m_pEglImage = nullptr;
- eTransform m_eTransform = HYPRUTILS_TRANSFORM_NORMAL;
- bool m_bOpaque = false;
+ TEXTURETYPE m_iType = TEXTURE_RGBA;
+ GLenum m_iTarget = GL_TEXTURE_2D;
+ GLuint m_iTexID = 0;
+ Vector2D m_vSize = {};
+ void* m_pEglImage = nullptr;
+ eTransform m_eTransform = HYPRUTILS_TRANSFORM_NORMAL;
+ bool m_bOpaque = false;
+ uint32_t m_iDrmFormat = 0; // for shm
private:
- void createFromShm(uint32_t drmFormat, uint8_t* pixels, uint32_t stride, const Vector2D& size);
- void createFromDma(const Aquamarine::SDMABUFAttrs&, void* image);
+ void createFromShm(uint32_t drmFormat, uint8_t* pixels, uint32_t stride, const Vector2D& size);
+ void createFromDma(const Aquamarine::SDMABUFAttrs&, void* image);
+
+ bool m_bKeepDataCopy = false;
+
+ std::vector<uint8_t> m_vDataCopy;
}; \ No newline at end of file