aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/managers/PointerManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/managers/PointerManager.cpp')
-rw-r--r--src/managers/PointerManager.cpp8
1 files changed, 7 insertions, 1 deletions
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<Aquamarine::IBuffer> CPointerManager::renderHWCursorBuffer(SP<CPointerManager
auto [data, fmt, size] = buf->beginDataPtr(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();