From 6967a31450441fc5605c05db6f65505dace4b263 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Sat, 8 Jun 2024 10:07:59 +0200 Subject: wayland/core: move to new impl (#6268) * wayland/core/dmabuf: move to new impl it's the final countdown --- src/hyprerror/HyprError.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/hyprerror/HyprError.cpp') 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(); } 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() { -- cgit v1.2.3