diff options
author | Vaxry <[email protected]> | 2024-06-08 10:07:59 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2024-06-08 10:07:59 +0200 |
commit | 6967a31450441fc5605c05db6f65505dace4b263 (patch) | |
tree | 255a3cff7f3e2eb8a50c952eab9b270a7937561d /src/hyprerror | |
parent | c31d9ef4172452f6f219f91d9b87a24d91f0cf3a (diff) | |
download | Hyprland-6967a31450441fc5605c05db6f65505dace4b263.tar.gz Hyprland-6967a31450441fc5605c05db6f65505dace4b263.zip |
wayland/core: move to new impl (#6268)
* wayland/core/dmabuf: move to new impl
it's the final countdown
Diffstat (limited to 'src/hyprerror')
-rw-r--r-- | src/hyprerror/HyprError.cpp | 15 | ||||
-rw-r--r-- | src/hyprerror/HyprError.hpp | 2 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/hyprerror/HyprError.cpp b/src/hyprerror/HyprError.cpp index d147a6bb..a325d858 100644 --- a/src/hyprerror/HyprError.cpp +++ b/src/hyprerror/HyprError.cpp @@ -22,6 +22,8 @@ CHyprError::CHyprError() { if (m_fFadeOpacity.isBeingAnimated() || m_bMonitorChanged) g_pHyprRenderer->damageBox(&m_bDamageBox); }); + + m_pTexture = makeShared<CTexture>(); } CHyprError::~CHyprError() { @@ -34,9 +36,8 @@ void CHyprError::queueCreate(std::string message, const CColor& color) { } void CHyprError::createQueued() { - if (m_bIsCreated) { - m_tTexture.destroyTexture(); - } + if (m_bIsCreated) + m_pTexture->destroyTexture(); m_fFadeOpacity.setConfig(g_pConfigManager->getAnimationPropertyConfig("fadeIn")); @@ -136,8 +137,8 @@ void CHyprError::createQueued() { // copy the data to an OpenGL texture we have const auto DATA = cairo_image_surface_get_data(CAIROSURFACE); - m_tTexture.allocate(); - glBindTexture(GL_TEXTURE_2D, m_tTexture.m_iTexID); + m_pTexture->allocate(); + glBindTexture(GL_TEXTURE_2D, m_pTexture->m_iTexID); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); @@ -170,7 +171,7 @@ void CHyprError::draw() { if (!m_fFadeOpacity.isBeingAnimated()) { if (m_fFadeOpacity.value() == 0.f) { m_bQueuedDestroy = false; - m_tTexture.destroyTexture(); + m_pTexture->destroyTexture(); m_bIsCreated = false; m_szQueued = ""; return; @@ -193,7 +194,7 @@ void CHyprError::draw() { m_bMonitorChanged = false; - g_pHyprOpenGL->renderTexture(m_tTexture, &monbox, m_fFadeOpacity.value(), 0); + g_pHyprOpenGL->renderTexture(m_pTexture, &monbox, m_fFadeOpacity.value(), 0); } void CHyprError::destroy() { diff --git a/src/hyprerror/HyprError.hpp b/src/hyprerror/HyprError.hpp index aaa8bd12..8dbb4521 100644 --- a/src/hyprerror/HyprError.hpp +++ b/src/hyprerror/HyprError.hpp @@ -21,7 +21,7 @@ class CHyprError { CColor m_cQueued; bool m_bQueuedDestroy = false; bool m_bIsCreated = false; - CTexture m_tTexture; + SP<CTexture> m_pTexture; CAnimatedVariable<float> m_fFadeOpacity; CBox m_bDamageBox = {0, 0, 0, 0}; |