summaryrefslogtreecommitdiff
path: root/src/render/OpenGL.cpp
diff options
context:
space:
mode:
authorFelix Dick <felix.dick@web.de>2022-09-29 23:19:56 +0200
committerFelix Dick <felix.dick@web.de>2022-09-29 23:19:56 +0200
commit6eb7d0038644fab09c8512ad34cdcbde1882ffc0 (patch)
treea4bb4f382b25a924b04923a5fa52ba98e6e1d5f2 /src/render/OpenGL.cpp
parente5dced8b3fccfe0048a55da197b8851e956a08ef (diff)
Send absolute screen coordinates to texture shaders.
Diffstat (limited to 'src/render/OpenGL.cpp')
-rw-r--r--src/render/OpenGL.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp
index 02100b38..29b479b6 100644
--- a/src/render/OpenGL.cpp
+++ b/src/render/OpenGL.cpp
@@ -334,15 +334,13 @@ void CHyprOpenGLImpl::renderRectWithDamage(wlr_box* box, const CColor& col, pixm
glUniformMatrix3fv(m_RenderData.pCurrentMonData->m_shQUAD.proj, 1, GL_FALSE, glMatrix);
glUniform4f(m_RenderData.pCurrentMonData->m_shQUAD.color, col.r / 255.f, col.g / 255.f, col.b / 255.f, col.a / 255.f);
- const auto TOPLEFT = Vector2D(round, round);
- const auto BOTTOMRIGHT = Vector2D(box->width - round, box->height - round);
+ const auto TOPLEFT = Vector2D(box->x, box->y);
const auto FULLSIZE = Vector2D(box->width, box->height);
static auto *const PMULTISAMPLEEDGES = &g_pConfigManager->getConfigValuePtr("decoration:multisample_edges")->intValue;
// Rounded corners
glUniform2f(m_RenderData.pCurrentMonData->m_shQUAD.topLeft, (float)TOPLEFT.x, (float)TOPLEFT.y);
- glUniform2f(m_RenderData.pCurrentMonData->m_shQUAD.bottomRight, (float)BOTTOMRIGHT.x, (float)BOTTOMRIGHT.y);
glUniform2f(m_RenderData.pCurrentMonData->m_shQUAD.fullSize, (float)FULLSIZE.x, (float)FULLSIZE.y);
glUniform1f(m_RenderData.pCurrentMonData->m_shQUAD.radius, round);
glUniform1i(m_RenderData.pCurrentMonData->m_shQUAD.primitiveMultisample, (int)(*PMULTISAMPLEEDGES == 1 && round != 0));
@@ -438,9 +436,8 @@ void CHyprOpenGLImpl::renderTextureInternalWithDamage(const CTexture& tex, wlr_b
static auto *const PMULTISAMPLEEDGES = &g_pConfigManager->getConfigValuePtr("decoration:multisample_edges")->intValue;
// Rounded corners
- glUniform2f(shader->topLeft, (float)TOPLEFT.x, (float)TOPLEFT.y);
- glUniform2f(shader->bottomRight, (float)BOTTOMRIGHT.x, (float)BOTTOMRIGHT.y);
- glUniform2f(shader->fullSize, (float)FULLSIZE.x, (float)FULLSIZE.y);
+ glUniform2f(shader->topLeft, pBox->x, pBox->y);
+ glUniform2f(shader->fullSize, pBox->width, pBox->height);
glUniform1f(shader->radius, round);
glUniform1i(shader->primitiveMultisample, (int)(*PMULTISAMPLEEDGES == 1 && round != 0 && !noAA));