From f5ab88e770890259329341cf7a9e7f625bf8e811 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sun, 10 Nov 2024 20:17:31 +0000 Subject: thanks ujin --- src/managers/PointerManager.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/managers/PointerManager.cpp b/src/managers/PointerManager.cpp index a98a0228..d6189acd 100644 --- a/src/managers/PointerManager.cpp +++ b/src/managers/PointerManager.cpp @@ -459,7 +459,13 @@ SP CPointerManager::renderHWCursorBuffer(SPbeginDataPtr(0); - memcpy(data, texData.data(), std::min(size, texData.size())); + memset(data, 0, size); + if (buf->dmabuf().size.x > texture->m_vSize.x) { + size_t STRIDE = 4 * texture->m_vSize.x; + for (int i = 0; i < texture->m_vSize.y; i++) + memcpy(data + i * buf->dmabuf().strides[0], texData.data() + i * STRIDE, STRIDE); + } else + memcpy(data, texData.data(), std::min(size, texData.size())); buf->endDataPtr(); -- cgit v1.2.3