enable UV calcs for all surfaces

This commit is contained in:
vaxerski 2023-01-29 13:58:47 +00:00
parent 38011c50ab
commit 3d83a0bc5f
2 changed files with 9 additions and 8 deletions

View file

@ -25,8 +25,7 @@ void renderSurface(struct wlr_surface* surface, int x, int y, void* data) {
windowBox.height = RDATA->h - y; windowBox.height = RDATA->h - y;
} }
if (RDATA->pWindow) g_pHyprRenderer->calculateUVForSurface(RDATA->pWindow, surface, RDATA->squishOversized);
g_pHyprRenderer->calculateUVForWindowSurface(RDATA->pWindow, surface, RDATA->squishOversized);
scaleBox(&windowBox, RDATA->pMonitor->scale); scaleBox(&windowBox, RDATA->pMonitor->scale);
@ -539,8 +538,8 @@ void CHyprRenderer::renderAllClientsForMonitor(const int& ID, timespec* time) {
renderDragIcon(PMONITOR, time); renderDragIcon(PMONITOR, time);
} }
void CHyprRenderer::calculateUVForWindowSurface(CWindow* pWindow, wlr_surface* pSurface, bool main) { void CHyprRenderer::calculateUVForSurface(CWindow* pWindow, wlr_surface* pSurface, bool main) {
if (!pWindow->m_bIsX11) { if (!pWindow || !pWindow->m_bIsX11) {
Vector2D uvTL; Vector2D uvTL;
Vector2D uvBR = Vector2D(1, 1); Vector2D uvBR = Vector2D(1, 1);
@ -570,7 +569,7 @@ void CHyprRenderer::calculateUVForWindowSurface(CWindow* pWindow, wlr_surface* p
g_pHyprOpenGL->m_RenderData.primarySurfaceUVBottomRight = Vector2D(-1, -1); g_pHyprOpenGL->m_RenderData.primarySurfaceUVBottomRight = Vector2D(-1, -1);
} }
if (!main) if (!main || !pWindow)
return; return;
wlr_box geom; wlr_box geom;

View file

@ -10,14 +10,16 @@
struct SMonitorRule; struct SMonitorRule;
// TODO: add fuller damage tracking for updating only parts of a window // TODO: add fuller damage tracking for updating only parts of a window
enum DAMAGETRACKINGMODES { enum DAMAGETRACKINGMODES
{
DAMAGE_TRACKING_INVALID = -1, DAMAGE_TRACKING_INVALID = -1,
DAMAGE_TRACKING_NONE = 0, DAMAGE_TRACKING_NONE = 0,
DAMAGE_TRACKING_MONITOR, DAMAGE_TRACKING_MONITOR,
DAMAGE_TRACKING_FULL DAMAGE_TRACKING_FULL
}; };
enum eRenderPassMode { enum eRenderPassMode
{
RENDER_PASS_ALL = 0, RENDER_PASS_ALL = 0,
RENDER_PASS_MAIN, RENDER_PASS_MAIN,
RENDER_PASS_POPUP RENDER_PASS_POPUP
@ -43,7 +45,7 @@ class CHyprRenderer {
bool shouldRenderWindow(CWindow*); bool shouldRenderWindow(CWindow*);
void ensureCursorRenderingMode(); void ensureCursorRenderingMode();
bool shouldRenderCursor(); bool shouldRenderCursor();
void calculateUVForWindowSurface(CWindow*, wlr_surface*, bool main = false); void calculateUVForSurface(CWindow*, wlr_surface*, bool main = false);
bool m_bWindowRequestedCursorHide = false; bool m_bWindowRequestedCursorHide = false;
bool m_bBlockSurfaceFeedback = false; bool m_bBlockSurfaceFeedback = false;