summaryrefslogtreecommitdiff
path: root/src/render/OpenGL.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-07-22 13:01:55 +0200
committerVaxry <vaxry@vaxry.net>2024-07-22 13:01:55 +0200
commit1797319a0785cf9ae4f406d40bc27b032c6f5fb2 (patch)
tree95c5f204e9abbc5e5828ebb81d9f64e64e7861ed /src/render/OpenGL.cpp
parent5979ceb56b165ee35809a0eeda5f4be1aedbb7b6 (diff)
renderer: untransform textures matching display transform
fixes #6754 This will break if the client uses a transform that is not equal to the display, reverting to old behavior. Combining transforms is left as a todo for the future.
Diffstat (limited to 'src/render/OpenGL.cpp')
-rw-r--r--src/render/OpenGL.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp
index b2b046ce..fef69f7c 100644
--- a/src/render/OpenGL.cpp
+++ b/src/render/OpenGL.cpp
@@ -1277,9 +1277,13 @@ void CHyprOpenGLImpl::renderTextureInternalWithDamage(SP<CTexture> tex, CBox* pB
static auto PDIMINACTIVE = CConfigValue<Hyprlang::INT>("decoration:dim_inactive");
static auto PDT = CConfigValue<Hyprlang::INT>("debug:damage_tracking");
- // get transform
- const auto TRANSFORM = wlTransformToHyprutils(invertTransform(!m_bEndFrame ? WL_OUTPUT_TRANSFORM_NORMAL : m_RenderData.pMonitor->transform));
- float matrix[9];
+ // get the needed transform for this texture
+ const bool TRANSFORMS_MATCH = wlTransformToHyprutils(m_RenderData.pMonitor->transform) == tex->m_eTransform; // FIXME: combine them properly!!!
+ eTransform TRANSFORM = HYPRUTILS_TRANSFORM_NORMAL;
+ if (m_bEndFrame || TRANSFORMS_MATCH)
+ TRANSFORM = wlTransformToHyprutils(invertTransform(m_RenderData.pMonitor->transform));
+
+ float matrix[9];
projectBox(matrix, newBox, TRANSFORM, newBox.rot, m_RenderData.monitorProjection.data());
float glMatrix[9];