mirror of
https://github.com/hyprwm/Hyprland
synced 2026-05-07 06:18:05 +02:00
pass/surface: cache texBox
This commit is contained in:
parent
0448e707fc
commit
a1c8c2f1f4
2 changed files with 11 additions and 1 deletions
|
|
@ -18,6 +18,9 @@ CSurfacePassElement::CSurfacePassElement(const CSurfacePassElement::SRenderData&
|
|||
}
|
||||
|
||||
CBox CSurfacePassElement::getTexBox() {
|
||||
if (m_texBoxCached)
|
||||
return m_cachedTexBox;
|
||||
|
||||
const double outputX = -m_data.pMonitor->m_position.x, outputY = -m_data.pMonitor->m_position.y;
|
||||
|
||||
const auto INTERACTIVERESIZEINPROGRESS = m_data.pWindow && g_layoutManager->dragController()->target() && g_layoutManager->dragController()->mode() == MBIND_RESIZE;
|
||||
|
|
@ -69,7 +72,10 @@ CBox CSurfacePassElement::getTexBox() {
|
|||
windowBox.height = m_data.h - m_data.localPos.y;
|
||||
}
|
||||
|
||||
return windowBox;
|
||||
m_cachedTexBox = windowBox;
|
||||
m_texBoxCached = true;
|
||||
|
||||
return m_cachedTexBox;
|
||||
}
|
||||
|
||||
bool CSurfacePassElement::needsLiveBlur() {
|
||||
|
|
|
|||
|
|
@ -73,4 +73,8 @@ class CSurfacePassElement : public IPassElement {
|
|||
SRenderData m_data;
|
||||
|
||||
CBox getTexBox();
|
||||
|
||||
private:
|
||||
bool m_texBoxCached = false;
|
||||
CBox m_cachedTexBox = {};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue