mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-02 08:05:59 +01:00
renderer: Allocate background texture only if required (#4111)
This commit is contained in:
parent
0c10b8ab2d
commit
efdf07e295
1 changed files with 4 additions and 0 deletions
|
@ -1897,12 +1897,16 @@ void CHyprOpenGLImpl::renderSplash(cairo_t* const CAIRO, cairo_surface_t* const
|
||||||
void CHyprOpenGLImpl::createBGTextureForMonitor(CMonitor* pMonitor) {
|
void CHyprOpenGLImpl::createBGTextureForMonitor(CMonitor* pMonitor) {
|
||||||
RASSERT(m_RenderData.pMonitor, "Tried to createBGTex without begin()!");
|
RASSERT(m_RenderData.pMonitor, "Tried to createBGTex without begin()!");
|
||||||
|
|
||||||
|
static auto* const PRENDERTEX = &g_pConfigManager->getConfigValuePtr("misc:disable_hyprland_logo")->intValue;
|
||||||
static auto* const PNOSPLASH = &g_pConfigManager->getConfigValuePtr("misc:disable_splash_rendering")->intValue;
|
static auto* const PNOSPLASH = &g_pConfigManager->getConfigValuePtr("misc:disable_splash_rendering")->intValue;
|
||||||
static auto* const PFORCEHYPRCHAN = &g_pConfigManager->getConfigValuePtr("misc:force_hypr_chan")->intValue;
|
static auto* const PFORCEHYPRCHAN = &g_pConfigManager->getConfigValuePtr("misc:force_hypr_chan")->intValue;
|
||||||
static auto* const PFORCEWALLPAPER = &g_pConfigManager->getConfigValuePtr("misc:force_default_wallpaper")->intValue;
|
static auto* const PFORCEWALLPAPER = &g_pConfigManager->getConfigValuePtr("misc:force_default_wallpaper")->intValue;
|
||||||
|
|
||||||
const auto FORCEWALLPAPER = std::clamp(*PFORCEWALLPAPER, static_cast<int64_t>(-1L), static_cast<int64_t>(2L));
|
const auto FORCEWALLPAPER = std::clamp(*PFORCEWALLPAPER, static_cast<int64_t>(-1L), static_cast<int64_t>(2L));
|
||||||
|
|
||||||
|
if (*PRENDERTEX)
|
||||||
|
return;
|
||||||
|
|
||||||
// release the last tex if exists
|
// release the last tex if exists
|
||||||
const auto PTEX = &m_mMonitorBGTextures[pMonitor];
|
const auto PTEX = &m_mMonitorBGTextures[pMonitor];
|
||||||
PTEX->destroyTexture();
|
PTEX->destroyTexture();
|
||||||
|
|
Loading…
Reference in a new issue